Changes in uspace/srv/net/nil/eth/eth.c [4eca056:fb04cba8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
r4eca056 rfb04cba8 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_type 160 */ 161 typedef eth_addr_type_t *eth_addr_type_ref; 162 158 163 /** Ethernet address type. */ 159 164 enum eth_addr_type { … … 173 178 { 174 179 int index; 175 eth_proto_ t *proto;180 eth_proto_ref proto; 176 181 177 182 fibril_rwlock_read_lock(ð_globals.protos_lock); … … 281 286 size_t mtu) 282 287 { 283 eth_device_ t *device;288 eth_device_ref device; 284 289 int index; 285 290 measured_string_t names[2] = { … … 293 298 } 294 299 }; 295 measured_string_ t *configuration;300 measured_string_ref configuration; 296 301 size_t count = sizeof(names) / sizeof(measured_string_t); 297 302 char *data; 298 eth_proto_ t *proto;303 eth_proto_ref proto; 299 304 int rc; 300 305 … … 337 342 338 343 /* Create a new device */ 339 device = (eth_device_ t *) malloc(sizeof(eth_device_t));344 device = (eth_device_ref) malloc(sizeof(eth_device_t)); 340 345 if (!device) 341 346 return ENOMEM; … … 429 434 * @returns NULL if the packet address length is not big enough. 430 435 */ 431 static eth_proto_ t *eth_process_packet(int flags, packet_t packet)432 { 433 eth_header_snap_ t *header;436 static eth_proto_ref eth_process_packet(int flags, packet_t packet) 437 { 438 eth_header_snap_ref header; 434 439 size_t length; 435 440 eth_type_t type; 436 441 size_t prefix; 437 442 size_t suffix; 438 eth_fcs_ t *fcs;443 eth_fcs_ref fcs; 439 444 uint8_t *data; 440 445 int rc; … … 449 454 450 455 data = packet_get_data(packet); 451 header = (eth_header_snap_ t *) data;456 header = (eth_header_snap_ref) data; 452 457 type = ntohs(header->header.ethertype); 453 458 … … 456 461 prefix = sizeof(eth_header_t); 457 462 suffix = 0; 458 fcs = (eth_fcs_ t *) data + length - sizeof(eth_fcs_t);463 fcs = (eth_fcs_ref) data + length - sizeof(eth_fcs_t); 459 464 length -= sizeof(eth_fcs_t); 460 465 } else if(type <= ETH_MAX_CONTENT) { … … 482 487 483 488 suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U; 484 fcs = (eth_fcs_ t *) data + prefix + type + suffix;489 fcs = (eth_fcs_ref) data + prefix + type + suffix; 485 490 suffix += length - prefix - type; 486 491 length = prefix + type + suffix; … … 511 516 packet_t packet, services_t target) 512 517 { 513 eth_proto_ t *proto;518 eth_proto_ref proto; 514 519 packet_t next; 515 eth_device_ t *device;520 eth_device_ref device; 516 521 int flags; 517 522 … … 559 564 size_t *prefix, size_t *content, size_t *suffix) 560 565 { 561 eth_device_ t *device;566 eth_device_ref device; 562 567 563 568 if (!addr_len || !prefix || !content || !suffix) … … 591 596 */ 592 597 static int eth_addr_message(device_id_t device_id, eth_addr_type_t type, 593 measured_string_ t **address)594 { 595 eth_device_ t *device;598 measured_string_ref *address) 599 { 600 eth_device_ref device; 596 601 597 602 if (!address) … … 626 631 static int eth_register_message(services_t service, int phone) 627 632 { 628 eth_proto_ t *proto;633 eth_proto_ref proto; 629 634 int protocol; 630 635 int index; … … 641 646 return EOK; 642 647 } else { 643 proto = (eth_proto_ t *) malloc(sizeof(eth_proto_t));648 proto = (eth_proto_ref) malloc(sizeof(eth_proto_t)); 644 649 if (!proto) { 645 650 fibril_rwlock_write_unlock(ð_globals.protos_lock); … … 683 688 size_t mtu) 684 689 { 685 eth_header_snap_ t *header;686 eth_header_lsap_ t *header_lsap;687 eth_header_ t *header_dix;688 eth_fcs_ t *fcs;690 eth_header_snap_ref header; 691 eth_header_lsap_ref header_lsap; 692 eth_header_ref header_dix; 693 eth_fcs_ref fcs; 689 694 uint8_t *src; 690 695 uint8_t *dest; … … 692 697 int i; 693 698 void *padding; 694 eth_preamble_ t *preamble;699 eth_preamble_ref preamble; 695 700 696 701 i = packet_get_addr(packet, &src, &dest); … … 790 795 services_t sender) 791 796 { 792 eth_device_ t *device;797 eth_device_ref device; 793 798 packet_t next; 794 799 packet_t tmp; … … 840 845 ipc_call_t *call, ipc_call_t *answer, int *answer_count) 841 846 { 842 measured_string_ t *address;847 measured_string_ref address; 843 848 packet_t packet; 844 849 size_t addrlen;
Note:
See TracChangeset
for help on using the changeset viewer.