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 **************************************************************************** 11 ****************************************************************************/ 12 #ifndef __LINUX_MROUTE6_H 13 #define __LINUX_MROUTE6_H 14 15 #include <linux/types.h> 16 #include <linux/sockios.h> 17 18 #define MRT6_BASE 200 19 #define MRT6_INIT (MRT6_BASE) 20 #define MRT6_DONE (MRT6_BASE+1) 21 #define MRT6_ADD_MIF (MRT6_BASE+2) 22 #define MRT6_DEL_MIF (MRT6_BASE+3) 23 #define MRT6_ADD_MFC (MRT6_BASE+4) 24 #define MRT6_DEL_MFC (MRT6_BASE+5) 25 #define MRT6_VERSION (MRT6_BASE+6) 26 #define MRT6_ASSERT (MRT6_BASE+7) 27 #define MRT6_PIM (MRT6_BASE+8) 28 #define MRT6_TABLE (MRT6_BASE+9) 29 30 #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE 31 #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) 32 #define SIOCGETRPF (SIOCPROTOPRIVATE+2) 33 34 #define MAXMIFS 32 35 typedef unsigned long mifbitmap_t; 36 typedef unsigned short mifi_t; 37 #define ALL_MIFS ((mifi_t)(-1)) 38 39 #ifndef IF_SETSIZE 40 #define IF_SETSIZE 256 41 #endif 42 43 typedef __u32 if_mask; 44 #define NIFBITS (sizeof(if_mask) * 8) 45 46 #ifndef DIV_ROUND_UP 47 #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) 48 #endif 49 50 typedef struct if_set { 51 if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; 52 } if_set; 53 54 #define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS))) 55 #define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS))) 56 #define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS))) 57 #define IF_COPY(f, t) bcopy(f, t, sizeof(*(f))) 58 #define IF_ZERO(p) bzero(p, sizeof(*(p))) 59 60 struct mif6ctl { 61 mifi_t mif6c_mifi; 62 unsigned char mif6c_flags; 63 unsigned char vifc_threshold; 64 __u16 mif6c_pifi; 65 unsigned int vifc_rate_limit; 66 }; 67 68 #define MIFF_REGISTER 0x1 69 70 struct mf6cctl { 71 struct sockaddr_in6 mf6cc_origin; 72 struct sockaddr_in6 mf6cc_mcastgrp; 73 mifi_t mf6cc_parent; 74 struct if_set mf6cc_ifset; 75 }; 76 77 struct sioc_sg_req6 { 78 struct sockaddr_in6 src; 79 struct sockaddr_in6 grp; 80 unsigned long pktcnt; 81 unsigned long bytecnt; 82 unsigned long wrong_if; 83 }; 84 85 struct sioc_mif_req6 { 86 mifi_t mifi; 87 unsigned long icount; 88 unsigned long ocount; 89 unsigned long ibytes; 90 unsigned long obytes; 91 }; 92 93 struct mrt6msg { 94 #define MRT6MSG_NOCACHE 1 95 #define MRT6MSG_WRONGMIF 2 96 #define MRT6MSG_WHOLEPKT 3 97 __u8 im6_mbz; 98 __u8 im6_msgtype; 99 __u16 im6_mif; 100 __u32 im6_pad; 101 struct in6_addr im6_src, im6_dst; 102 }; 103 104 #endif 105