Changeset ceba4bed in mainline for uspace/srv/inet/inet.c
- Timestamp:
- 2012-02-06T17:38:50Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e767dbf
- Parents:
- bc38578
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/inet/inet.c
rbc38578 rceba4bed 47 47 #include <sys/types.h> 48 48 49 #include "addrobj.h" 49 50 #include "inet.h" 50 51 #include "inet_link.h" … … 85 86 } 86 87 87 static void inet_callback_create (inet_client_t *client, ipc_callid_t callid,88 ipc_call_t *call) 89 { 90 log_msg(LVL_DEBUG, "inet_callback_create ()");88 static void inet_callback_create_srv(inet_client_t *client, ipc_callid_t callid, 89 ipc_call_t *call) 90 { 91 log_msg(LVL_DEBUG, "inet_callback_create_srv()"); 91 92 92 93 async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE); … … 100 101 } 101 102 102 static void inet_get_srcaddr(inet_client_t *client, ipc_callid_t callid, 103 ipc_call_t *call) 104 { 105 log_msg(LVL_DEBUG, "inet_get_srcaddr()"); 103 static int inet_send(inet_client_t *client, inet_dgram_t *dgram, 104 uint8_t ttl, int df) 105 { 106 inet_addrobj_t *addr; 107 108 addr = inet_addrobj_find(&dgram->dest); 109 if (addr != NULL) { 110 /* Destination is directly accessible */ 111 return inet_addrobj_send_dgram(addr, dgram, ttl, df); 112 } 113 114 /* TODO: Gateways */ 115 log_msg(LVL_DEBUG, "inet_send: No route to destination."); 116 return ENOENT; 117 } 118 119 static void inet_get_srcaddr_srv(inet_client_t *client, ipc_callid_t callid, 120 ipc_call_t *call) 121 { 122 log_msg(LVL_DEBUG, "inet_get_srcaddr_srv()"); 106 123 107 124 async_answer_0(callid, ENOTSUP); 108 125 } 109 126 110 static void inet_send (inet_client_t *client, ipc_callid_t callid,127 static void inet_send_srv(inet_client_t *client, ipc_callid_t callid, 111 128 ipc_call_t *call) 112 129 { … … 116 133 int rc; 117 134 118 log_msg(LVL_DEBUG, "inet_send ()");135 log_msg(LVL_DEBUG, "inet_send_srv()"); 119 136 120 137 dgram.src.ipv4 = IPC_GET_ARG1(*call); … … 124 141 df = IPC_GET_ARG5(*call); 125 142 126 (void)ttl;127 (void)df;128 129 143 rc = async_data_write_accept(&dgram.data, false, 0, 0, 0, &dgram.size); 130 144 if (rc != EOK) { … … 133 147 } 134 148 149 rc = inet_send(client, &dgram, ttl, df); 150 135 151 free(dgram.data); 136 async_answer_0(callid, ENOTSUP);137 } 138 139 static void inet_set_proto (inet_client_t *client, ipc_callid_t callid,152 async_answer_0(callid, rc); 153 } 154 155 static void inet_set_proto_srv(inet_client_t *client, ipc_callid_t callid, 140 156 ipc_call_t *call) 141 157 { … … 143 159 144 160 proto = IPC_GET_ARG1(*call); 145 log_msg(LVL_DEBUG, "inet_set_proto (%lu)", (unsigned long) proto);161 log_msg(LVL_DEBUG, "inet_set_proto_srv(%lu)", (unsigned long) proto); 146 162 147 163 if (proto > UINT8_MAX) { … … 197 213 switch (method) { 198 214 case INET_CALLBACK_CREATE: 199 inet_callback_create (&client, callid, &call);215 inet_callback_create_srv(&client, callid, &call); 200 216 break; 201 217 case INET_GET_SRCADDR: 202 inet_get_srcaddr (&client, callid, &call);218 inet_get_srcaddr_srv(&client, callid, &call); 203 219 break; 204 220 case INET_SEND: 205 inet_send (&client, callid, &call);221 inet_send_srv(&client, callid, &call); 206 222 break; 207 223 case INET_SET_PROTO: 208 inet_set_proto (&client, callid, &call);224 inet_set_proto_srv(&client, callid, &call); 209 225 break; 210 226 default:
Note:
See TracChangeset
for help on using the changeset viewer.