source: rtems-libbsd/freebsd/contrib/libpcap/pcap-common.h @ 084d4db

4.11
Last change on this file since 084d4db was 8440506, checked in by Chris Johns <chrisj@…>, on 06/15/15 at 07:42:23

Add tcpdump and libpcap.

  • Update the file builder generator to handle generator specific cflags and includes. The tcpdump and libpcap have localised headers and need specific headers paths to see them. There are also module specific flags and these need to be passed to the lex and yacc generators.
  • Add the tcpdump support.
  • Property mode set to 100644
File size: 973 bytes
Line 
1
2/*
3 * We use the "receiver-makes-right" approach to byte order,
4 * because time is at a premium when we are writing the file.
5 * In other words, the pcap_file_header and pcap_pkthdr,
6 * records are written in host byte order.
7 * Note that the bytes of packet data are written out in the order in
8 * which they were received, so multi-byte fields in packets are not
9 * written in host byte order, they're written in whatever order the
10 * sending machine put them in.
11 *
12 * ntoh[ls] aren't sufficient because we might need to swap on a big-endian
13 * machine (if the file was written in little-end order).
14 */
15#define SWAPLONG(y) \
16((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))
17#define SWAPSHORT(y) \
18        ( (((y)&0xff)<<8) | ((u_short)((y)&0xff00)>>8) )
19
20extern int dlt_to_linktype(int dlt);
21
22extern int linktype_to_dlt(int linktype);
23
24extern void swap_linux_usb_header(const struct pcap_pkthdr *hdr, u_char *buf,
25    int header_len_64_bytes);
Note: See TracBrowser for help on using the repository browser.