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

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

462
463
464
465
466
467
468

469
470
471
472
473
474
475
...
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
...
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
...
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
	 * Header length is usually 20, or 5 32-bit words */
	ip_header_length = payload[0] & 0x0F;
	header_size = ip_header_length * 4;

	/* We're not handling IPV6 packets yet.  I'll probably rewrite
	 * this whole damned thing in C++ first. */
	if (version != 4) {

		return -1;
	}

	/* IP Address			Bytes 13 - 16 of IP header */
	ip->b1 = payload[12];
	ip->b2 = payload[13];
	ip->b3 = payload[14];
................................................................................
	if (conf.queueno < 0) {
		conf.queueno = 1;
		fprintf(stderr, "queueno negative - using default");
	}

	config_setting = config_lookup(config, "blacklistbl");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, 1);
	}
	config_setting = config_lookup(config, "whitelistbl");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, 2);
	}
	config_setting = config_lookup(config, "blacklist");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, 3);
	}
	config_setting = config_lookup(config, "whitelist");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, 4);
	}
}

parse_config_bl_list(config_setting_t *c, int type) {

	struct config_entry *ce, *tmp;
	int i = 0, len = 0;
................................................................................
			ce->string[blacklistlen - 1] = '\0';
		}
#endif

		i++;

		switch (type) {
			case 1:
				if (conf.blacklistbl == NULL) {
					conf.blacklistbl = ce;
					continue;
				} else {
					tmp = conf.blacklistbl;
				}
				break;
			case 2:
				if (conf.whitelistbl == NULL) {
					conf.whitelistbl = ce;
					continue;
				} else {
					tmp = conf.whitelistbl;
				}
			case 3:
				fprintf(stderr, "got %s for blacklist\n", ce->string);
				if (parse_cidr(ce) == -1) {
					fprintf(stderr, "Error parsing CIDR in %s, ignoring\n", ce->string);
					free(ce->string);
					free(ce);
					continue;
				}
................................................................................
				if (conf.blacklist == NULL) {
					conf.blacklist = ce;
					continue;
				} else {
					tmp = conf.blacklist;
				}
				break;
			case 4:
				if (parse_cidr(ce) == -1) {
					fprintf(stderr, "Error parsing CIDR in %s, ignoring\n", ce->string);
					free(ce->string);
					free(ce);
					continue;
				}
				if (conf.whitelist == NULL) {







>







 







|



|



|



|







 







|







|






|







 







|







462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
...
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
...
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
	 * Header length is usually 20, or 5 32-bit words */
	ip_header_length = payload[0] & 0x0F;
	header_size = ip_header_length * 4;

	/* We're not handling IPV6 packets yet.  I'll probably rewrite
	 * this whole damned thing in C++ first. */
	if (version != 4) {
		DEBUG(2, "IPV6 packet received and ignored.");
		return -1;
	}

	/* IP Address			Bytes 13 - 16 of IP header */
	ip->b1 = payload[12];
	ip->b2 = payload[13];
	ip->b3 = payload[14];
................................................................................
	if (conf.queueno < 0) {
		conf.queueno = 1;
		fprintf(stderr, "queueno negative - using default");
	}

	config_setting = config_lookup(config, "blacklistbl");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, TYPE_BLACKLISTBL);
	}
	config_setting = config_lookup(config, "whitelistbl");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, TYPE_WHITELISTBL);
	}
	config_setting = config_lookup(config, "blacklist");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, TYPE_BLACKLIST);
	}
	config_setting = config_lookup(config, "whitelist");
	if (config_setting != NULL) {
		parse_config_bl_list(config_setting, TYPE_WHITELIST);
	}
}

parse_config_bl_list(config_setting_t *c, int type) {

	struct config_entry *ce, *tmp;
	int i = 0, len = 0;
................................................................................
			ce->string[blacklistlen - 1] = '\0';
		}
#endif

		i++;

		switch (type) {
			case TYPE_BLACKLISTBL:
				if (conf.blacklistbl == NULL) {
					conf.blacklistbl = ce;
					continue;
				} else {
					tmp = conf.blacklistbl;
				}
				break;
			case TYPE_WHITELISTBL:
				if (conf.whitelistbl == NULL) {
					conf.whitelistbl = ce;
					continue;
				} else {
					tmp = conf.whitelistbl;
				}
			case TYPE_BLACKLIST:
				fprintf(stderr, "got %s for blacklist\n", ce->string);
				if (parse_cidr(ce) == -1) {
					fprintf(stderr, "Error parsing CIDR in %s, ignoring\n", ce->string);
					free(ce->string);
					free(ce);
					continue;
				}
................................................................................
				if (conf.blacklist == NULL) {
					conf.blacklist = ce;
					continue;
				} else {
					tmp = conf.blacklist;
				}
				break;
			case TYPE_WHITELIST:
				if (parse_cidr(ce) == -1) {
					fprintf(stderr, "Error parsing CIDR in %s, ignoring\n", ce->string);
					free(ce->string);
					free(ce);
					continue;
				}
				if (conf.whitelist == NULL) {

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

192
193
194
195
196
197
198






199
	{"local4", LOG_LOCAL4},
	{"local5", LOG_LOCAL5},
	{"local6", LOG_LOCAL6},
	{"local7", LOG_LOCAL7},
	NULL
};







#endif







>
>
>
>
>
>

192
193
194
195
196
197
198
199
200
201
202
203
204
205
	{"local4", LOG_LOCAL4},
	{"local5", LOG_LOCAL5},
	{"local6", LOG_LOCAL6},
	{"local7", LOG_LOCAL7},
	NULL
};

enum type {
	TYPE_BLACKLISTBL,
	TYPE_WHITELISTBL,
	TYPE_BLACKLIST,
	TYPE_WHITELIST
};
#endif