Changes in uspace/srv/net/il/arp/arp.c [fb04cba8:46d4d9f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
rfb04cba8 r46d4d9f 83 83 * @param[in] device The device specific data. 84 84 */ 85 static void arp_clear_device(arp_device_ refdevice)85 static void arp_clear_device(arp_device_t *device) 86 86 { 87 87 int count; 88 arp_proto_ refproto;88 arp_proto_t *proto; 89 89 90 90 for (count = arp_protos_count(&device->protos) - 1; count >= 0; … … 105 105 { 106 106 int count; 107 arp_device_ refdevice;107 arp_device_t *device; 108 108 109 109 fibril_rwlock_write_lock(&arp_globals.lock); … … 126 126 127 127 static int arp_clear_address_req(int arp_phone, device_id_t device_id, 128 services_t protocol, measured_string_ refaddress)129 { 130 arp_device_ refdevice;131 arp_proto_ refproto;128 services_t protocol, measured_string_t *address) 129 { 130 arp_device_t *device; 131 arp_proto_t *proto; 132 132 133 133 fibril_rwlock_write_lock(&arp_globals.lock); … … 150 150 static int arp_clear_device_req(int arp_phone, device_id_t device_id) 151 151 { 152 arp_device_ refdevice;152 arp_device_t *device; 153 153 154 154 fibril_rwlock_write_lock(&arp_globals.lock); … … 171 171 * @param[in] service The protocol module service. 172 172 * @param[in] address The actual protocol device address. 173 * @return sEOK on success.174 * @return sENOMEM if there is not enough memory left.175 */ 176 static int arp_proto_create(arp_proto_ ref*proto, services_t service,177 measured_string_ refaddress)173 * @return EOK on success. 174 * @return ENOMEM if there is not enough memory left. 175 */ 176 static int arp_proto_create(arp_proto_t **proto, services_t service, 177 measured_string_t *address) 178 178 { 179 179 int rc; 180 180 181 *proto = (arp_proto_ ref) malloc(sizeof(arp_proto_t));181 *proto = (arp_proto_t *) malloc(sizeof(arp_proto_t)); 182 182 if (!*proto) 183 183 return ENOMEM; … … 205 205 * @param[in] protocol The protocol service. 206 206 * @param[in] address The actual device protocol address. 207 * @return sEOK on success.208 * @return sEEXIST if another device with the same device identifier207 * @return EOK on success. 208 * @return EEXIST if another device with the same device identifier 209 209 * and different driver service exists. 210 * @return sENOMEM if there is not enough memory left.211 * @return sOther error codes as defined for the210 * @return ENOMEM if there is not enough memory left. 211 * @return Other error codes as defined for the 212 212 * measured_strings_return() function. 213 213 */ 214 214 static int arp_device_message(device_id_t device_id, services_t service, 215 services_t protocol, measured_string_ refaddress)216 { 217 arp_device_ refdevice;218 arp_proto_ refproto;215 services_t protocol, measured_string_t *address) 216 { 217 arp_device_t *device; 218 arp_proto_t *proto; 219 219 hw_type_t hardware; 220 220 int index; … … 260 260 261 261 /* Create a new device */ 262 device = (arp_device_ ref) malloc(sizeof(arp_device_t));262 device = (arp_device_t *) malloc(sizeof(arp_device_t)); 263 263 if (!device) { 264 264 fibril_rwlock_write_unlock(&arp_globals.lock); … … 356 356 * @param[in] client_connection The client connection processing function. 357 357 * The module skeleton propagates its own one. 358 * @return sEOK on success.359 * @return sENOMEM if there is not enough memory left.358 * @return EOK on success. 359 * @return ENOMEM if there is not enough memory left. 360 360 */ 361 361 int arp_initialize(async_client_conn_t client_connection) … … 376 376 * @param[in] device_id The device identifier. 377 377 * @param[in] mtu The new mtu value. 378 * @return sENOENT if device is not found.379 * @return sEOK on success.378 * @return ENOENT if device is not found. 379 * @return EOK on success. 380 380 */ 381 381 static int arp_mtu_changed_message(device_id_t device_id, size_t mtu) 382 382 { 383 arp_device_ refdevice;383 arp_device_t *device; 384 384 385 385 fibril_rwlock_write_lock(&arp_globals.lock); … … 404 404 * @param[in] device_id The source device identifier. 405 405 * @param[in,out] packet The received packet. 406 * @return sEOK on success and the packet is no longer needed.407 * @return sOne on success and the packet has been reused.408 * @return sEINVAL if the packet is too small to carry an ARP406 * @return EOK on success and the packet is no longer needed. 407 * @return One on success and the packet has been reused. 408 * @return EINVAL if the packet is too small to carry an ARP 409 409 * packet. 410 * @return sEINVAL if the received address lengths differs from410 * @return EINVAL if the received address lengths differs from 411 411 * the registered values. 412 * @return sENOENT if the device is not found in the cache.413 * @return sENOENT if the protocol for the device is not found in412 * @return ENOENT if the device is not found in the cache. 413 * @return ENOENT if the protocol for the device is not found in 414 414 * the cache. 415 * @return sENOMEM if there is not enough memory left.416 */ 417 static int arp_receive_message(device_id_t device_id, packet_t packet)415 * @return ENOMEM if there is not enough memory left. 416 */ 417 static int arp_receive_message(device_id_t device_id, packet_t *packet) 418 418 { 419 419 size_t length; 420 arp_header_ refheader;421 arp_device_ refdevice;422 arp_proto_ refproto;423 measured_string_ refhw_source;420 arp_header_t *header; 421 arp_device_t *device; 422 arp_proto_t *proto; 423 measured_string_t *hw_source; 424 424 uint8_t *src_hw; 425 425 uint8_t *src_proto; … … 436 436 return ENOENT; 437 437 438 header = (arp_header_ ref) packet_get_data(packet);438 header = (arp_header_t *) packet_get_data(packet); 439 439 if ((ntohs(header->hardware) != device->hardware) || 440 440 (length < sizeof(arp_header_t) + header->hardware_length * 2U + … … 516 516 * @param[in] protocol The protocol service. 517 517 * @param[in] target The target protocol address. 518 * @return sThe hardware address of the target.519 * @return sNULL if the target parameter is NULL.520 * @return sNULL if the device is not found.521 * @return sNULL if the device packet is too small to send a518 * @return The hardware address of the target. 519 * @return NULL if the target parameter is NULL. 520 * @return NULL if the device is not found. 521 * @return NULL if the device packet is too small to send a 522 522 * request. 523 * @return sNULL if the hardware address is not found in the cache.524 */ 525 static measured_string_ ref523 * @return NULL if the hardware address is not found in the cache. 524 */ 525 static measured_string_t * 526 526 arp_translate_message(device_id_t device_id, services_t protocol, 527 measured_string_ reftarget)528 { 529 arp_device_ refdevice;530 arp_proto_ refproto;531 measured_string_ refaddr;527 measured_string_t *target) 528 { 529 arp_device_t *device; 530 arp_proto_t *proto; 531 measured_string_t *addr; 532 532 size_t length; 533 packet_t packet;534 arp_header_ refheader;533 packet_t *packet; 534 arp_header_t *header; 535 535 536 536 if (!target) … … 561 561 return NULL; 562 562 563 header = (arp_header_ ref) packet_suffix(packet, length);563 header = (arp_header_t *) packet_suffix(packet, length); 564 564 if (!header) { 565 565 pq_release_remote(arp_globals.net_phone, packet_get_id(packet)); … … 602 602 * @param[out] answer_count The last parameter for the actual answer in the 603 603 * answer parameter. 604 * @return sEOK on success.605 * @return sENOTSUP if the message is not known.604 * @return EOK on success. 605 * @return ENOTSUP if the message is not known. 606 606 * 607 607 * @see arp_interface.h … … 612 612 ipc_call_t *answer, int *answer_count) 613 613 { 614 measured_string_ refaddress;615 measured_string_ reftranslation;614 measured_string_t *address; 615 measured_string_t *translation; 616 616 char *data; 617 packet_t packet;618 packet_t next;617 packet_t *packet; 618 packet_t *next; 619 619 int rc; 620 620 … … 747 747 /** Starts the module. 748 748 * 749 * @return sEOK on success.750 * @return sOther error codes as defined for each specific module749 * @return EOK on success. 750 * @return Other error codes as defined for each specific module 751 751 * start function. 752 752 */
Note:
See TracChangeset
for help on using the changeset viewer.