Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ***   To edit the content of this header, modify the corresponding
     11  ***   source file (e.g. under external/kernel-headers/original/) then
     12  ***   run bionic/libc/kernel/tools/update_all.py
     13  ***
     14  ***   Any manual change here will be lost the next time this script will
     15  ***   be run. You've been warned!
     16  ***
     17  ****************************************************************************
     18  ****************************************************************************/
     19 #ifndef __LINUX_IF_PACKET_H
     20 #define __LINUX_IF_PACKET_H
     21 struct sockaddr_pkt
     22 {
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24  unsigned short spkt_family;
     25  unsigned char spkt_device[14];
     26  unsigned short spkt_protocol;
     27 };
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29 struct sockaddr_ll
     30 {
     31  unsigned short sll_family;
     32  unsigned short sll_protocol;
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34  int sll_ifindex;
     35  unsigned short sll_hatype;
     36  unsigned char sll_pkttype;
     37  unsigned char sll_halen;
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39  unsigned char sll_addr[8];
     40 };
     41 #define PACKET_HOST 0
     42 #define PACKET_BROADCAST 1
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44 #define PACKET_MULTICAST 2
     45 #define PACKET_OTHERHOST 3
     46 #define PACKET_OUTGOING 4
     47 #define PACKET_LOOPBACK 5
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49 #define PACKET_FASTROUTE 6
     50 #define PACKET_ADD_MEMBERSHIP 1
     51 #define PACKET_DROP_MEMBERSHIP 2
     52 #define PACKET_RECV_OUTPUT 3
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54 #define PACKET_RX_RING 5
     55 #define PACKET_STATISTICS 6
     56 #define PACKET_COPY_THRESH 7
     57 struct tpacket_stats
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59 {
     60  unsigned int tp_packets;
     61  unsigned int tp_drops;
     62 };
     63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     64 struct tpacket_hdr
     65 {
     66  unsigned long tp_status;
     67 #define TP_STATUS_KERNEL 0
     68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     69 #define TP_STATUS_USER 1
     70 #define TP_STATUS_COPY 2
     71 #define TP_STATUS_LOSING 4
     72 #define TP_STATUS_CSUMNOTREADY 8
     73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     74  unsigned int tp_len;
     75  unsigned int tp_snaplen;
     76  unsigned short tp_mac;
     77  unsigned short tp_net;
     78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     79  unsigned int tp_sec;
     80  unsigned int tp_usec;
     81 };
     82 #define TPACKET_ALIGNMENT 16
     83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     84 #define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
     85 #define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
     86 struct tpacket_req
     87 {
     88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     89  unsigned int tp_block_size;
     90  unsigned int tp_block_nr;
     91  unsigned int tp_frame_size;
     92  unsigned int tp_frame_nr;
     93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     94 };
     95 struct packet_mreq
     96 {
     97  int mr_ifindex;
     98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     99  unsigned short mr_type;
    100  unsigned short mr_alen;
    101  unsigned char mr_address[8];
    102 };
    103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    104 #define PACKET_MR_MULTICAST 0
    105 #define PACKET_MR_PROMISC 1
    106 #define PACKET_MR_ALLMULTI 2
    107 #endif
    108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    109