Changes in uspace/srv/net/il/arp/arp.c [fb04cba8:a852181] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
rfb04cba8 ra852181 125 125 } 126 126 127 static int arp_clear_address_req(int arp_phone, device_id_t device_id, 128 services_t protocol, measured_string_ref address) 127 static int 128 arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol, 129 measured_string_ref address) 129 130 { 130 131 arp_device_ref device; … … 174 175 * @returns ENOMEM if there is not enough memory left. 175 176 */ 176 static int arp_proto_create(arp_proto_ref *proto, services_t service, 177 static int 178 arp_proto_create(arp_proto_ref *proto, services_t service, 177 179 measured_string_ref address) 178 180 { … … 212 214 * measured_strings_return() function. 213 215 */ 214 static int arp_device_message(device_id_t device_id, services_t service, 216 static int 217 arp_device_message(device_id_t device_id, services_t service, 215 218 services_t protocol, measured_string_ref address) 216 219 { … … 222 225 223 226 fibril_rwlock_write_lock(&arp_globals.lock); 224 225 /* An existing device? */ 227 // an existing device? 226 228 device = arp_cache_find(&arp_globals.cache, device_id); 227 228 229 if (device) { 229 230 if (device->service != service) { … … 259 260 return ENOENT; 260 261 261 / * Create a new device */262 // create a new device 262 263 device = (arp_device_ref) malloc(sizeof(arp_device_t)); 263 264 if (!device) { … … 288 289 device->service = service; 289 290 290 / * Bind the new one */291 // bind the new one 291 292 device->phone = nil_bind_service(device->service, 292 293 (ipcarg_t) device->device_id, SERVICE_ARP, … … 299 300 } 300 301 301 / * Get packet dimensions */302 // get packet dimensions 302 303 rc = nil_packet_size_req(device->phone, device_id, 303 304 &device->packet_dimension); … … 309 310 } 310 311 311 / * Get hardware address */312 // get hardware address 312 313 rc = nil_get_addr_req(device->phone, device_id, &device->addr, 313 314 &device->addr_data); … … 319 320 } 320 321 321 / * Get broadcast address */322 // get broadcast address 322 323 rc = nil_get_broadcast_addr_req(device->phone, device_id, 323 324 &device->broadcast_addr, &device->broadcast_data); … … 454 455 hw_source = arp_addr_find(&proto->addresses, (char *) src_proto, 455 456 CONVERT_SIZE(uint8_t, char, header->protocol_length)); 456 / * Exists? */457 // exists? 457 458 if (hw_source) { 458 459 if (hw_source->length != CONVERT_SIZE(uint8_t, char, … … 462 463 memcpy(hw_source->value, src_hw, hw_source->length); 463 464 } 464 / * Is my protocol address? */465 // is my protocol address? 465 466 if (proto->addr->length != CONVERT_SIZE(uint8_t, char, 466 467 header->protocol_length)) { … … 469 470 if (!str_lcmp(proto->addr->value, (char *) des_proto, 470 471 proto->addr->length)) { 471 / * Not already updated? */472 // not already upadted? 472 473 if (!hw_source) { 473 474 hw_source = measured_string_create_bulk((char *) src_hw, … … 549 550 return addr; 550 551 551 / * ARP packet content size = header + (address + translation) * 2 */552 // ARP packet content size = header + (address + translation) * 2 552 553 length = 8 + 2 * (CONVERT_SIZE(char, uint8_t, proto->addr->length) + 553 554 CONVERT_SIZE(char, uint8_t, device->addr->length)); … … 673 674 674 675 case NET_IL_DEVICE_STATE: 675 / * Do nothing - keep the cache */676 // do nothing - keep the cache 676 677 return EOK; 677 678
Note:
See TracChangeset
for help on using the changeset viewer.