mirror of
				https://gitlab.labs.nic.cz/labs/bird.git
				synced 2024-05-11 16:54:54 +00:00 
			
		
		
		
	Filter refactoring: Moved the bitfield bit position formula to route.h
This commit is contained in:
		
				
					committed by
					
						
						Maria Matejka
					
				
			
			
				
	
			
			
			
						parent
						
							aca8263926
						
					
				
				
					commit
					25566c6810
				
			@@ -597,9 +597,6 @@ val_format_str(struct filter_state *fs, struct f_val v) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static struct tbf rl_runtime_err = TBF_DEFAULT_LOG_LIMITS;
 | 
					static struct tbf rl_runtime_err = TBF_DEFAULT_LOG_LIMITS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BITFIELD_MASK(what) \
 | 
					 | 
				
			||||||
  (1u << (what->a2.i >> 24))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * interpret
 | 
					 * interpret
 | 
				
			||||||
 * @fs: filter state
 | 
					 * @fs: filter state
 | 
				
			||||||
@@ -656,6 +653,8 @@ interpret(struct filter_state *fs, struct f_inst *what)
 | 
				
			|||||||
#define ACCESS_EATTRS \
 | 
					#define ACCESS_EATTRS \
 | 
				
			||||||
  do { if (!fs->eattrs) f_cache_eattrs(fs); } while (0)
 | 
					  do { if (!fs->eattrs) f_cache_eattrs(fs); } while (0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define BITFIELD_MASK(what_) (1u << EA_BIT_GET(what_->a2.i))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Binary operators */
 | 
					/* Binary operators */
 | 
				
			||||||
  case FI_ADD:
 | 
					  case FI_ADD:
 | 
				
			||||||
    ARG(1,T_INT);
 | 
					    ARG(1,T_INT);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -493,6 +493,7 @@ const char *ea_custom_name(uint ea);
 | 
				
			|||||||
#define EA_CUSTOM_BIT 0x8000
 | 
					#define EA_CUSTOM_BIT 0x8000
 | 
				
			||||||
#define EA_ALLOW_UNDEF 0x10000		/* ea_find: allow EAF_TYPE_UNDEF */
 | 
					#define EA_ALLOW_UNDEF 0x10000		/* ea_find: allow EAF_TYPE_UNDEF */
 | 
				
			||||||
#define EA_BIT(n) ((n) << 24)		/* Used in bitfield accessors */
 | 
					#define EA_BIT(n) ((n) << 24)		/* Used in bitfield accessors */
 | 
				
			||||||
 | 
					#define EA_BIT_GET(ea) ((ea) >> 24)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define EAF_TYPE_MASK 0x1f		/* Mask with this to get type */
 | 
					#define EAF_TYPE_MASK 0x1f		/* Mask with this to get type */
 | 
				
			||||||
#define EAF_TYPE_INT 0x01		/* 32-bit unsigned integer number */
 | 
					#define EAF_TYPE_INT 0x01		/* 32-bit unsigned integer number */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user