Changeset 257feec in mainline for uspace/srv/net/inetsrv
- Timestamp:
- 2013-06-27T12:48:32Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9f391e9
- Parents:
- 679ee84
- Location:
- uspace/srv/net/inetsrv
- Files:
-
- 7 edited
-
addrobj.c (modified) (1 diff)
-
addrobj.h (modified) (1 diff)
-
icmp_std.h (modified) (1 diff)
-
inet_link.c (modified) (3 diffs)
-
inetcfg.c (modified) (1 diff)
-
inetping.c (modified) (6 diffs)
-
pdu.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/addrobj.c
r679ee84 r257feec 137 137 } 138 138 } 139 139 140 140 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find: Not found"); 141 141 fibril_mutex_unlock(&addr_list_lock); 142 142 143 143 return NULL; 144 144 } -
uspace/srv/net/inetsrv/addrobj.h
r679ee84 r257feec 59 59 extern int inet_addrobj_get_id_list(sysarg_t **, size_t *); 60 60 61 62 61 #endif 63 62 -
uspace/srv/net/inetsrv/icmp_std.h
r679ee84 r257feec 43 43 44 44 /** Type of service used for ICMP */ 45 #define ICMP_TOS 045 #define ICMP_TOS 0 46 46 47 47 /** ICMP message type */ -
uspace/srv/net/inetsrv/inet_link.c
r679ee84 r257feec 70 70 return rc; 71 71 } 72 72 73 73 log_msg(LOG_DEFAULT, LVL_DEBUG, "call inet_recv_packet()"); 74 74 rc = inet_recv_packet(&packet); 75 75 log_msg(LOG_DEFAULT, LVL_DEBUG, "call inet_recv_packet -> %d", rc); 76 76 free(packet.data); 77 77 78 78 return rc; 79 79 } … … 232 232 if (ilink->iplink != NULL) 233 233 iplink_close(ilink->iplink); 234 234 235 inet_link_delete(ilink); 235 236 return rc; … … 263 264 * inet_pdu_encode(). 264 265 */ 266 265 267 inet_packet_t packet; 266 268 -
uspace/srv/net/inetsrv/inetcfg.c
r679ee84 r257feec 377 377 } 378 378 379 380 379 static void inetcfg_get_link_list_srv(ipc_callid_t callid, ipc_call_t *call) 381 380 { -
uspace/srv/net/inetsrv/inetping.c
r679ee84 r257feec 94 94 int rc = async_data_write_start(exch, sdu->data, sdu->size); 95 95 async_exchange_end(exch); 96 96 97 97 if (rc != EOK) { 98 98 async_forget(req); 99 99 return rc; 100 100 } 101 101 102 102 sysarg_t retval; 103 103 async_wait_for(req, &retval); 104 if (retval != EOK) { 105 return retval; 106 } 107 108 return EOK; 104 105 return (int) retval; 109 106 } 110 107 … … 151 148 if (sess == NULL) 152 149 return ENOMEM; 153 150 154 151 client->sess = sess; 155 152 link_initialize(&client->client_list); 156 153 157 154 fibril_mutex_lock(&client_list_lock); 158 155 client->ident = ++inetping_ident; 159 156 list_append(&client->client_list, &client_list); 160 157 fibril_mutex_unlock(&client_list_lock); 161 158 162 159 return EOK; 163 160 } … … 167 164 async_hangup(client->sess); 168 165 client->sess = NULL; 169 166 170 167 fibril_mutex_lock(&client_list_lock); 171 168 list_remove(&client->client_list); … … 204 201 if (rc != EOK) 205 202 return; 206 203 207 204 while (true) { 208 205 ipc_call_t call; 209 206 ipc_callid_t callid = async_get_call(&call); 210 207 sysarg_t method = IPC_GET_IMETHOD(call); 211 208 212 209 if (!method) { 213 210 /* The other side has hung up */ … … 215 212 break; 216 213 } 217 214 218 215 switch (method) { 219 216 case INETPING_SEND: … … 227 224 } 228 225 } 229 226 230 227 inetping_client_fini(&client); 231 228 } -
uspace/srv/net/inetsrv/pdu.c
r679ee84 r257feec 203 203 204 204 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_pdu_decode()"); 205 205 206 206 if (size < sizeof(ip_header_t)) { 207 207 log_msg(LOG_DEFAULT, LVL_DEBUG, "PDU too short (%zu)", size); … … 223 223 return EINVAL; 224 224 } 225 225 226 226 if (tot_len > size) { 227 227 log_msg(LOG_DEFAULT, LVL_DEBUG, "Total Length = %zu > PDU size = %zu", … … 242 242 packet->ttl = hdr->ttl; 243 243 packet->ident = ident; 244 244 245 245 packet->df = (flags_foff & BIT_V(uint16_t, FF_FLAG_DF)) != 0; 246 246 packet->mf = (flags_foff & BIT_V(uint16_t, FF_FLAG_MF)) != 0; 247 247 packet->offs = foff * FRAG_OFFS_UNIT; 248 248 249 249 /* XXX IP options */ 250 250 data_offs = sizeof(uint32_t) * BIT_RANGE_EXTRACT(uint8_t, VI_IHL_h, … … 257 257 return ENOMEM; 258 258 } 259 260 memcpy(packet->data, (uint8_t *) data + data_offs, packet->size);261 259 260 memcpy(packet->data, (uint8_t *) data + data_offs, packet->size); 261 262 262 return EOK; 263 263 }
Note:
See TracChangeset
for help on using the changeset viewer.
