mroute.h
001: #ifndef __LINUX_MROUTE_H
002: #define __LINUX_MROUTE_H
003: 
004: #include <linux/sockios.h>
005: #include <linux/types.h>
006: 
007: 
008: 
009: 
010: 
011: 
012: 
013: 
014: cap@di.fc.ul.pt
015: 
016: 
017: 
018: #define MRT_BASE        200
019: #define MRT_INIT        (MRT_BASE)      
020: #define MRT_DONE        (MRT_BASE+1)    
021: #define MRT_ADD_VIF     (MRT_BASE+2)    
022: #define MRT_DEL_VIF     (MRT_BASE+3)    
023: #define MRT_ADD_MFC     (MRT_BASE+4)    
024: #define MRT_DEL_MFC     (MRT_BASE+5)    
025: #define MRT_VERSION     (MRT_BASE+6)    
026: #define MRT_ASSERT      (MRT_BASE+7)    
027: #define MRT_PIM         (MRT_BASE+8)    
028: #define MRT_TABLE       (MRT_BASE+9)    
029: 
030: #define SIOCGETVIFCNT   SIOCPROTOPRIVATE        
031: #define SIOCGETSGCNT    (SIOCPROTOPRIVATE+1)
032: #define SIOCGETRPF      (SIOCPROTOPRIVATE+2)
033: 
034: #define MAXVIFS         32      
035: typedef unsigned long vifbitmap_t;      
036: typedef unsigned short vifi_t;
037: #define ALL_VIFS        ((vifi_t)(-1))
038: 
039: 
040: 
041: 
042:  
043: #define VIFM_SET(n,m)   ((m)|=(1<<(n)))
044: #define VIFM_CLR(n,m)   ((m)&=~(1<<(n)))
045: #define VIFM_ISSET(n,m) ((m)&(1<<(n)))
046: #define VIFM_CLRALL(m)  ((m)=0)
047: #define VIFM_COPY(mfrom,mto)    ((mto)=(mfrom))
048: #define VIFM_SAME(m1,m2)        ((m1)==(m2))
049: 
050: 
051: 
052: 
053: 
054:  
055: struct vifctl {
056:         vifi_t  vifc_vifi;              
057:         unsigned char vifc_flags;       
058:         unsigned char vifc_threshold;   
059:         unsigned int vifc_rate_limit;   
060:         union {
061:                 struct in_addr vifc_lcl_addr;     
062:                 int            vifc_lcl_ifindex;  
063:         };
064:         struct in_addr vifc_rmt_addr;   
065: };
066: 
067: #define VIFF_TUNNEL             0x1     
068: #define VIFF_SRCRT              0x2     
069: #define VIFF_REGISTER           0x4     
070: #define VIFF_USE_IFINDEX        0x8     
071: 
072: 
073: 
074: 
075: 
076:  
077: struct mfcctl {
078:         struct in_addr mfcc_origin;             
079:         struct in_addr mfcc_mcastgrp;           
080:         vifi_t  mfcc_parent;                    
081:         unsigned char mfcc_ttls[MAXVIFS];       
082:         unsigned int mfcc_pkt_cnt;              
083:         unsigned int mfcc_byte_cnt;
084:         unsigned int mfcc_wrong_if;
085:         int          mfcc_expire;
086: };
087: 
088: 
089: 
090: 
091:  
092: struct sioc_sg_req {
093:         struct in_addr src;
094:         struct in_addr grp;
095:         unsigned long pktcnt;
096:         unsigned long bytecnt;
097:         unsigned long wrong_if;
098: };
099: 
100: 
101: 
102: 
103: 
104: struct sioc_vif_req {
105:         vifi_t  vifi;           
106:         unsigned long icount;   
107:         unsigned long ocount;   
108:         unsigned long ibytes;   
109:         unsigned long obytes;   
110: };
111: 
112: 
113: 
114: 
115: 
116:  
117: struct igmpmsg {
118:         __u32 unused1,unused2;
119:         unsigned char im_msgtype;               
120:         unsigned char im_mbz;                   
121:         unsigned char im_vif;                   
122:         unsigned char unused3;
123:         struct in_addr im_src,im_dst;
124: };
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: #define MFC_ASSERT_THRESH (3*HZ)                
133: 
134: 
135: 
136: 
137: 
138: #define IGMPMSG_NOCACHE         1               
139: #define IGMPMSG_WRONGVIF        2               
140: #define IGMPMSG_WHOLEPKT        3               
141: 
142: 
143: #endif
144: 
      
      
      
      
   
      
      
         
            
            © Andrew Scott 2006 -
            2025, 
            All Rights Reserved