VirtualBox

Ignore:
Timestamp:
Sep 19, 2009 11:02:11 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52570
Message:

NAT: BSD mbuf

Location:
trunk/src/VBox/Devices/Network/slirp/libalias
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias.c

    r20958 r23154  
    16661666#endif
    16671667
    1668 #ifdef _KERNEL
     1668#if defined(_KERNEL) || (defined(VBOX) && defined(VBOX_WITH_SLIRP_BSD_MBUF))
    16691669/*
    16701670 * m_megapullup() - this function is a big hack.
     
    16801680 */
    16811681struct mbuf *
    1682 m_megapullup(struct mbuf *m, int len) {
     1682#ifndef VBOX
     1683m_megapullup(struct mbuf *m, int len)
     1684#else
     1685m_megapullup(PNATState pData, struct mbuf *m, int len)
     1686#endif
     1687{
    16831688    struct mbuf *mcl;
    16841689   
     
    16941699
    16951700    if (len <= MCLBYTES - RESERVE) {
     1701#ifndef VBOX
    16961702        mcl = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
     1703#else
     1704        mcl = m_getcl(pData, M_DONTWAIT, MT_DATA, M_PKTHDR);
     1705#endif
    16971706    } else if (len < MJUM16BYTES) {
    16981707        int size;
     
    17041713            size = MJUM16BYTES;
    17051714        };
     1715#ifndef VBOX
    17061716        mcl = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
     1717#else
     1718        mcl = m_getjcl(pData, M_DONTWAIT, MT_DATA, M_PKTHDR, size);
     1719#endif
    17071720    } else {
    17081721        goto bad;
     
    17141727    m_copydata(m, 0, len, mtod(mcl, caddr_t));
    17151728    mcl->m_len = mcl->m_pkthdr.len = len;
     1729#ifndef VBOX
    17161730    m_freem(m);
     1731#else
     1732    m_freem(pData, m);
     1733#endif
    17171734 
    17181735    return (mcl);
    17191736bad:
     1737#ifndef VBOX
    17201738    m_freem(m);
     1739#else
     1740    m_freem(pData, m);
     1741#endif
    17211742    return (NULL);
    17221743}
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias.h

    r20958 r23154  
    205205
    206206/* Mbuf helper function. */
     207#ifndef VBOX
    207208struct mbuf    *m_megapullup(struct mbuf *, int);
     209#else
     210struct mbuf    *m_megapullup(PNATState, struct mbuf *, int);
     211#endif
    208212
    209213/*
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c

    r21718 r23154  
    175175#else /* !VBOX */
    176176# include <iprt/assert.h>
    177 # include <slirp.h>
    178177# include "alias.h"
    179178# include "alias_local.h"
    180179# include "alias_mod.h"
     180# include <slirp.h>
    181181#endif /* VBOX */
    182182
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c

    r22881 r23154  
    8383        uint16_t addr_off = (uint16_t)~0;
    8484       
     85#ifndef VBOX_WITH_SLIRP_BSD_MBUF
    8586        m = dtom(la->pData, hdr);
     87#else
     88        AssertMsgFailed(("Unimplemented"));
     89#endif
    8690        Assert((m));
    8791       
Note: See TracChangeset for help on using the changeset viewer.

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