Changeset 4e5c7ba in mainline for uspace/srv/net/nil
- Timestamp:
- 2010-11-18T22:36:12Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f772bc55
- Parents:
- cb569e6
- Location:
- uspace/srv/net/nil
- Files:
-
- 5 edited
-
eth/eth.c (modified) (16 diffs)
-
eth/eth.h (modified) (1 diff)
-
eth/eth_header.h (modified) (4 diffs)
-
nildummy/nildummy.c (modified) (5 diffs)
-
nildummy/nildummy.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
rcb569e6 r4e5c7ba 178 178 { 179 179 int index; 180 eth_proto_ refproto;180 eth_proto_t *proto; 181 181 182 182 fibril_rwlock_read_lock(ð_globals.protos_lock); … … 286 286 size_t mtu) 287 287 { 288 eth_device_ refdevice;288 eth_device_t *device; 289 289 int index; 290 290 measured_string_t names[2] = { … … 301 301 size_t count = sizeof(names) / sizeof(measured_string_t); 302 302 char *data; 303 eth_proto_ refproto;303 eth_proto_t *proto; 304 304 int rc; 305 305 … … 342 342 343 343 /* Create a new device */ 344 device = (eth_device_ ref) malloc(sizeof(eth_device_t));344 device = (eth_device_t *) malloc(sizeof(eth_device_t)); 345 345 if (!device) 346 346 return ENOMEM; … … 434 434 * @returns NULL if the packet address length is not big enough. 435 435 */ 436 static eth_proto_ refeth_process_packet(int flags, packet_t packet)437 { 438 eth_header_snap_ refheader;436 static eth_proto_t *eth_process_packet(int flags, packet_t packet) 437 { 438 eth_header_snap_t *header; 439 439 size_t length; 440 440 eth_type_t type; 441 441 size_t prefix; 442 442 size_t suffix; 443 eth_fcs_ reffcs;443 eth_fcs_t *fcs; 444 444 uint8_t *data; 445 445 int rc; … … 454 454 455 455 data = packet_get_data(packet); 456 header = (eth_header_snap_ ref) data;456 header = (eth_header_snap_t *) data; 457 457 type = ntohs(header->header.ethertype); 458 458 … … 461 461 prefix = sizeof(eth_header_t); 462 462 suffix = 0; 463 fcs = (eth_fcs_ ref) data + length - sizeof(eth_fcs_t);463 fcs = (eth_fcs_t *) data + length - sizeof(eth_fcs_t); 464 464 length -= sizeof(eth_fcs_t); 465 465 } else if(type <= ETH_MAX_CONTENT) { … … 487 487 488 488 suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U; 489 fcs = (eth_fcs_ ref) data + prefix + type + suffix;489 fcs = (eth_fcs_t *) data + prefix + type + suffix; 490 490 suffix += length - prefix - type; 491 491 length = prefix + type + suffix; … … 516 516 packet_t packet, services_t target) 517 517 { 518 eth_proto_ refproto;518 eth_proto_t *proto; 519 519 packet_t next; 520 eth_device_ refdevice;520 eth_device_t *device; 521 521 int flags; 522 522 … … 564 564 size_t *prefix, size_t *content, size_t *suffix) 565 565 { 566 eth_device_ refdevice;566 eth_device_t *device; 567 567 568 568 if (!addr_len || !prefix || !content || !suffix) … … 598 598 measured_string_ref *address) 599 599 { 600 eth_device_ refdevice;600 eth_device_t *device; 601 601 602 602 if (!address) … … 631 631 static int eth_register_message(services_t service, int phone) 632 632 { 633 eth_proto_ refproto;633 eth_proto_t *proto; 634 634 int protocol; 635 635 int index; … … 646 646 return EOK; 647 647 } else { 648 proto = (eth_proto_ ref) malloc(sizeof(eth_proto_t));648 proto = (eth_proto_t *) malloc(sizeof(eth_proto_t)); 649 649 if (!proto) { 650 650 fibril_rwlock_write_unlock(ð_globals.protos_lock); … … 688 688 size_t mtu) 689 689 { 690 eth_header_snap_ refheader;691 eth_header_lsap_ refheader_lsap;692 eth_header_ refheader_dix;693 eth_fcs_ reffcs;690 eth_header_snap_t *header; 691 eth_header_lsap_t *header_lsap; 692 eth_header_t *header_dix; 693 eth_fcs_t *fcs; 694 694 uint8_t *src; 695 695 uint8_t *dest; … … 697 697 int i; 698 698 void *padding; 699 eth_preamble_ refpreamble;699 eth_preamble_t *preamble; 700 700 701 701 i = packet_get_addr(packet, &src, &dest); … … 795 795 services_t sender) 796 796 { 797 eth_device_ refdevice;797 eth_device_t *device; 798 798 packet_t next; 799 799 packet_t tmp; -
uspace/srv/net/nil/eth/eth.h
rcb569e6 r4e5c7ba 54 54 typedef struct eth_device eth_device_t; 55 55 56 /** Type definition of the Ethernet device specific data pointer.57 * @see eth_device58 */59 typedef eth_device_t *eth_device_ref;60 61 56 /** Type definition of the Ethernet protocol specific data. 62 57 * @see eth_proto 63 58 */ 64 59 typedef struct eth_proto eth_proto_t; 65 66 /** Type definition of the Ethernet protocol specific data pointer.67 * @see eth_proto68 */69 typedef eth_proto_t *eth_proto_ref;70 60 71 61 /** Ethernet device map. -
uspace/srv/net/nil/eth/eth_header.h
rcb569e6 r4e5c7ba 58 58 typedef struct eth_header_snap eth_header_snap_t; 59 59 60 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions61 * pointer.62 *63 * @see eth_header_snap64 */65 typedef eth_header_snap_t *eth_header_snap_ref;66 67 60 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions. 68 61 * @see eth_header_lsap 69 62 */ 70 63 typedef struct eth_header_lsap eth_header_lsap_t; 71 72 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 extension pointer.73 * @see eth_header_lsap74 */75 typedef eth_header_lsap_t *eth_header_lsap_ref;76 64 77 65 /** Type definition of the Ethernet header LSAP extension. … … 80 68 typedef struct eth_ieee_lsap eth_ieee_lsap_t; 81 69 82 /** Type definition of the Ethernet header LSAP extension pointer.83 * @see eth_ieee_lsap84 */85 typedef eth_ieee_lsap_t *eth_ieee_lsap_ref;86 87 70 /** Type definition of the Ethernet header SNAP extension. 88 71 * @see eth_snap 89 72 */ 90 73 typedef struct eth_snap eth_snap_t; 91 92 /** Type definition of the Ethernet header SNAP extension pointer.93 * @see eth_snap94 */95 typedef eth_snap_t *eth_snap_ref;96 74 97 75 /** Type definition of the Ethernet header preamble. … … 100 78 typedef struct eth_preamble eth_preamble_t; 101 79 102 /** Type definition of the Ethernet header preamble pointer.103 * @see eth_preamble104 */105 typedef eth_preamble_t *eth_preamble_ref;106 107 80 /** Type definition of the Ethernet header. 108 81 * @see eth_header 109 82 */ 110 83 typedef struct eth_header eth_header_t; 111 112 /** Type definition of the Ethernet header pointer.113 * @see eth_header114 */115 typedef eth_header_t *eth_header_ref;116 84 117 85 /** Ethernet header Link Service Access Point extension. */ … … 219 187 typedef uint32_t eth_fcs_t; 220 188 221 /** Ethernet Frame Check Sequence pointer. */222 typedef eth_fcs_t *eth_fcs_ref;223 224 189 #endif 225 190 -
uspace/srv/net/nil/nildummy/nildummy.c
rcb569e6 r4e5c7ba 153 153 size_t mtu) 154 154 { 155 nildummy_device_ refdevice;155 nildummy_device_t *device; 156 156 int index; 157 157 int rc; … … 192 192 193 193 /* Create a new device */ 194 device = (nildummy_device_ ref) malloc(sizeof(nildummy_device_t));194 device = (nildummy_device_t *) malloc(sizeof(nildummy_device_t)); 195 195 if (!device) 196 196 return ENOMEM; … … 250 250 measured_string_ref *address) 251 251 { 252 nildummy_device_ refdevice;252 nildummy_device_t *device; 253 253 254 254 if (!address) … … 282 282 size_t *prefix, size_t *content, size_t *suffix) 283 283 { 284 nildummy_device_ refdevice;284 nildummy_device_t *device; 285 285 286 286 if (!addr_len || !prefix || !content || !suffix) … … 357 357 services_t sender) 358 358 { 359 nildummy_device_ refdevice;359 nildummy_device_t *device; 360 360 361 361 fibril_rwlock_read_lock(&nildummy_globals.devices_lock); -
uspace/srv/net/nil/nildummy/nildummy.h
rcb569e6 r4e5c7ba 54 54 typedef struct nildummy_device nildummy_device_t; 55 55 56 /** Type definition of the dummy nil device specific data pointer.57 * @see nildummy_device58 */59 typedef nildummy_device_t *nildummy_device_ref;60 61 56 /** Type definition of the dummy nil protocol specific data. 62 57 * @see nildummy_proto 63 58 */ 64 59 typedef struct nildummy_proto nildummy_proto_t; 65 66 /** Type definition of the dummy nil protocol specific data pointer.67 * @see nildummy_proto68 */69 typedef nildummy_proto_t *nildummy_proto_ref;70 60 71 61 /** Dummy nil device map.
Note:
See TracChangeset
for help on using the changeset viewer.
