Changeset 26597 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Feb 17, 2010 4:45:03 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r26574 r26597 116 116 #endif 117 117 118 #ifndef VBOX_WITH_SLIRP_BSD_MBUF119 118 struct mbuf *slirp_ext_m_get(PNATState pData, size_t cbMin, void **ppvBuf, size_t *pcbBuf); 120 119 void slirp_ext_m_free(PNATState pData, struct mbuf *); 120 #ifndef VBOX_WITH_SLIRP_BSD_MBUF 121 121 void slirp_ext_m_append(PNATState pData, struct mbuf *, uint8_t *, size_t); 122 122 void slirp_push_recv_thread(void *pvUser); 123 #else124 void *slirp_ext_m_get(PNATState pData, uint8_t *, size_t);125 void slirp_ext_m_free(PNATState pData, void *);126 123 #endif 127 124 -
trunk/src/VBox/Devices/Network/slirp/misc.c
r26596 r26597 340 340 } 341 341 342 void *slirp_ext_m_get(PNATState pData, uint8_t *pkt, size_t pkt_len)342 struct mbuf *slirp_ext_m_get(PNATState pData, size_t cbMin, void **ppvBuf, size_t *pcbBuf) 343 343 { 344 344 struct mbuf *m; 345 345 size_t size = MCLBYTES; 346 if ( pkt_len < MSIZE)346 if (cbMin < MSIZE) 347 347 size = MCLBYTES; 348 else if ( pkt_len < MCLBYTES)348 else if (cbMin < MCLBYTES) 349 349 size = MCLBYTES; 350 else if ( pkt_len < MJUM9BYTES)350 else if (cbMin < MJUM9BYTES) 351 351 size = MJUM9BYTES; 352 else if ( pkt_len < MJUM16BYTES)352 else if (cbMin < MJUM16BYTES) 353 353 size = MJUM16BYTES; 354 354 else … … 356 356 357 357 m = m_getjcl(pData, M_NOWAIT, MT_HEADER, M_PKTHDR, size); 358 m->m_len = pkt_len;359 memcpy(m->m_data, pkt, pkt_len);360 return (void *)m;361 } 362 363 void slirp_ext_m_free(PNATState pData, void *arg) 364 { 365 struct mbuf *m = (struct mbuf *)arg; 358 m->m_len = size ; 359 *ppvBuf = mtod(m, void *); 360 *pcbBuf = size; 361 return m; 362 } 363 364 void slirp_ext_m_free(PNATState pData, struct mbuf *m) 365 { 366 366 m_free(pData, m); 367 367 }
Note:
See TracChangeset
for help on using the changeset viewer.