Changeset fe4310f in mainline for uspace/srv/inet/inet.c
- Timestamp:
- 2012-02-12T22:40:15Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2ff150e
- Parents:
- bd8bfc5a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/inet/inet.c
rbd8bfc5a rfe4310f 262 262 } 263 263 264 static inet_client_t *inet_client_find(uint8_t proto) 265 { 266 fibril_mutex_lock(&client_list_lock); 267 268 list_foreach(client_list, link) { 269 inet_client_t *client = list_get_instance(link, inet_client_t, 270 client_list); 271 272 if (client->protocol == proto) { 273 fibril_mutex_unlock(&client_list_lock); 274 return client; 275 } 276 } 277 278 fibril_mutex_unlock(&client_list_lock); 279 return NULL; 280 } 281 264 282 int inet_ev_recv(inet_client_t *client, inet_dgram_t *dgram) 265 283 { … … 285 303 } 286 304 287 int inet_recv_packet(inet_dgram_t *dgram, uint8_t ttl, int df) 288 { 289 return inet_route_packet(dgram, ttl, df); 305 static int inet_recv_dgram_local(inet_dgram_t *dgram, uint8_t proto) 306 { 307 inet_client_t *client; 308 309 log_msg(LVL_DEBUG, "inet_recv_dgram_local()"); 310 311 client = inet_client_find(proto); 312 if (client == NULL) { 313 log_msg(LVL_DEBUG, "No client found for protocol 0x%" PRIx8, 314 proto); 315 return ENOENT; 316 } 317 318 return inet_ev_recv(client, dgram); 319 } 320 321 int inet_recv_packet(inet_packet_t *packet) 322 { 323 inet_addrobj_t *addr; 324 inet_dgram_t dgram; 325 326 addr = inet_addrobj_find(&packet->dest, iaf_addr); 327 if (addr != NULL) { 328 /* Destined for one of the local addresses */ 329 330 /* XXX Reassemble packets */ 331 dgram.src = packet->src; 332 dgram.dest = packet->dest; 333 dgram.tos = packet->tos; 334 dgram.data = packet->data; 335 dgram.size = packet->size; 336 337 return inet_recv_dgram_local(&dgram, packet->proto); 338 } 339 340 return ENOENT; 290 341 } 291 342
Note:
See TracChangeset
for help on using the changeset viewer.