1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI__LINUX_MROUTE6_H 7 #define _UAPI__LINUX_MROUTE6_H 8 #include <linux/kernel.h> 9 #include <linux/types.h> 10 #include <linux/sockios.h> 11 #include <linux/in6.h> 12 #define MRT6_BASE 200 13 #define MRT6_INIT (MRT6_BASE) 14 #define MRT6_DONE (MRT6_BASE+1) 15 #define MRT6_ADD_MIF (MRT6_BASE+2) 16 #define MRT6_DEL_MIF (MRT6_BASE+3) 17 #define MRT6_ADD_MFC (MRT6_BASE+4) 18 #define MRT6_DEL_MFC (MRT6_BASE+5) 19 #define MRT6_VERSION (MRT6_BASE+6) 20 #define MRT6_ASSERT (MRT6_BASE+7) 21 #define MRT6_PIM (MRT6_BASE+8) 22 #define MRT6_TABLE (MRT6_BASE+9) 23 #define MRT6_ADD_MFC_PROXY (MRT6_BASE+10) 24 #define MRT6_DEL_MFC_PROXY (MRT6_BASE+11) 25 #define MRT6_MAX (MRT6_BASE+11) 26 #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE 27 #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) 28 #define SIOCGETRPF (SIOCPROTOPRIVATE+2) 29 #define MAXMIFS 32 30 typedef unsigned long mifbitmap_t; 31 typedef unsigned short mifi_t; 32 #define ALL_MIFS ((mifi_t)(-1)) 33 #ifndef IF_SETSIZE 34 #define IF_SETSIZE 256 35 #endif 36 typedef __u32 if_mask; 37 #define NIFBITS (sizeof(if_mask) * 8) 38 typedef struct if_set { 39 if_mask ifs_bits[__KERNEL_DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; 40 } if_set; 41 #define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS))) 42 #define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS))) 43 #define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS))) 44 #define IF_COPY(f, t) bcopy(f, t, sizeof(*(f))) 45 #define IF_ZERO(p) bzero(p, sizeof(*(p))) 46 struct mif6ctl { 47 mifi_t mif6c_mifi; 48 unsigned char mif6c_flags; 49 unsigned char vifc_threshold; 50 __u16 mif6c_pifi; 51 unsigned int vifc_rate_limit; 52 }; 53 #define MIFF_REGISTER 0x1 54 struct mf6cctl { 55 struct sockaddr_in6 mf6cc_origin; 56 struct sockaddr_in6 mf6cc_mcastgrp; 57 mifi_t mf6cc_parent; 58 struct if_set mf6cc_ifset; 59 }; 60 struct sioc_sg_req6 { 61 struct sockaddr_in6 src; 62 struct sockaddr_in6 grp; 63 unsigned long pktcnt; 64 unsigned long bytecnt; 65 unsigned long wrong_if; 66 }; 67 struct sioc_mif_req6 { 68 mifi_t mifi; 69 unsigned long icount; 70 unsigned long ocount; 71 unsigned long ibytes; 72 unsigned long obytes; 73 }; 74 struct mrt6msg { 75 #define MRT6MSG_NOCACHE 1 76 #define MRT6MSG_WRONGMIF 2 77 #define MRT6MSG_WHOLEPKT 3 78 __u8 im6_mbz; 79 __u8 im6_msgtype; 80 __u16 im6_mif; 81 __u32 im6_pad; 82 struct in6_addr im6_src, im6_dst; 83 }; 84 enum { 85 IP6MRA_CREPORT_UNSPEC, 86 IP6MRA_CREPORT_MSGTYPE, 87 IP6MRA_CREPORT_MIF_ID, 88 IP6MRA_CREPORT_SRC_ADDR, 89 IP6MRA_CREPORT_DST_ADDR, 90 IP6MRA_CREPORT_PKT, 91 __IP6MRA_CREPORT_MAX 92 }; 93 #define IP6MRA_CREPORT_MAX (__IP6MRA_CREPORT_MAX - 1) 94 #endif 95