diff options
author | dzwdz | 2023-01-25 20:16:22 +0100 |
---|---|---|
committer | dzwdz | 2023-01-25 20:16:22 +0100 |
commit | 17bfb0ef0a48330b1d54e61fe3c30d83528d2d90 (patch) | |
tree | b3d4aed1f408edcb17fe5c86fccaeacaa2a5a48a /src/user/app/netstack/proto.h | |
parent | 2ad6ee8ed15d1bf898645a16dbc06991a3c1425e (diff) |
style: typedef structs, shorter namespaces
I've wanted to do this for a while, and since I've just had a relatively
large refactor commit (pcpy), this is as good of a time as any.
Typedefing structs was mostly inspired by Plan 9's coding style. It makes
some lines of code much shorter at basically no expense.
Everything related to userland kept old-style struct definitions, so as not
to force that style onto other people.
I also considered changing SCREAMING_ENUM_FIELDS to NicerLookingCamelcase,
but I didn't, just in case that'd be confusing.
Diffstat (limited to 'src/user/app/netstack/proto.h')
-rw-r--r-- | src/user/app/netstack/proto.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/user/app/netstack/proto.h b/src/user/app/netstack/proto.h index 4d881ca..8ea11ac 100644 --- a/src/user/app/netstack/proto.h +++ b/src/user/app/netstack/proto.h @@ -10,7 +10,7 @@ extern struct net_state { mac_t mac; uint32_t ip, gateway; - handle_t raw_h; + hid_t raw_h; } state; enum { /* ethertype */ @@ -51,7 +51,7 @@ struct icmp { * will break if i implement a scheduler*/ struct ethq { struct ethq *next; - handle_t h; + hid_t h; }; extern struct ethq *ether_queue; @@ -59,7 +59,7 @@ void arp_parse(const uint8_t *buf, size_t len); void arp_request(uint32_t ip); /* 0 on success, -1 on failure */ int arpcache_get(uint32_t ip, mac_t *mac); -void arp_fsread(handle_t h, long offset); +void arp_fsread(hid_t h, long offset); long arp_fswrite(const char *buf, long len, long offset); void icmp_parse(const uint8_t *buf, size_t len, struct ipv4 ip); |