mroute6.h
001: #ifndef __LINUX_MROUTE6_H
002: #define __LINUX_MROUTE6_H
003: 
004: #include <linux/types.h>
005: #include <linux/sockios.h>
006: 
007: 
008: 
009: 
010: 
011: 
012: 
013: 
014: cap@di.fc.ul.pt
015: 
016: 
017: 
018: #define MRT6_BASE       200
019: #define MRT6_INIT       (MRT6_BASE)     
020: #define MRT6_DONE       (MRT6_BASE+1)   
021: #define MRT6_ADD_MIF    (MRT6_BASE+2)   
022: #define MRT6_DEL_MIF    (MRT6_BASE+3)   
023: #define MRT6_ADD_MFC    (MRT6_BASE+4)   
024: #define MRT6_DEL_MFC    (MRT6_BASE+5)   
025: #define MRT6_VERSION    (MRT6_BASE+6)   
026: #define MRT6_ASSERT     (MRT6_BASE+7)   
027: #define MRT6_PIM        (MRT6_BASE+8)   
028: #define MRT6_TABLE      (MRT6_BASE+9)   
029: 
030: #define SIOCGETMIFCNT_IN6       SIOCPROTOPRIVATE        
031: #define SIOCGETSGCNT_IN6        (SIOCPROTOPRIVATE+1)
032: #define SIOCGETRPF      (SIOCPROTOPRIVATE+2)
033: 
034: #define MAXMIFS         32
035: typedef unsigned long mifbitmap_t;      
036: typedef unsigned short mifi_t;
037: #define ALL_MIFS        ((mifi_t)(-1))
038: 
039: #ifndef IF_SETSIZE
040: #define IF_SETSIZE      256
041: #endif
042: 
043: typedef __u32           if_mask;
044: #define NIFBITS (sizeof(if_mask) * 8)        
045: 
046: #if !defined(__KERNEL__) && !defined(DIV_ROUND_UP)
047: #define DIV_ROUND_UP(x,y)       (((x) + ((y) - 1)) / (y))
048: #endif
049: 
050: typedef struct if_set {
051:         if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
052: } if_set;
053: 
054: #define IF_SET(n, p)    ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
055: #define IF_CLR(n, p)    ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
056: #define IF_ISSET(n, p)  ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
057: #define IF_COPY(f, t)   bcopy(f, t, sizeof(*(f)))
058: #define IF_ZERO(p)      bzero(p, sizeof(*(p)))
059: 
060: 
061: 
062: 
063: 
064: 
065: struct mif6ctl {
066:         mifi_t  mif6c_mifi;             
067:         unsigned char mif6c_flags;      
068:         unsigned char vifc_threshold;   
069:         __u16    mif6c_pifi;            
070:         unsigned int vifc_rate_limit;   
071: };
072: 
073: #define MIFF_REGISTER   0x1     
074: 
075: 
076: 
077: 
078: 
079: struct mf6cctl {
080:         struct sockaddr_in6 mf6cc_origin;               
081:         struct sockaddr_in6 mf6cc_mcastgrp;             
082:         mifi_t  mf6cc_parent;                   
083:         struct if_set mf6cc_ifset;              
084: };
085: 
086: 
087: 
088: 
089: 
090: struct sioc_sg_req6 {
091:         struct sockaddr_in6 src;
092:         struct sockaddr_in6 grp;
093:         unsigned long pktcnt;
094:         unsigned long bytecnt;
095:         unsigned long wrong_if;
096: };
097: 
098: 
099: 
100: 
101: 
102: struct sioc_mif_req6 {
103:         mifi_t  mifi;           
104:         unsigned long icount;   
105:         unsigned long ocount;   
106:         unsigned long ibytes;   
107:         unsigned long obytes;   
108: };
109: 
110: 
111: 
112: 
113: 
114: 
115: 
116: 
117: 
118: 
119: 
120: 
121: 
122: 
123: 
124: struct mrt6msg {
125: #define MRT6MSG_NOCACHE         1
126: #define MRT6MSG_WRONGMIF        2
127: #define MRT6MSG_WHOLEPKT        3               
128:         __u8            im6_mbz;                
129:         __u8            im6_msgtype;            
130:         __u16           im6_mif;                
131:         __u32           im6_pad;                
132:         struct in6_addr im6_src, im6_dst;
133: };
134: 
135: #endif
136: 
      
      
      
      
   
      
      
         
            
            © Andrew Scott 2006 -
            2025, 
            All Rights Reserved