Changes in uspace/srv/net/loopip/loopip.c [1d6dd2a:b688fd8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/loopip/loopip.c
r1d6dd2a rb688fd8 38 38 #include <async.h> 39 39 #include <errno.h> 40 #include <str_error.h>41 40 #include <inet/iplink_srv.h> 42 41 #include <inet/addr.h> … … 45 44 #include <stdio.h> 46 45 #include <stdlib.h> 47 #include <str.h>48 46 #include <task.h> 49 47 50 48 #define NAME "loopip" 51 49 52 static errno_t loopip_open(iplink_srv_t *srv);53 static errno_t loopip_close(iplink_srv_t *srv);54 static errno_t loopip_send(iplink_srv_t *srv, iplink_sdu_t *sdu);55 static errno_t loopip_send6(iplink_srv_t *srv, iplink_sdu6_t *sdu);56 static errno_t loopip_get_mtu(iplink_srv_t *srv, size_t *mtu);57 static errno_t loopip_get_mac48(iplink_srv_t *srv, addr48_t *mac);58 static errno_t loopip_addr_add(iplink_srv_t *srv, inet_addr_t *addr);59 static errno_t loopip_addr_remove(iplink_srv_t *srv, inet_addr_t *addr);50 static int loopip_open(iplink_srv_t *srv); 51 static int loopip_close(iplink_srv_t *srv); 52 static int loopip_send(iplink_srv_t *srv, iplink_sdu_t *sdu); 53 static int loopip_send6(iplink_srv_t *srv, iplink_sdu6_t *sdu); 54 static int loopip_get_mtu(iplink_srv_t *srv, size_t *mtu); 55 static int loopip_get_mac48(iplink_srv_t *srv, addr48_t *mac); 56 static int loopip_addr_add(iplink_srv_t *srv, inet_addr_t *addr); 57 static int loopip_addr_remove(iplink_srv_t *srv, inet_addr_t *addr); 60 58 61 59 static void loopip_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg); … … 83 81 } rqueue_entry_t; 84 82 85 static errno_t loopip_recv_fibril(void *arg)83 static int loopip_recv_fibril(void *arg) 86 84 { 87 85 while (true) { … … 100 98 } 101 99 102 static errno_t loopip_init(void)100 static int loopip_init(void) 103 101 { 104 102 async_set_fallback_port_handler(loopip_client_conn, NULL); 105 103 106 errno_t rc = loc_server_register(NAME);104 int rc = loc_server_register(NAME); 107 105 if (rc != EOK) { 108 106 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server."); … … 154 152 } 155 153 156 static errno_t loopip_open(iplink_srv_t *srv)154 static int loopip_open(iplink_srv_t *srv) 157 155 { 158 156 log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip_open()"); … … 160 158 } 161 159 162 static errno_t loopip_close(iplink_srv_t *srv)160 static int loopip_close(iplink_srv_t *srv) 163 161 { 164 162 log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip_close()"); … … 166 164 } 167 165 168 static errno_t loopip_send(iplink_srv_t *srv, iplink_sdu_t *sdu)166 static int loopip_send(iplink_srv_t *srv, iplink_sdu_t *sdu) 169 167 { 170 168 log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip_send()"); … … 195 193 } 196 194 197 static errno_t loopip_send6(iplink_srv_t *srv, iplink_sdu6_t *sdu)195 static int loopip_send6(iplink_srv_t *srv, iplink_sdu6_t *sdu) 198 196 { 199 197 log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip6_send()"); … … 224 222 } 225 223 226 static errno_t loopip_get_mtu(iplink_srv_t *srv, size_t *mtu)224 static int loopip_get_mtu(iplink_srv_t *srv, size_t *mtu) 227 225 { 228 226 log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip_get_mtu()"); … … 231 229 } 232 230 233 static errno_t loopip_get_mac48(iplink_srv_t *src, addr48_t *mac)231 static int loopip_get_mac48(iplink_srv_t *src, addr48_t *mac) 234 232 { 235 233 log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip_get_mac48()"); … … 237 235 } 238 236 239 static errno_t loopip_addr_add(iplink_srv_t *srv, inet_addr_t *addr)240 { 241 return EOK; 242 } 243 244 static errno_t loopip_addr_remove(iplink_srv_t *srv, inet_addr_t *addr)237 static int loopip_addr_add(iplink_srv_t *srv, inet_addr_t *addr) 238 { 239 return EOK; 240 } 241 242 static int loopip_addr_remove(iplink_srv_t *srv, inet_addr_t *addr) 245 243 { 246 244 return EOK; … … 251 249 printf("%s: HelenOS loopback IP link provider\n", NAME); 252 250 253 errno_t rc = log_init(NAME);254 if (rc != EOK) { 255 printf("%s: Failed to initialize logging : %s.\n", NAME, str_error(rc));251 int rc = log_init(NAME); 252 if (rc != EOK) { 253 printf("%s: Failed to initialize logging.\n", NAME); 256 254 return rc; 257 255 } 258 256 259 257 rc = loopip_init(); 260 if (rc != EOK) { 261 printf("%s: Failed to initialize loopip: %s.\n", NAME, str_error(rc)); 262 return rc; 263 } 258 if (rc != EOK) 259 return rc; 264 260 265 261 printf("%s: Accepting connections.\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.