Changes in uspace/srv/net/nil/eth/eth.c [fb04cba8:4eca056] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
rfb04cba8 r4eca056 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;
Note:
See TracChangeset
for help on using the changeset viewer.