Changeset a736847c in rtems


Ignore:
Timestamp:
05/21/05 16:31:28 (17 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
c45aa34c
Parents:
3641cf08
Message:

Partial update from FreeBSD.

Location:
cpukit/libnetworking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/netinet/ip_icmp.c

    r3641cf08 ra736847c  
    2828 *
    2929 *      @(#)ip_icmp.c   8.2 (Berkeley) 1/4/94
    30  * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.98 2005/01/07 01:45:44 imp Exp $
     30 * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.101 2005/05/04 13:23:54 andre Exp $
    3131 */
    3232
     
    9696static void     icmp_reflect(struct mbuf *);
    9797static void     icmp_send(struct mbuf *, struct mbuf *);
    98 static int      ip_next_mtu(int, int);
    9998
    10099extern  struct protosw inetsw[];
     
    693692}
    694693
    695 #if 1
    696694/*
    697695 * Return the next larger or smaller MTU plateau (table from RFC 1191)
     
    699697 * is returned; otherwise, a smaller value is returned.
    700698 */
    701 static int
     699int
    702700ip_next_mtu(mtu, dir)
    703701        int mtu;
     
    705703{
    706704        static int mtutab[] = {
    707                 65535, 32000, 17914, 8166, 4352, 2002, 1492, 1006, 508, 296,
    708                 68, 0
     705                65535, 32000, 17914, 8166, 4352, 2002, 1492, 1280, 1006, 508,
     706                296, 68, 0
    709707        };
    710708        int i;
     
    731729        }
    732730}
    733 #endif
  • cpukit/libnetworking/sys/mbuf.h

    r3641cf08 ra736847c  
    128128#define m_dat           M_dat.M_databuf
    129129
    130 /* mbuf flags */
     130/*
     131 * mbuf flags.
     132 */
    131133#define M_EXT           0x0001  /* has associated external storage */
    132134#define M_PKTHDR        0x0002  /* start of record */
     
    134136#define M_PROTO1        0x0008  /* protocol-specific */
    135137
    136 /* mbuf pkthdr flags, also in m_flags */
     138/*
     139 * mbuf pkthdr flags (also stored in m_flags).
     140 */
    137141#define M_BCAST         0x0100  /* send/received as link-level broadcast */
    138142#define M_MCAST         0x0200  /* send/received as link-level multicast */
    139143
    140 /* flags copied when copying m_pkthdr */
     144/*
     145 * Flags copied when copying m_pkthdr.
     146 */
    141147#define M_COPYFLAGS     (M_PKTHDR|M_EOR|M_PROTO1|M_BCAST|M_MCAST)
    142148
    143 /* mbuf types */
     149/*
     150 * mbuf types.
     151 */
    144152#define MT_FREE         0       /* should be on free list */
    145153#define MT_DATA         1       /* dynamic (data) allocation */
     
    157165#define MT_CONTROL      14      /* extra-data protocol message */
    158166#define MT_OOBDATA      15      /* expedited data  */
     167
     168/*
     169 * General mbuf allocator statistics structure.
     170 */
     171struct mbstat {
     172        u_long  m_mbufs;        /* mbufs obtained from page pool */
     173        u_long  m_clusters;     /* clusters obtained from page pool */
     174        u_long  m_spare;        /* spare field */
     175        u_long  m_clfree;       /* free clusters */
     176        u_long  m_drops;        /* times failed to find space */
     177        u_long  m_wait;         /* times waited for space */
     178        u_long  m_drain;        /* times drained protocols for space */
     179        u_short m_mtypes[256];  /* type specific mbuf allocations */
     180};
     181
    159182
    160183/* flags to m_get/MGET */
     
    317340 * an object of the specified size at the end of the mbuf, longword aligned.
    318341 */
    319 #define M_ALIGN(m, len) \
    320         { (m)->m_data += (MLEN - (len)) &~ (sizeof(long) - 1); }
     342#define M_ALIGN(m, len) do {                                            \
     343        (m)->m_data += (MLEN - (len)) & ~(sizeof(long) - 1);            \
     344} while (0)
     345
    321346/*
    322347 * As above, for mbufs allocated with m_gethdr/MGETHDR
    323348 * or initialized by M_COPY_PKTHDR.
    324349 */
    325 #define MH_ALIGN(m, len) \
    326         { (m)->m_data += (MHLEN - (len)) &~ (sizeof(long) - 1); }
     350#define MH_ALIGN(m, len) do {                                           \
     351        (m)->m_data += (MHLEN - (len)) & ~(sizeof(long) - 1);           \
     352} while (0)
    327353
    328354/*
     
    360386}
    361387
    362 /* change mbuf to new type */
     388/*
     389 * Change mbuf to new type.
     390 * This is a relatively expensive operation and should be avoided.
     391 */
    363392#define MCHTYPE(m, t) { \
    364393        MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--; mbstat.m_mtypes[t]++;) \
     
    366395}
    367396
    368 /* length to m_copy to copy all */
     397/* Length to m_copy to copy all. */
    369398#define M_COPYALL       1000000000
    370399
    371 /* compatibility with 4.3 */
     400/* Compatibility with 4.3. */
    372401#define  m_copy(m, o, l)        m_copym((m), (o), (l), M_DONTWAIT)
    373 
    374 /*
    375  * Mbuf statistics.
    376  */
    377 struct mbstat {
    378         u_long  m_mbufs;        /* mbufs obtained from page pool */
    379         u_long  m_clusters;     /* clusters obtained from page pool */
    380         u_long  m_spare;        /* spare field */
    381         u_long  m_clfree;       /* free clusters */
    382         u_long  m_drops;        /* times failed to find space */
    383         u_long  m_wait;         /* times waited for space */
    384         u_long  m_drain;        /* times drained protocols for space */
    385         u_short m_mtypes[256];  /* type specific mbuf allocations */
    386 };
    387402
    388403#ifdef  _KERNEL
     
    398413extern int      max_hdr;                /* largest link+protocol header */
    399414extern int      max_datalen;            /* MHLEN - max_hdr */
    400 extern int      mbtypes[];              /* XXX */
    401415
    402416struct  mbuf *m_copym(struct mbuf *, int, int, int);
     
    422436void    m_reclaim(void);
    423437
    424 #ifdef MBTYPES
    425 int mbtypes[] = {                               /* XXX */
    426         M_FREE,         /* MT_FREE      0          should be on free list */
    427         M_MBUF,         /* MT_DATA      1          dynamic (data) allocation */
    428         M_MBUF,         /* MT_HEADER    2          packet header */
    429         M_SOCKET,       /* MT_SOCKET    3          socket structure */
    430         M_PCB,          /* MT_PCB       4          protocol control block */
    431         M_RTABLE,       /* MT_RTABLE    5          routing tables */
    432         M_HTABLE,       /* MT_HTABLE    6          IMP host tables */
    433         0,              /* MT_ATABLE    7          address resolution tables */
    434         M_MBUF,         /* MT_SONAME    8          socket name */
    435         0,              /*              9 */
    436         M_SOOPTS,       /* MT_SOOPTS    10         socket options */
    437         M_FTABLE,       /* MT_FTABLE    11         fragment reassembly header */
    438         M_MBUF,         /* MT_RIGHTS    12         access rights */
    439         M_IFADDR,       /* MT_IFADDR    13         interface address */
    440         M_MBUF,         /* MT_CONTROL   14         extra-data protocol message */
    441         M_MBUF,         /* MT_OOBDATA   15         expedited data  */
    442 #ifdef DATAKIT
    443         25, 26, 27, 28, 29, 30, 31, 32          /* datakit ugliness */
    444 #endif
    445 };
    446 #endif
    447 #endif
     438#endif /* _KERNEL */
    448439
    449440#endif /* !_SYS_MBUF_H_ */
Note: See TracChangeset for help on using the changeset viewer.