Changeset 313824a in mainline
- Timestamp:
- 2013-07-16T17:05:30Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1f97352
- Parents:
- fc4bf2a
- Location:
- uspace/srv/net/inetsrv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/inet_link.c
rfc4bf2a r313824a 52 52 static bool first_link6 = true; 53 53 54 static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock); 55 static uint16_t ip_ident = 0; 56 54 57 static int inet_link_open(service_id_t); 55 58 static int inet_iplink_recv(iplink_t *, iplink_recv_sdu_t *, uint16_t); … … 366 369 packet.proto = proto; 367 370 packet.ttl = ttl; 371 372 /* Allocate identifier */ 373 fibril_mutex_lock(&ip_ident_lock); 374 packet.ident = ++ip_ident; 375 fibril_mutex_unlock(&ip_ident_lock); 376 368 377 packet.df = df; 369 378 packet.data = dgram->data; 370 379 packet.size = dgram->size; 371 380 381 int rc; 372 382 size_t offs = 0; 373 int rc;374 383 375 384 do { … … 421 430 packet.proto = proto; 422 431 packet.ttl = ttl; 432 433 /* Allocate identifier */ 434 fibril_mutex_lock(&ip_ident_lock); 435 packet.ident = ++ip_ident; 436 fibril_mutex_unlock(&ip_ident_lock); 437 423 438 packet.df = df; 424 439 packet.data = dgram->data; -
uspace/srv/net/inetsrv/inet_std.h
rfc4bf2a r313824a 48 48 /** Total Length */ 49 49 uint16_t tot_len; 50 /** Identifi cation*/50 /** Identifier */ 51 51 uint16_t id; 52 52 /** Flags, Fragment Offset */ … … 126 126 /** Fragmentation offset, reserved and M flag */ 127 127 uint16_t offsmf; 128 /** Identifi cation*/128 /** Identifier */ 129 129 uint32_t id; 130 130 } ip6_header_fragment_t; -
uspace/srv/net/inetsrv/inetsrv.h
rfc4bf2a r313824a 113 113 uint8_t ttl; 114 114 /** Identifier */ 115 uint 16_t ident;115 uint32_t ident; 116 116 /** Do not fragment */ 117 117 bool df; -
uspace/srv/net/inetsrv/pdu.c
rfc4bf2a r313824a 49 49 #include "pdu.h" 50 50 51 static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock);52 static uint16_t ip_ident = 0;53 51 54 52 /** One's complement addition. … … 107 105 */ 108 106 int inet_pdu_encode(inet_packet_t *packet, addr32_t src, addr32_t dest, 109 size_t offs, size_t mtu, void **rdata, size_t *rsize, size_t *roffs)107 size_t offs, size_t mtu, void **rdata, size_t *rsize, size_t *roffs) 110 108 { 111 109 /* Upper bound for fragment offset field */ … … 152 150 return ENOMEM; 153 151 154 /* Allocate identifier */155 fibril_mutex_lock(&ip_ident_lock);156 uint16_t ident = ++ip_ident;157 fibril_mutex_unlock(&ip_ident_lock);158 159 152 /* Encode header fields */ 160 153 ip_header_t *hdr = (ip_header_t *) data; … … 164 157 hdr->tos = packet->tos; 165 158 hdr->tot_len = host2uint16_t_be(size); 166 hdr->id = host2uint16_t_be( ident);159 hdr->id = host2uint16_t_be(packet->ident); 167 160 hdr->flags_foff = host2uint16_t_be(flags_foff); 168 161 hdr->ttl = packet->ttl; … … 259 252 return ENOMEM; 260 253 261 #if 0262 // FIXME TODO fragmentation263 264 /* Allocate identifier */265 fibril_mutex_lock(&ip_ident_lock);266 uint16_t ident = ++ip_ident;267 fibril_mutex_unlock(&ip_ident_lock);268 #endif269 270 254 /* Encode header fields */ 271 255 ip6_header_t *hdr6 = (ip6_header_t *) data;
Note:
See TracChangeset
for help on using the changeset viewer.