VirtualBox

Changeset 14228 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Nov 16, 2008 6:36:37 AM (16 years ago)
Author:
vboxsync
Message:

hash table for BSD-styled fragmentation/reassembling introduced and its initialization

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

Legend:

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

    r14227 r14228  
    261261};
    262262
     263#ifdef VBOX_WITH_BSD_REASS
     264/*
     265* IP datagram reassembly.
     266*/
     267#define IPREASS_NHASH_LOG2      6
     268#define IPREASS_NHASH           (1 << IPREASS_NHASH_LOG2)
     269#define IPREASS_HMASK           (IPREASS_NHASH - 1)
     270#define IPREASS_HASH(x,y) \
     271(((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
     272TAILQ_HEAD(ipqhead,ipq_t);
     273#endif /* VBOX_WITH_BSD_REASS */
     274
    263275/*
    264276 * Ip header, when holding a fragment.
  • trunk/src/VBox/Devices/Network/slirp/ip_input.c

    r14227 r14228  
    5757        ipq.next = ipq.prev = ptr_to_u32(pData, &ipq);
    5858#else /* !VBOX_WITH_BSD_REASS */
     59        int i = 0;
     60        for (i = 0; i < IPREASS_NHASH; ++i)
     61            TAILQ_INIT(&ipq[i]);
    5962#endif /* VBOX_WITH_BSD_REASS */
    6063        ip_currid = tt.tv_sec & 0xffff;
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r14204 r14228  
    6969    /* Stuff from ip_input.c */
    7070    struct ipstat_t ipstat;
     71#ifndef VBOX_WITH_BSD_REASS
    7172    struct ipq_t ipq;
     73#else /* !VBOX_WITH_BSD_REASS */
     74    struct ipqhead ipq[IPREASS_NHASH];
     75#endif /* VBOX_WITH_BSD_REASS */
    7276    uint16_t ip_currid;
    7377    /* Stuff from mbuf.c */
     
    116120    struct socket udb;
    117121    struct socket *udp_last_so;
    118 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 
     122#if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
    119123# define VBOX_SOCKET_EVENT (pData->phEvents[VBOX_SOCKET_EVENT_INDEX])
    120124    HANDLE phEvents[VBOX_EVENT_COUNT];
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