• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/xnu-2782.1.97/bsd/sys/

Lines Matching defs:mbuf

70  *	@(#)mbuf.h	8.3 (Berkeley) 1/21/94
92 * includes overhead. An mbuf may add a single "mbuf cluster" of size
120 * mtod(m,t) - convert mbuf pointer to data pointer of correct type
121 * dtom(x) - convert data pointer within mbuf to mbuf pointer (XXX)
126 /* header at beginning of each mbuf: */
128 struct mbuf *mh_next; /* next buffer in chain */
129 struct mbuf *mh_nextpkt; /* next chain in queue/record */
131 int32_t mh_len; /* amount of data in this mbuf */
132 u_int16_t mh_type; /* type of data in this mbuf */
157 * Packet tag header structure (at the top of mbuf). Pointers are
164 u_int64_t refcnt; /* Number of tags in this mbuf */
186 * PF mbuf tag
197 void *pftag_hdr; /* saved hdr pos in mbuf, for ECN */
202 * TCP mbuf tag
228 * MPTCP mbuf tag
246 * TCP specific mbuf tag. Note that the current implementation uses
259 * Protocol specific mbuf tag (at most one protocol metadata per mbuf).
273 * NECP specific mbuf tag.
281 * Record/packet header in first mbuf of chain; valid only if M_PKTHDR set.
330 * storing the corresponding {in,in6}_ifaddr in an mbuf tag. Ideally
334 * related code paths examining this mbuf to interpret the flags.
414 * this is an mbuf flag rather than an mbuf packet header flag.
416 * - PKTF_LOOP is an mbuf packet header flag, which is set if and only
444 * Description of external storage mapped into mbuf, valid only if M_EXT set.
465 * The mbuf object
467 struct mbuf {
495 /* mbuf flags (private) */
505 /* mbuf pkthdr flags, also in m_flags (private) */
513 #define M_TAGHDR 0x8000 /* m_tag hdr structure at top of mbuf data */
563 /* TCP Segment Offloading requested on this mbuf */
564 #define CSUM_TSO_IPV4 0x100000 /* This mbuf needs to be segmented by the NIC */
565 #define CSUM_TSO_IPV6 0x200000 /* This mbuf needs to be segmented by the NIC */
585 /* mbuf types */
606 * mbuf allocation/deallocation macros:
608 * MGET(struct mbuf *m, int how, int type)
609 * allocates an mbuf and initializes it to contain internal data.
611 * MGETHDR(struct mbuf *m, int how, int type)
612 * allocates an mbuf and initializes it to contain a packet header
628 * MCLALLOC(caddr_t p, int how) allocates an mbuf cluster.
629 * MCLGET adds such clusters to a normal mbuf;
634 * Normal mbuf clusters are normally treated as character arrays
668 * MFREE(struct mbuf *m, struct mbuf *n)
669 * Free a single mbuf and associated external storage.
676 * Copy mbuf pkthdr from from to to.
687 * Set the m_data pointer of a newly-allocated mbuf (m_get/MGET) to place
688 * an object of the specified size at the end of the mbuf, longword aligned.
706 * before the current start of data in an mbuf.
713 * after the end of data in an mbuf.
719 * Arrange to prepend space of size plen to mbuf m.
720 * If a new mbuf must be allocated, how specifies whether to wait.
721 * If how is M_DONTWAIT and allocation fails, the original mbuf chain
726 /* change mbuf to new type */
739 * "off+len") is located in single mbuf, on contiguous memory region.
744 * very top of mbuf. GET0 is likely to make memory copy than GET.
748 struct mbuf *t; \
768 struct mbuf *t; \
792 panic_plain("Failed mbuf validity check: mbuf %p len %d " \
802 * Simple mbuf queueing system
804 * This is basically a SIMPLEQ adapted to mbuf use (i.e. using
811 struct mbuf *mq_first; /* first packet */ \
812 struct mbuf **mq_last; /* addr of last next packet */ \
851 struct mbuf *_m = MBUFQ_FIRST(q); \
861 struct mbuf *__m0; \
900 u_short m_mtypes[256]; /* type specific mbuf allocations */
903 u_int32_t m_msize; /* length of an mbuf */
904 u_int32_t m_mclbytes; /* length of an mbuf cluster */
906 u_int32_t m_mlen; /* length of data in an mbuf */
907 u_int32_t m_mhlen; /* length of data in a header mbuf */
910 u_int32_t m_bigmclbytes; /* length of an mbuf cluster */
922 u_short m_mtypes[256]; /* type specific mbuf allocations */
925 u_int32_t m_msize; /* length of an mbuf */
926 u_int32_t m_mclbytes; /* length of an mbuf cluster */
928 u_int32_t m_mlen; /* length of data in an mbuf */
929 u_int32_t m_mhlen; /* length of data in a header mbuf */
933 * mbuf class statistics.
1079 struct mbuf;
1104 extern void m_freem(struct mbuf *);
1106 extern void m_adj(struct mbuf *, int);
1107 extern void m_cat(struct mbuf *, struct mbuf *);
1108 extern void m_copydata(struct mbuf *, int, int, void *);
1109 extern struct mbuf *m_copym(struct mbuf *, int, int, int);
1110 extern struct mbuf *m_copym_mode(struct mbuf *, int, int, int, uint32_t);
1111 extern struct mbuf *m_get(int, int);
1112 extern struct mbuf *m_gethdr(int, int);
1113 extern struct mbuf *m_getpacket(void);
1114 extern struct mbuf *m_getpackets(int, int, int);
1115 extern struct mbuf *m_mclget(struct mbuf *, int);
1116 extern void *m_mtod(struct mbuf *);
1117 extern struct mbuf *m_prepend_2(struct mbuf *, int, int);
1118 extern struct mbuf *m_pullup(struct mbuf *, int);
1119 extern struct mbuf *m_split(struct mbuf *, int, int);
1124 * i386 or x86_64), this macro checks whether the data pointer of an mbuf
1135 panic_plain("\n%s: mbuf %p data ptr %p is not " \
1141 panic_plain("\n%s: mbuf %p data ptr %p is not " \
1224 extern union mbigcluster *mbutl; /* start VA of mbuf pool */
1225 extern union mbigcluster *embutl; /* end VA of mbuf pool */
1240 __private_extern__ struct mbuf *m_clattach(struct mbuf *, int, caddr_t,
1244 __private_extern__ struct mbuf *m_mbigget(struct mbuf *, int);
1247 __private_extern__ struct mbuf *m_m16kget(struct mbuf *, int);
1248 __private_extern__ int m_reinit(struct mbuf *, int);
1249 __private_extern__ struct mbuf *m_free(struct mbuf *);
1250 __private_extern__ struct mbuf *m_getclr(int, int);
1251 __private_extern__ struct mbuf *m_getptr(struct mbuf *, int, int *);
1252 __private_extern__ unsigned int m_length(struct mbuf *);
1253 __private_extern__ unsigned int m_length2(struct mbuf *, struct mbuf **);
1254 __private_extern__ unsigned int m_fixhdr(struct mbuf *);
1255 __private_extern__ struct mbuf *m_defrag(struct mbuf *, int);
1256 __private_extern__ struct mbuf *m_defrag_offset(struct mbuf *, u_int32_t, int);
1257 __private_extern__ struct mbuf *m_prepend(struct mbuf *, int, int);
1258 __private_extern__ struct mbuf *m_copyup(struct mbuf *, int, int);
1259 __private_extern__ struct mbuf *m_retry(int, int);
1260 __private_extern__ struct mbuf *m_retryhdr(int, int);
1261 __private_extern__ int m_freem_list(struct mbuf *);
1262 __private_extern__ int m_append(struct mbuf *, int, caddr_t);
1263 __private_extern__ struct mbuf *m_last(struct mbuf *);
1264 __private_extern__ struct mbuf *m_devget(char *, int, int, struct ifnet *,
1266 __private_extern__ struct mbuf *m_pulldown(struct mbuf *, int, int, int *);
1268 __private_extern__ struct mbuf *m_getcl(int, int, int);
1270 __private_extern__ int m_mclhasreference(struct mbuf *);
1271 __private_extern__ void m_copy_pkthdr(struct mbuf *, struct mbuf *);
1272 __private_extern__ void m_copy_pftag(struct mbuf *, struct mbuf *);
1273 __private_extern__ void m_copy_classifier(struct mbuf *, struct mbuf *);
1275 __private_extern__ struct mbuf *m_dtom(void *);
1279 __private_extern__ int m_trailingspace(struct mbuf *);
1280 __private_extern__ int m_leadingspace(struct mbuf *);
1282 __private_extern__ struct mbuf *m_normalize(struct mbuf *m);
1283 __private_extern__ void m_mchtype(struct mbuf *m, int t);
1284 __private_extern__ void m_mcheck(struct mbuf *);
1286 __private_extern__ void m_copyback(struct mbuf *, int, int, const void *);
1287 __private_extern__ struct mbuf *m_copyback_cow(struct mbuf *, int, int,
1289 __private_extern__ int m_makewritable(struct mbuf **, int, int, int);
1290 __private_extern__ struct mbuf *m_dup(struct mbuf *m, int how);
1291 __private_extern__ struct mbuf *m_copym_with_hdrs(struct mbuf *, int, int, int,
1292 struct mbuf **, int *, uint32_t);
1293 __private_extern__ struct mbuf *m_getpackethdrs(int, int);
1294 __private_extern__ struct mbuf *m_getpacket_how(int);
1295 __private_extern__ struct mbuf *m_getpackets_internal(unsigned int *, int,
1297 __private_extern__ struct mbuf *m_allocpacket_internal(unsigned int *, size_t,
1348 struct mbuf *);
1350 __private_extern__ void m_tag_prepend(struct mbuf *, struct m_tag *);
1351 __private_extern__ void m_tag_unlink(struct mbuf *, struct m_tag *);
1352 __private_extern__ void m_tag_delete(struct mbuf *, struct m_tag *);
1353 __private_extern__ void m_tag_delete_chain(struct mbuf *, struct m_tag *);
1354 __private_extern__ struct m_tag *m_tag_locate(struct mbuf *, u_int32_t,
1357 __private_extern__ int m_tag_copy_chain(struct mbuf *, struct mbuf *, int);
1358 __private_extern__ void m_tag_init(struct mbuf *, int);
1359 __private_extern__ struct m_tag *m_tag_first(struct mbuf *);
1360 __private_extern__ struct m_tag *m_tag_next(struct mbuf *, struct m_tag *);
1369 __private_extern__ void m_scratch_init(struct mbuf *);
1370 __private_extern__ u_int32_t m_scratch_get(struct mbuf *, u_int8_t **);
1372 __private_extern__ void m_classifier_init(struct mbuf *, uint32_t);
1374 __private_extern__ int m_set_service_class(struct mbuf *, mbuf_svc_class_t);
1375 __private_extern__ mbuf_svc_class_t m_get_service_class(struct mbuf *);
1378 __private_extern__ int m_set_traffic_class(struct mbuf *, mbuf_traffic_class_t);
1379 __private_extern__ mbuf_traffic_class_t m_get_traffic_class(struct mbuf *);
1386 __private_extern__ u_int16_t m_adj_sum16(struct mbuf *, u_int32_t,
1388 __private_extern__ u_int16_t m_sum16(struct mbuf *, u_int32_t, u_int32_t);