Back to index

glibc  2.9
packet.h
Go to the documentation of this file.
00001 /* Definitions for use with Linux AF_PACKET sockets.
00002    Copyright (C) 1998, 1999 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef __NETPACKET_PACKET_H
00021 #define __NETPACKET_PACKET_H       1
00022 
00023 struct sockaddr_ll
00024   {
00025     unsigned short int sll_family;
00026     unsigned short int sll_protocol;
00027     int sll_ifindex;
00028     unsigned short int sll_hatype;
00029     unsigned char sll_pkttype;
00030     unsigned char sll_halen;
00031     unsigned char sll_addr[8];
00032   };
00033 
00034 /* Packet types.  */
00035 
00036 #define PACKET_HOST         0             /* To us.  */
00037 #define PACKET_BROADCAST    1             /* To all.  */
00038 #define PACKET_MULTICAST    2             /* To group.  */
00039 #define PACKET_OTHERHOST    3             /* To someone else.  */
00040 #define PACKET_OUTGOING            4             /* Originated by us . */
00041 #define PACKET_LOOPBACK            5
00042 #define PACKET_FASTROUTE    6
00043 
00044 /* Packet socket options.  */
00045 
00046 #define PACKET_ADD_MEMBERSHIP             1
00047 #define PACKET_DROP_MEMBERSHIP            2
00048 #define       PACKET_RECV_OUTPUT          3
00049 #define       PACKET_RX_RING                     5
00050 #define       PACKET_STATISTICS           6
00051 
00052 struct packet_mreq
00053   {
00054     int mr_ifindex;
00055     unsigned short int mr_type;
00056     unsigned short int mr_alen;
00057     unsigned char mr_address[8];
00058   };
00059 
00060 #define PACKET_MR_MULTICAST 0
00061 #define PACKET_MR_PROMISC   1
00062 #define PACKET_MR_ALLMULTI  2
00063 
00064 #endif /* netpacket/packet.h */