Changeset 14227 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 15, 2008 8:12:41 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip.h
r1076 r14227 38 38 #define _IP_H_ 39 39 40 #ifdef VBOX_WITH_BSD_REASS 41 # ifndef RT_OS_WINDOWS 42 # include <sys/queue.h> 43 # else 44 /* XXX: Windows has own queue types declared in winnt.h (should look at them once again) */ 45 # endif 46 #endif 47 40 48 #ifdef WORDS_BIGENDIAN 41 49 # ifndef NTOHL … … 236 244 */ 237 245 struct ipq_t { 246 #ifndef VBOX_WITH_BSD_REASS 238 247 ipqp_32 next,prev; /* to other reass headers */ 248 #else 249 TAILQ_ENTRY(ipq_t) ipq_list; 250 #endif 239 251 u_int8_t ipq_ttl; /* time for reass q to live */ 240 252 u_int8_t ipq_p; /* protocol of this fragment */ 241 253 u_int16_t ipq_id; /* sequence id for reassembly */ 242 ipasfragp_32 ipq_next,ipq_prev; 243 /* to ip headers of fragments */ 254 #ifndef VBOX_WITH_BSD_REASS 255 ipasfragp_32 ipq_next,ipq_prev; /* to ip headers of fragments */ 256 #else 257 struct mbuf *ipq_frags; /* to ip headers of fragments */ 258 #endif 259 244 260 struct in_addr ipq_src,ipq_dst; 245 261 }; -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r13984 r14227 54 54 ip_init(PNATState pData) 55 55 { 56 #ifndef VBOX_WITH_BSD_REASS 56 57 ipq.next = ipq.prev = ptr_to_u32(pData, &ipq); 58 #else /* !VBOX_WITH_BSD_REASS */ 59 #endif /* VBOX_WITH_BSD_REASS */ 57 60 ip_currid = tt.tv_sec & 0xffff; 58 61 udp_init(pData); … … 153 156 * XXX This should fail, don't fragment yet 154 157 */ 158 #ifndef VBOX_WITH_BSD_REASS 155 159 if (ip->ip_off &~ IP_DF) { 156 160 register struct ipq_t *fp; … … 200 204 } else 201 205 ip->ip_len -= hlen; 206 #else /* !VBOX_WITH_BSD_REASS */ 207 #endif /* !VBOX_WITH_BSD_REASS */ 202 208 203 209 /* … … 225 231 } 226 232 233 #ifndef VBOX_WITH_BSD_REASS 227 234 /* 228 235 * Take incoming datagram fragment and try to … … 402 409 (void) m_free(pData, dtom(pData, fp)); 403 410 } 411 #else /* !VBOX_WITH_BSD_REASS */ 412 struct mbuf * 413 ip_reass(PNATState pData, struct mbuf* m) { 414 return (NULL); 415 } 416 417 void 418 ip_freef(PNATState pData, struct ipq_t *fp) { 419 } 420 #endif /* VBOX_WITH_BSD_REASS */ 404 421 405 422 /* … … 443 460 DEBUG_CALL("ip_slowtimo"); 444 461 462 #ifndef VBOX_WITH_BSD_REASS 445 463 fp = u32_to_ptr(pData, ipq.next, struct ipq_t *); 446 464 if (fp == 0) … … 455 473 } 456 474 } 475 #else /* !VBOX_WITH_BSD_REASS */ 476 /* XXX: the fragment expiration is the same but requier 477 * additional loop see (see ip_input.c in FreeBSD tree) 478 */ 479 #endif /* VBOX_WITH_BSD_REASS */ 457 480 } 458 481 -
trunk/src/VBox/Devices/Network/slirp/mbuf.h
r13984 r14227 120 120 #define M_DOFREE 0x08 /* when m_free is called on the mbuf, free() 121 121 * it rather than putting it on the free list */ 122 #ifdef VBOX_WITH_BSD_REASS 123 #define M_FRAG 0x0800 /* packet is a fragment of a larger packet */` 124 #define M_FIRSTFRAG 0x1000 /* paket is first fragment */ 125 #define M_LASTFRAG 0x2000 /* paket is last fragment */ 126 #endif /* VBOX_WITH_BSD_REASS */ 122 127 123 128 /* -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r14210 r14227 399 399 * in the fragment queue, or there are TCP connections active 400 400 */ 401 #ifndef VBOX_WITH_BSD_REASS 401 402 do_slowtimo = ((tcb.so_next != &tcb) || 402 403 ((struct ipasfrag *)&ipq != u32_to_ptr(pData, ipq.next, struct ipasfrag *))); 404 #else /* !VBOX_WITH_BSD_REASS */ 405 /* XXX: triggering of fragment expiration should be the same but use 406 * new macroses 407 */ 408 #endif /* VBOX_WITH_BSD_REASS */ 403 409 404 410 STAM_REL_COUNTER_RESET(&pData->StatTCP); … … 792 798 793 799 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 794 rc = WSAEnumNetworkEvents(so->s, VBOX_SOCKET_EVENT, &NetworkEvents); 800 rc = WSAEnumNetworkEvents(so->s, VBOX_SOCKET_EVENT, &NetworkEvents); 795 801 if (rc == SOCKET_ERROR) 796 802 { -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r14201 r14227 333 333 void ip_init _P((PNATState)); 334 334 void ip_input _P((PNATState, struct mbuf *)); 335 #ifndef VBOX_WITH_BSD_REASS 335 336 struct ip * ip_reass _P((PNATState, register struct ipasfrag *, register struct ipq_t *)); 337 #else /* !VBOX_WITH_BSD_REASS */ 338 struct mbuf * ip_reass _P((PNATState, register struct mbuf *)); 339 #endif /* VBOX_WITH_BSD_REASS */ 336 340 void ip_freef _P((PNATState, struct ipq_t *)); 337 341 void ip_enq _P((PNATState, register struct ipasfrag *, register struct ipasfrag *));
Note:
See TracChangeset
for help on using the changeset viewer.