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