Changeset a7811f17 in mainline for uspace/srv/net/nil
- Timestamp:
- 2010-11-19T21:28:02Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a9c6b966
- Parents:
- 45f04f8 (diff), aaa3f33a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/srv/net/nil
- Files:
-
- 5 edited
-
eth/eth.c (modified) (18 diffs)
-
eth/eth.h (modified) (3 diffs)
-
eth/eth_header.h (modified) (4 diffs)
-
nildummy/nildummy.c (modified) (6 diffs)
-
nildummy/nildummy.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
r45f04f8 ra7811f17 156 156 typedef enum eth_addr_type eth_addr_type_t; 157 157 158 /** Type definition of the ethernet address type pointer.159 * @see eth_addr_type160 */161 typedef eth_addr_type_t *eth_addr_type_ref;162 163 158 /** Ethernet address type. */ 164 159 enum eth_addr_type { … … 178 173 { 179 174 int index; 180 eth_proto_ refproto;175 eth_proto_t *proto; 181 176 182 177 fibril_rwlock_read_lock(ð_globals.protos_lock); … … 286 281 size_t mtu) 287 282 { 288 eth_device_ refdevice;283 eth_device_t *device; 289 284 int index; 290 285 measured_string_t names[2] = { … … 298 293 } 299 294 }; 300 measured_string_ refconfiguration;295 measured_string_t *configuration; 301 296 size_t count = sizeof(names) / sizeof(measured_string_t); 302 297 char *data; 303 eth_proto_ refproto;298 eth_proto_t *proto; 304 299 int rc; 305 300 … … 342 337 343 338 /* Create a new device */ 344 device = (eth_device_ ref) malloc(sizeof(eth_device_t));339 device = (eth_device_t *) malloc(sizeof(eth_device_t)); 345 340 if (!device) 346 341 return ENOMEM; … … 434 429 * @returns NULL if the packet address length is not big enough. 435 430 */ 436 static eth_proto_ refeth_process_packet(int flags, packet_t packet)437 { 438 eth_header_snap_ refheader;431 static eth_proto_t *eth_process_packet(int flags, packet_t packet) 432 { 433 eth_header_snap_t *header; 439 434 size_t length; 440 435 eth_type_t type; 441 436 size_t prefix; 442 437 size_t suffix; 443 eth_fcs_ reffcs;438 eth_fcs_t *fcs; 444 439 uint8_t *data; 445 440 int rc; … … 454 449 455 450 data = packet_get_data(packet); 456 header = (eth_header_snap_ ref) data;451 header = (eth_header_snap_t *) data; 457 452 type = ntohs(header->header.ethertype); 458 453 … … 461 456 prefix = sizeof(eth_header_t); 462 457 suffix = 0; 463 fcs = (eth_fcs_ ref) data + length - sizeof(eth_fcs_t);458 fcs = (eth_fcs_t *) data + length - sizeof(eth_fcs_t); 464 459 length -= sizeof(eth_fcs_t); 465 460 } else if(type <= ETH_MAX_CONTENT) { … … 487 482 488 483 suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U; 489 fcs = (eth_fcs_ ref) data + prefix + type + suffix;484 fcs = (eth_fcs_t *) data + prefix + type + suffix; 490 485 suffix += length - prefix - type; 491 486 length = prefix + type + suffix; … … 516 511 packet_t packet, services_t target) 517 512 { 518 eth_proto_ refproto;513 eth_proto_t *proto; 519 514 packet_t next; 520 eth_device_ refdevice;515 eth_device_t *device; 521 516 int flags; 522 517 … … 564 559 size_t *prefix, size_t *content, size_t *suffix) 565 560 { 566 eth_device_ refdevice;561 eth_device_t *device; 567 562 568 563 if (!addr_len || !prefix || !content || !suffix) … … 596 591 */ 597 592 static int eth_addr_message(device_id_t device_id, eth_addr_type_t type, 598 measured_string_ ref*address)599 { 600 eth_device_ refdevice;593 measured_string_t **address) 594 { 595 eth_device_t *device; 601 596 602 597 if (!address) … … 631 626 static int eth_register_message(services_t service, int phone) 632 627 { 633 eth_proto_ refproto;628 eth_proto_t *proto; 634 629 int protocol; 635 630 int index; … … 646 641 return EOK; 647 642 } else { 648 proto = (eth_proto_ ref) malloc(sizeof(eth_proto_t));643 proto = (eth_proto_t *) malloc(sizeof(eth_proto_t)); 649 644 if (!proto) { 650 645 fibril_rwlock_write_unlock(ð_globals.protos_lock); … … 688 683 size_t mtu) 689 684 { 690 eth_header_snap_ refheader;691 eth_header_lsap_ refheader_lsap;692 eth_header_ refheader_dix;693 eth_fcs_ reffcs;685 eth_header_snap_t *header; 686 eth_header_lsap_t *header_lsap; 687 eth_header_t *header_dix; 688 eth_fcs_t *fcs; 694 689 uint8_t *src; 695 690 uint8_t *dest; … … 697 692 int i; 698 693 void *padding; 699 eth_preamble_ refpreamble;694 eth_preamble_t *preamble; 700 695 701 696 i = packet_get_addr(packet, &src, &dest); … … 795 790 services_t sender) 796 791 { 797 eth_device_ refdevice;792 eth_device_t *device; 798 793 packet_t next; 799 794 packet_t tmp; … … 845 840 ipc_call_t *call, ipc_call_t *answer, int *answer_count) 846 841 { 847 measured_string_ refaddress;842 measured_string_t *address; 848 843 packet_t packet; 849 844 size_t addrlen; -
uspace/srv/net/nil/eth/eth.h
r45f04f8 ra7811f17 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. … … 100 90 101 91 /** Actual device hardware address. */ 102 measured_string_ refaddr;92 measured_string_t *addr; 103 93 /** Actual device hardware address data. */ 104 94 char *addr_data; … … 133 123 134 124 /** Broadcast device hardware address. */ 135 measured_string_ refbroadcast_addr;125 measured_string_t *broadcast_addr; 136 126 }; 137 127 -
uspace/srv/net/nil/eth/eth_header.h
r45f04f8 ra7811f17 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
r45f04f8 ra7811f17 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; … … 248 248 */ 249 249 static int nildummy_addr_message(device_id_t device_id, 250 measured_string_ ref*address)251 { 252 nildummy_device_ refdevice;250 measured_string_t **address) 251 { 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); … … 377 377 ipc_call_t *call, ipc_call_t *answer, int *answer_count) 378 378 { 379 measured_string_ refaddress;379 measured_string_t *address; 380 380 packet_t packet; 381 381 size_t addrlen; -
uspace/srv/net/nil/nildummy/nildummy.h
r45f04f8 ra7811f17 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. … … 86 76 size_t mtu; 87 77 /** Actual device hardware address. */ 88 measured_string_ refaddr;78 measured_string_t *addr; 89 79 /** Actual device hardware address data. */ 90 80 char *addr_data;
Note:
See TracChangeset
for help on using the changeset viewer.
