Check-in [7c39ff9950]
Overview
SHA1:7c39ff995022dc028cc0bb84df8e33f3704d204b
Date: 2012-01-10 22:14:25
User: rmiller
Comment:few minor cosmetic changes
Timelines: family | ancestors | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2012-01-10
22:14
[7c39ff9950] Leaf: few minor cosmetic changes (user: rmiller, tags: trunk)
2012-01-09
23:12
[d639e0a548] Patch per Matthias Bernhardt. (user: rmiller, tags: trunk)
Changes

Modified packetbl.c from [8779e8d279] to [129d0415ab].

   462    462   	 * Header length is usually 20, or 5 32-bit words */
   463    463   	ip_header_length = payload[0] & 0x0F;
   464    464   	header_size = ip_header_length * 4;
   465    465   
   466    466   	/* We're not handling IPV6 packets yet.  I'll probably rewrite
   467    467   	 * this whole damned thing in C++ first. */
   468    468   	if (version != 4) {
          469  +		DEBUG(2, "IPV6 packet received and ignored.");
   469    470   		return -1;
   470    471   	}
   471    472   
   472    473   	/* IP Address			Bytes 13 - 16 of IP header */
   473    474   	ip->b1 = payload[12];
   474    475   	ip->b2 = payload[13];
   475    476   	ip->b3 = payload[14];
................................................................................
   590    591   	if (conf.queueno < 0) {
   591    592   		conf.queueno = 1;
   592    593   		fprintf(stderr, "queueno negative - using default");
   593    594   	}
   594    595   
   595    596   	config_setting = config_lookup(config, "blacklistbl");
   596    597   	if (config_setting != NULL) {
   597         -		parse_config_bl_list(config_setting, 1);
          598  +		parse_config_bl_list(config_setting, TYPE_BLACKLISTBL);
   598    599   	}
   599    600   	config_setting = config_lookup(config, "whitelistbl");
   600    601   	if (config_setting != NULL) {
   601         -		parse_config_bl_list(config_setting, 2);
          602  +		parse_config_bl_list(config_setting, TYPE_WHITELISTBL);
   602    603   	}
   603    604   	config_setting = config_lookup(config, "blacklist");
   604    605   	if (config_setting != NULL) {
   605         -		parse_config_bl_list(config_setting, 3);
          606  +		parse_config_bl_list(config_setting, TYPE_BLACKLIST);
   606    607   	}
   607    608   	config_setting = config_lookup(config, "whitelist");
   608    609   	if (config_setting != NULL) {
   609         -		parse_config_bl_list(config_setting, 4);
          610  +		parse_config_bl_list(config_setting, TYPE_WHITELIST);
   610    611   	}
   611    612   }
   612    613   
   613    614   parse_config_bl_list(config_setting_t *c, int type) {
   614    615   
   615    616   	struct config_entry *ce, *tmp;
   616    617   	int i = 0, len = 0;
................................................................................
   641    642   			ce->string[blacklistlen - 1] = '\0';
   642    643   		}
   643    644   #endif
   644    645   
   645    646   		i++;
   646    647   
   647    648   		switch (type) {
   648         -			case 1:
          649  +			case TYPE_BLACKLISTBL:
   649    650   				if (conf.blacklistbl == NULL) {
   650    651   					conf.blacklistbl = ce;
   651    652   					continue;
   652    653   				} else {
   653    654   					tmp = conf.blacklistbl;
   654    655   				}
   655    656   				break;
   656         -			case 2:
          657  +			case TYPE_WHITELISTBL:
   657    658   				if (conf.whitelistbl == NULL) {
   658    659   					conf.whitelistbl = ce;
   659    660   					continue;
   660    661   				} else {
   661    662   					tmp = conf.whitelistbl;
   662    663   				}
   663         -			case 3:
          664  +			case TYPE_BLACKLIST:
   664    665   				fprintf(stderr, "got %s for blacklist\n", ce->string);
   665    666   				if (parse_cidr(ce) == -1) {
   666    667   					fprintf(stderr, "Error parsing CIDR in %s, ignoring\n", ce->string);
   667    668   					free(ce->string);
   668    669   					free(ce);
   669    670   					continue;
   670    671   				}
................................................................................
   671    672   				if (conf.blacklist == NULL) {
   672    673   					conf.blacklist = ce;
   673    674   					continue;
   674    675   				} else {
   675    676   					tmp = conf.blacklist;
   676    677   				}
   677    678   				break;
   678         -			case 4:
          679  +			case TYPE_WHITELIST:
   679    680   				if (parse_cidr(ce) == -1) {
   680    681   					fprintf(stderr, "Error parsing CIDR in %s, ignoring\n", ce->string);
   681    682   					free(ce->string);
   682    683   					free(ce);
   683    684   					continue;
   684    685   				}
   685    686   				if (conf.whitelist == NULL) {

Modified packetbl.h from [0899b0d159] to [53bd514156].

   192    192   	{"local4", LOG_LOCAL4},
   193    193   	{"local5", LOG_LOCAL5},
   194    194   	{"local6", LOG_LOCAL6},
   195    195   	{"local7", LOG_LOCAL7},
   196    196   	NULL
   197    197   };
   198    198   
          199  +enum type {
          200  +	TYPE_BLACKLISTBL,
          201  +	TYPE_WHITELISTBL,
          202  +	TYPE_BLACKLIST,
          203  +	TYPE_WHITELIST
          204  +};
   199    205   #endif