Changeset 849ed54 in mainline for uspace/srv/net/il
- Timestamp:
- 2010-03-30T18:39:04Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7553689
- Parents:
- 7d6fe4db
- Location:
- uspace/srv/net/il
- Files:
-
- 8 edited
-
arp/Makefile (modified) (1 diff)
-
arp/arp.c (modified) (3 diffs)
-
arp/arp.h (modified) (1 diff)
-
arp/arp_module.c (modified) (3 diffs)
-
ip/Makefile (modified) (1 diff)
-
ip/ip.c (modified) (3 diffs)
-
ip/ip.h (modified) (1 diff)
-
ip/ip_module.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/Makefile
r7d6fe4db r849ed54 28 28 # 29 29 30 NET_BASE = ../..31 30 USPACE_PREFIX = ../../../.. 31 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a 32 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include 32 33 BINARY = arp 33 34 34 35 SOURCES = \ 35 36 arp.c \ 36 arp_module.c \ 37 $(NET_BASE)/module.c \ 38 $(NET_BASE)/modules.c \ 39 $(NET_BASE)/net/net_remote.c \ 40 $(NET_BASE)/nil/nil_remote.c \ 41 $(NET_BASE)/structures/char_map.c \ 42 $(NET_BASE)/structures/measured_strings.c \ 43 $(NET_BASE)/structures/packet/packet.c \ 44 $(NET_BASE)/structures/packet/packet_client.c \ 45 $(NET_BASE)/structures/packet/packet_remote.c 37 arp_module.c 46 38 47 39 include $(USPACE_PREFIX)/Makefile.common -
uspace/srv/net/il/arp/arp.c
r7d6fe4db r849ed54 43 43 #include <str.h> 44 44 #include <task.h> 45 46 45 #include <ipc/ipc.h> 47 46 #include <ipc/services.h> 48 47 49 #include "../../err.h" 50 #include "../../messages.h" 51 #include "../../modules.h" 52 53 #include "../../include/byteorder.h" 54 #include "../../include/device.h" 55 #include "../../include/arp_interface.h" 56 #include "../../include/nil_interface.h" 57 #include "../../include/protocol_map.h" 58 59 #include "../../structures/measured_strings.h" 60 #include "../../structures/packet/packet.h" 61 #include "../../structures/packet/packet_client.h" 62 63 #include "../il_messages.h" 48 #include <net_err.h> 49 #include <net_messages.h> 50 #include <net_modules.h> 51 #include <net_byteorder.h> 52 #include <net_device.h> 53 #include <arp_interface.h> 54 #include <nil_interface.h> 55 #include <protocol_map.h> 56 #include <adt/measured_strings.h> 57 #include <packet/packet.h> 58 #include <packet/packet_client.h> 59 #include <il_messages.h> 60 #include <arp_messages.h> 64 61 65 62 #include "arp.h" … … 67 64 #include "arp_oc.h" 68 65 #include "arp_module.h" 69 #include "arp_messages.h" 66 67 68 /** ARP module name. 69 */ 70 #define NAME "ARP protocol" 70 71 71 72 /** ARP global data. … … 618 619 } 619 620 621 #ifdef CONFIG_NETWORKING_modular 622 623 #include <il_standalone.h> 624 625 /** Default thread for new connections. 626 * 627 * @param[in] iid The initial message identifier. 628 * @param[in] icall The initial message call structure. 629 * 630 */ 631 static void il_client_connection(ipc_callid_t iid, ipc_call_t * icall) 632 { 633 /* 634 * Accept the connection 635 * - Answer the first IPC_M_CONNECT_ME_TO call. 636 */ 637 ipc_answer_0(iid, EOK); 638 639 while(true) { 640 ipc_call_t answer; 641 int answer_count; 642 643 /* Clear the answer structure */ 644 refresh_answer(&answer, &answer_count); 645 646 /* Fetch the next message */ 647 ipc_call_t call; 648 ipc_callid_t callid = async_get_call(&call); 649 650 /* Process the message */ 651 int res = il_module_message(callid, &call, &answer, &answer_count); 652 653 /* End if said to either by the message or the processing result */ 654 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP)) 655 return; 656 657 /* Answer the message */ 658 answer_call(callid, res, &answer, answer_count); 659 } 660 } 661 662 /** Starts the module. 663 * 664 * @param argc The count of the command line arguments. Ignored parameter. 665 * @param argv The command line parameters. Ignored parameter. 666 * 667 * @returns EOK on success. 668 * @returns Other error codes as defined for each specific module start function. 669 * 670 */ 671 int main(int argc, char *argv[]) 672 { 673 ERROR_DECLARE; 674 675 /* Print the module label */ 676 printf("Task %d - %s\n", task_get_id(), NAME); 677 678 /* Start the module */ 679 if (ERROR_OCCURRED(il_module_start(il_client_connection))) { 680 printf(" - ERROR %i\n", ERROR_CODE); 681 return ERROR_CODE; 682 } 683 684 return EOK; 685 } 686 687 #endif /* CONFIG_NETWORKING_modular */ 688 620 689 /** @} 621 690 */ -
uspace/srv/net/il/arp/arp.h
r7d6fe4db r849ed54 43 43 #include <ipc/services.h> 44 44 45 #include "../../include/device.h" 46 #include "../../include/hardware.h" 47 48 #include "../../structures/generic_char_map.h" 49 #include "../../structures/int_map.h" 50 #include "../../structures/measured_strings.h" 45 #include <net_device.h> 46 #include <net_hardware.h> 47 #include <adt/generic_char_map.h> 48 #include <adt/int_map.h> 49 #include <adt/measured_strings.h> 51 50 52 51 -
uspace/srv/net/il/arp/arp_module.c
r7d6fe4db r849ed54 44 44 #include <ipc/services.h> 45 45 46 #include "../../err.h" 47 #include "../../modules.h" 48 49 #include "../../include/net_interface.h" 50 51 #include "../../structures/packet/packet.h" 46 #include <net_err.h> 47 #include <net_modules.h> 48 #include <net_interface.h> 49 #include <packet/packet.h> 50 #include <il_standalone.h> 52 51 53 52 #include "arp.h" 54 53 #include "arp_module.h" 55 56 /** ARP module name.57 */58 #define NAME "ARP protocol"59 54 60 55 /** ARP module global data. … … 70 65 * @returns Other error codes as defined for the arp_message() function. 71 66 */ 72 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 73 74 /** Prints the module name. 75 * @see NAME 76 */ 77 void module_print_name(void); 67 int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 68 return arp_message(callid, call, answer, answer_count); 69 } 78 70 79 71 /** Starts the ARP module. … … 84 76 * @returns Other error codes as defined for the REGISTER_ME() macro function. 85 77 */ 86 int module_start(async_client_conn_t client_connection); 87 88 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 89 return arp_message(callid, call, answer, answer_count); 90 } 91 92 void module_print_name(void){ 93 printf("%s", NAME); 94 } 95 96 int module_start(async_client_conn_t client_connection){ 78 int il_module_start(async_client_conn_t client_connection){ 97 79 ERROR_DECLARE; 98 80 -
uspace/srv/net/il/ip/Makefile
r7d6fe4db r849ed54 28 28 # 29 29 30 NET_BASE = ../..31 30 USPACE_PREFIX = ../../../.. 31 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a 32 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include 32 33 BINARY = ip 33 34 34 35 SOURCES = \ 35 36 ip.c \ 36 ip_client.c \ 37 ip_module.c \ 38 $(NET_BASE)/checksum.c \ 39 $(NET_BASE)/inet.c \ 40 $(NET_BASE)/module.c \ 41 $(NET_BASE)/modules.c \ 42 $(NET_BASE)/il/arp/arp_remote.c \ 43 $(NET_BASE)/nil/nil_remote.c \ 44 $(NET_BASE)/net/net_remote.c \ 45 $(NET_BASE)/tl/icmp/icmp_client.c \ 46 $(NET_BASE)/tl/icmp/icmp_common.c \ 47 $(NET_BASE)/tl/icmp/icmp_remote.c \ 48 $(NET_BASE)/structures/char_map.c \ 49 $(NET_BASE)/structures/measured_strings.c \ 50 $(NET_BASE)/structures/module_map.c \ 51 $(NET_BASE)/structures/packet/packet.c \ 52 $(NET_BASE)/structures/packet/packet_client.c \ 53 $(NET_BASE)/structures/packet/packet_remote.c 37 ip_module.c 54 38 55 39 include $(USPACE_PREFIX)/Makefile.common -
uspace/srv/net/il/ip/ip.c
r7d6fe4db r849ed54 41 41 #include <stdio.h> 42 42 #include <str.h> 43 44 43 #include <ipc/ipc.h> 45 44 #include <ipc/services.h> 46 47 45 #include <sys/types.h> 48 46 49 #include "../../err.h" 50 #include "../../messages.h" 51 #include "../../modules.h" 52 53 #include "../../include/arp_interface.h" 54 #include "../../include/byteorder.h" 55 #include "../../include/checksum.h" 56 #include "../../include/device.h" 57 #include "../../include/icmp_client.h" 58 #include "../../include/icmp_codes.h" 59 #include "../../include/icmp_interface.h" 60 #include "../../include/il_interface.h" 61 #include "../../include/in.h" 62 #include "../../include/in6.h" 63 #include "../../include/inet.h" 64 #include "../../include/ip_client.h" 65 #include "../../include/ip_interface.h" 66 #include "../../include/net_interface.h" 67 #include "../../include/nil_interface.h" 68 #include "../../include/tl_interface.h" 69 #include "../../include/socket_codes.h" 70 #include "../../include/socket_errno.h" 71 #include "../../structures/measured_strings.h" 72 #include "../../structures/module_map.h" 73 #include "../../structures/packet/packet_client.h" 74 75 #include "../../nil/nil_messages.h" 76 77 #include "../il_messages.h" 47 #include <net_err.h> 48 #include <net_messages.h> 49 #include <net_modules.h> 50 #include <arp_interface.h> 51 #include <net_byteorder.h> 52 #include <net_checksum.h> 53 #include <net_device.h> 54 #include <icmp_client.h> 55 #include <icmp_codes.h> 56 #include <icmp_interface.h> 57 #include <il_interface.h> 58 #include <in.h> 59 #include <in6.h> 60 #include <inet.h> 61 #include <ip_client.h> 62 #include <ip_interface.h> 63 #include <net_interface.h> 64 #include <nil_interface.h> 65 #include <tl_interface.h> 66 #include <socket_codes.h> 67 #include <socket_errno.h> 68 #include <adt/measured_strings.h> 69 #include <adt/module_map.h> 70 #include <packet/packet_client.h> 71 #include <nil_messages.h> 72 #include <il_messages.h> 78 73 79 74 #include "ip.h" … … 81 76 #include "ip_messages.h" 82 77 #include "ip_module.h" 78 79 /** IP module name. 80 */ 81 #define NAME "IP protocol" 83 82 84 83 /** IP version 4. … … 1624 1623 } 1625 1624 1625 #ifdef CONFIG_NETWORKING_modular 1626 1627 #include <il_standalone.h> 1628 1629 /** Default thread for new connections. 1630 * 1631 * @param[in] iid The initial message identifier. 1632 * @param[in] icall The initial message call structure. 1633 * 1634 */ 1635 static void il_client_connection(ipc_callid_t iid, ipc_call_t * icall) 1636 { 1637 /* 1638 * Accept the connection 1639 * - Answer the first IPC_M_CONNECT_ME_TO call. 1640 */ 1641 ipc_answer_0(iid, EOK); 1642 1643 while(true) { 1644 ipc_call_t answer; 1645 int answer_count; 1646 1647 /* Clear the answer structure */ 1648 refresh_answer(&answer, &answer_count); 1649 1650 /* Fetch the next message */ 1651 ipc_call_t call; 1652 ipc_callid_t callid = async_get_call(&call); 1653 1654 /* Process the message */ 1655 int res = il_module_message(callid, &call, &answer, &answer_count); 1656 1657 /* End if said to either by the message or the processing result */ 1658 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP)) 1659 return; 1660 1661 /* Answer the message */ 1662 answer_call(callid, res, &answer, answer_count); 1663 } 1664 } 1665 1666 /** Starts the module. 1667 * 1668 * @param argc The count of the command line arguments. Ignored parameter. 1669 * @param argv The command line parameters. Ignored parameter. 1670 * 1671 * @returns EOK on success. 1672 * @returns Other error codes as defined for each specific module start function. 1673 * 1674 */ 1675 int main(int argc, char *argv[]) 1676 { 1677 ERROR_DECLARE; 1678 1679 /* Print the module label */ 1680 printf("Task %d - %s\n", task_get_id(), NAME); 1681 1682 /* Start the module */ 1683 if (ERROR_OCCURRED(il_module_start(il_client_connection))) { 1684 printf(" - ERROR %i\n", ERROR_CODE); 1685 return ERROR_CODE; 1686 } 1687 1688 return EOK; 1689 } 1690 1691 #endif /* CONFIG_NETWORKING_modular */ 1692 1626 1693 /** @} 1627 1694 */ -
uspace/srv/net/il/ip/ip.h
r7d6fe4db r849ed54 39 39 40 40 #include <fibril_synch.h> 41 42 41 #include <ipc/ipc.h> 43 42 #include <ipc/services.h> 44 43 45 #include "../../include/device.h" 46 #include "../../include/inet.h" 47 #include "../../include/ip_interface.h" 48 49 #include "../../structures/int_map.h" 50 #include "../../structures/generic_field.h" 51 #include "../../structures/module_map.h" 44 #include <net_device.h> 45 #include <inet.h> 46 #include <ip_interface.h> 47 #include <adt/int_map.h> 48 #include <adt/generic_field.h> 49 #include <adt/module_map.h> 52 50 53 51 /** Type definition of the IP global data. -
uspace/srv/net/il/ip/ip_module.c
r7d6fe4db r849ed54 40 40 #include <async.h> 41 41 #include <stdio.h> 42 43 42 #include <ipc/ipc.h> 44 43 #include <ipc/services.h> 45 44 46 #include "../../err.h" 47 #include "../../modules.h" 48 49 #include "../../include/net_interface.h" 50 51 #include "../../structures/packet/packet.h" 45 #include <net_err.h> 46 #include <net_modules.h> 47 #include <net_interface.h> 48 #include <packet/packet.h> 49 #include <il_standalone.h> 52 50 53 51 #include "ip.h" 54 52 #include "ip_module.h" 55 56 /** IP module name.57 */58 #define NAME "IP protocol"59 53 60 54 /** IP module global data. … … 70 64 * @returns Other error codes as defined for the ip_message() function. 71 65 */ 72 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 73 74 /** Prints the module name. 75 * @see NAME 76 */ 77 void module_print_name(void); 66 int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 67 return ip_message(callid, call, answer, answer_count); 68 } 78 69 79 70 /** Starts the IP module. … … 84 75 * @returns Other error codes as defined for the REGISTER_ME() macro function. 85 76 */ 86 int module_start(async_client_conn_t client_connection); 87 88 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 89 return ip_message(callid, call, answer, answer_count); 90 } 91 92 void module_print_name(void){ 93 printf("%s", NAME); 94 } 95 96 int module_start(async_client_conn_t client_connection){ 77 int il_module_start(async_client_conn_t client_connection){ 97 78 ERROR_DECLARE; 98 79
Note:
See TracChangeset
for help on using the changeset viewer.
