Rev 4719 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4719 | Rev 4720 | ||
---|---|---|---|
Line 95... | Line 95... | ||
95 | return net_message( callid, call, answer, answer_count ); |
95 | return net_message( callid, call, answer, answer_count ); |
96 | } |
96 | } |
97 | } |
97 | } |
98 | } |
98 | } |
99 | 99 | ||
100 | int net_initialize( async_client_conn_t client_connection ){ |
100 | int net_initialize_build( async_client_conn_t client_connection ){ |
101 | ERROR_DECLARE; |
101 | ERROR_DECLARE; |
102 | 102 | ||
103 | ipcarg_t phonehash; |
103 | ipcarg_t phonehash; |
104 | 104 | ||
105 | netifs_initialize( & net_globals.netifs ); |
- | |
106 | char_map_initialize( & net_globals.netif_names ); |
- | |
107 | modules_initialize( & net_globals.modules ); |
- | |
108 | measured_strings_initialize( & net_globals.configuration ); |
- | |
109 | - | ||
110 | ERROR_PROPAGATE( add_module( NULL, & net_globals.modules, LO_NAME, LO_FILENAME, SERVICE_LO, 0, connect_to_service )); |
- | |
111 | ERROR_PROPAGATE( add_module( NULL, & net_globals.modules, DP8390_NAME, DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service )); |
- | |
112 | ERROR_PROPAGATE( add_module( NULL, & net_globals.modules, ETHERNET_NAME, ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service )); |
- | |
113 | ERROR_PROPAGATE( add_module( NULL, & net_globals.modules, NILDUMMY_NAME, NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service )); |
- | |
114 | - | ||
115 | ERROR_PROPAGATE( REGISTER_ME( SERVICE_IP, & phonehash )); |
105 | ERROR_PROPAGATE( REGISTER_ME( SERVICE_IP, & phonehash )); |
116 | ERROR_PROPAGATE( add_module( NULL, & net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_get_id(), ip_connect_module )); |
106 | ERROR_PROPAGATE( add_module( NULL, & net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_get_id(), ip_connect_module )); |
117 | ERROR_PROPAGATE( ip_initialize( client_connection )); |
107 | ERROR_PROPAGATE( ip_initialize( client_connection )); |
118 | ERROR_PROPAGATE( REGISTER_ME( SERVICE_ARP, & phonehash )); |
108 | ERROR_PROPAGATE( REGISTER_ME( SERVICE_ARP, & phonehash )); |
119 | ERROR_PROPAGATE( arp_initialize( client_connection )); |
109 | ERROR_PROPAGATE( arp_initialize( client_connection )); |
Line 124... | Line 114... | ||
124 | ERROR_PROPAGATE( REGISTER_ME( SERVICE_TCP, & phonehash )); |
114 | ERROR_PROPAGATE( REGISTER_ME( SERVICE_TCP, & phonehash )); |
125 | ERROR_PROPAGATE( tcp_initialize( client_connection )); |
115 | ERROR_PROPAGATE( tcp_initialize( client_connection )); |
126 | return EOK; |
116 | return EOK; |
127 | } |
117 | } |
128 | 118 | ||
129 | int read_netif_configuration( char * name, netif_ref netif ){ |
119 | int read_netif_configuration_build( char * name, netif_ref netif ){ |
130 | ERROR_DECLARE; |
120 | ERROR_DECLARE; |
131 | 121 | ||
132 | if( str_lcmp( name, "lo", 2 ) == 0 ){ |
122 | if( str_lcmp( name, "lo", 2 ) == 0 ){ |
133 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NAME", LO_NAME )); |
- | |
134 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETIF", LO_NAME )); |
123 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NIL", LO_NAME )); |
135 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NIL", NILDUMMY_NAME )); |
- | |
136 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IL", IP_NAME )); |
- | |
137 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_CONFIG", "static" )); |
- | |
138 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ADDR", "127.0.0.1" )); |
- | |
139 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ROUTING", "yes" )); |
- | |
140 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.0.0.0" )); |
- | |
141 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "MTU", "15535" )); |
- | |
142 | }else if( str_lcmp( name, "ne2k", 4 ) == 0 ){ |
124 | }else if( str_lcmp( name, "ne2k", 4 ) == 0 ){ |
143 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NAME", "eth0" )); |
- | |
144 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETIF", DP8390_NAME )); |
- | |
145 | // ethernet bundled in dp8390 |
- | |
146 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NIL", DP8390_NAME )); |
125 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NIL", DP8390_NAME )); |
147 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "ETH_MODE", "DIX" )); |
- | |
148 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IL", IP_NAME )); |
- | |
149 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IRQ", "9" )); |
- | |
150 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IO", "300" )); |
- | |
151 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "MTU", "1492" )); |
- | |
152 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_CONFIG", "static" )); |
- | |
153 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ADDR", "10.0.2.15" )); |
- | |
154 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ROUTING", "yes" )); |
- | |
155 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.255.255.240" )); |
- | |
156 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "BROADCAST", "10.0.2.255" )); |
- | |
157 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "GATEWAY", "10.0.2.2" )); |
- | |
158 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "DNS1", "10.0.2.2" )); |
- | |
159 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "DNS2", "10.0.2.2" )); |
- | |
160 | ERROR_PROPAGATE( add_configuration( & netif->configuration, "ARP", "arp" )); |
- | |
161 | } |
126 | } |
162 | return EOK; |
127 | return EOK; |
163 | } |
128 | } |
164 | 129 | ||
165 | /** @} |
130 | /** @} |