Changes in uspace/srv/net/il/arp/arp.c [14f1db0:849ed54] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
r14f1db0 r849ed54 57 57 #include <packet/packet.h> 58 58 #include <packet/packet_client.h> 59 #include <packet_remote.h>60 59 #include <il_messages.h> 61 #include <il_interface.h>62 #include <il_local.h>63 60 #include <arp_messages.h> 64 61 … … 71 68 /** ARP module name. 72 69 */ 73 #define NAME "arp"70 #define NAME "ARP protocol" 74 71 75 72 /** ARP global data. … … 341 338 return ERROR_CODE; 342 339 } 343 printf("%s: Device registered (id: %d, type: 0x%x, service: %d, proto: %d)\n", 344 NAME, device->device_id, device->hardware, device->service, protocol); 340 printf("New device registered:\n\tid\t= %d\n\ttype\t= 0x%x\n\tservice\t= %d\n\tproto\t= %d\n", device->device_id, device->hardware, device->service, protocol); 345 341 } 346 342 fibril_rwlock_write_unlock(&arp_globals.lock); … … 373 369 } 374 370 375 int arp_message_standalone(ipc_callid_t callid, ipc_call_t *call, 376 ipc_call_t *answer, int *answer_count) 377 { 371 int arp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 378 372 ERROR_DECLARE; 379 373 380 374 measured_string_ref address; 381 375 measured_string_ref translation; … … 383 377 packet_t packet; 384 378 packet_t next; 385 379 380 // printf("message %d - %d\n", IPC_GET_METHOD(*call), NET_ARP_FIRST); 386 381 *answer_count = 0; 387 switch (IPC_GET_METHOD(*call)){382 switch(IPC_GET_METHOD(*call)){ 388 383 case IPC_M_PHONE_HUNGUP: 389 384 return EOK; … … 422 417 return EOK; 423 418 case NET_IL_RECEIVED: 424 if(! ERROR_OCCURRED(packet_translate _remote(arp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){419 if(! ERROR_OCCURRED(packet_translate(arp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 425 420 fibril_rwlock_read_lock(&arp_globals.lock); 426 421 do{ … … 428 423 ERROR_CODE = arp_receive_message(IPC_GET_DEVICE(call), packet); 429 424 if(ERROR_CODE != 1){ 430 pq_release _remote(arp_globals.net_phone, packet_get_id(packet));425 pq_release(arp_globals.net_phone, packet_get_id(packet)); 431 426 } 432 427 packet = next; … … 438 433 return arp_mtu_changed_message(IPC_GET_DEVICE(call), IPC_GET_MTU(call)); 439 434 } 440 441 435 return ENOTSUP; 442 436 } … … 575 569 return NULL; 576 570 } 577 packet = packet_get_4 _remote(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);571 packet = packet_get_4(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix); 578 572 if(! packet){ 579 573 return NULL; … … 581 575 header = (arp_header_ref) packet_suffix(packet, length); 582 576 if(! header){ 583 pq_release _remote(arp_globals.net_phone, packet_get_id(packet));577 pq_release(arp_globals.net_phone, packet_get_id(packet)); 584 578 return NULL; 585 579 } … … 598 592 memcpy(((uint8_t *) header) + length, target->value, target->length); 599 593 if(packet_set_addr(packet, (uint8_t *) device->addr->value, (uint8_t *) device->broadcast_addr->value, CONVERT_SIZE(char, uint8_t, device->addr->length)) != EOK){ 600 pq_release _remote(arp_globals.net_phone, packet_get_id(packet));594 pq_release(arp_globals.net_phone, packet_get_id(packet)); 601 595 return NULL; 602 596 } … … 624 618 } 625 619 } 620 621 #ifdef CONFIG_NETWORKING_modular 622 623 #include <il_standalone.h> 626 624 627 625 /** Default thread for new connections. … … 651 649 652 650 /* Process the message */ 653 int res = il_module_message_standalone(callid, &call, &answer, 654 &answer_count); 651 int res = il_module_message(callid, &call, &answer, &answer_count); 655 652 656 653 /* End if said to either by the message or the processing result */ … … 676 673 ERROR_DECLARE; 677 674 675 /* Print the module label */ 676 printf("Task %d - %s\n", task_get_id(), NAME); 677 678 678 /* Start the module */ 679 if (ERROR_OCCURRED(il_module_start_standalone(il_client_connection))) 679 if (ERROR_OCCURRED(il_module_start(il_client_connection))) { 680 printf(" - ERROR %i\n", ERROR_CODE); 680 681 return ERROR_CODE; 682 } 681 683 682 684 return EOK; 683 685 } 684 686 687 #endif /* CONFIG_NETWORKING_modular */ 688 685 689 /** @} 686 690 */
Note:
See TracChangeset
for help on using the changeset viewer.