VirtualBox

Changeset 26597 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 17, 2010 4:45:03 AM (15 years ago)
Author:
vboxsync
Message:

NAT: bsd mbuf synced with last changes in drvnat.

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/libslirp.h

    r26574 r26597  
    116116#endif
    117117
    118 #ifndef VBOX_WITH_SLIRP_BSD_MBUF
    119118struct mbuf *slirp_ext_m_get(PNATState pData, size_t cbMin, void **ppvBuf, size_t *pcbBuf);
    120119void slirp_ext_m_free(PNATState pData, struct mbuf *);
     120#ifndef VBOX_WITH_SLIRP_BSD_MBUF
    121121void slirp_ext_m_append(PNATState pData, struct mbuf *, uint8_t *, size_t);
    122122void slirp_push_recv_thread(void *pvUser);
    123 #else
    124 void *slirp_ext_m_get(PNATState pData, uint8_t *, size_t);
    125 void slirp_ext_m_free(PNATState pData, void *);
    126123#endif
    127124
  • trunk/src/VBox/Devices/Network/slirp/misc.c

    r26596 r26597  
    340340}
    341341
    342 void *slirp_ext_m_get(PNATState pData, uint8_t *pkt, size_t pkt_len)
     342struct mbuf *slirp_ext_m_get(PNATState pData, size_t cbMin, void **ppvBuf, size_t *pcbBuf)
    343343{
    344344    struct mbuf *m;
    345345    size_t size = MCLBYTES;
    346     if (pkt_len < MSIZE)
     346    if (cbMin < MSIZE)
    347347        size = MCLBYTES;
    348     else if (pkt_len < MCLBYTES)
     348    else if (cbMin < MCLBYTES)
    349349        size = MCLBYTES;
    350     else if (pkt_len < MJUM9BYTES)
     350    else if (cbMin < MJUM9BYTES)
    351351        size = MJUM9BYTES;
    352     else if (pkt_len < MJUM16BYTES)
     352    else if (cbMin < MJUM16BYTES)
    353353        size = MJUM16BYTES;
    354354    else
     
    356356
    357357    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
     364void slirp_ext_m_free(PNATState pData, struct mbuf *m)
     365{
    366366    m_free(pData, m);
    367367}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette