Diff

Differences From Artifact [047b0a35f3]:

To Artifact [dfedb0856e]:


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# define PBL_COPY_PACKET NFQNL_COPY_PACKET
# define PBL_ID_T u_int32_t
# define PBL_ERRSTR ""

#define DEBUG(x, y) if (conf.debug >= x) { printf(y "\n"); }
struct packet_info {

	int b1;
	int b2;
	int b3;
	int b4;

	int s_port;
	int d_port;

	int flags;
};








|
|
|
|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# define PBL_COPY_PACKET NFQNL_COPY_PACKET
# define PBL_ID_T u_int32_t
# define PBL_ERRSTR ""

#define DEBUG(x, y) if (conf.debug >= x) { printf(y "\n"); }
struct packet_info {

	unsigned short int b1;
	unsigned short int b2;
	unsigned short int b3;
	unsigned short int b4;

	int s_port;
	int d_port;

	int flags;
};

1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318

	wltmp = list;

	while (1) {

		char lookupbuf[BUFFERSIZE];
	
		snprintf(lookupbuf, sizeof(lookupbuf), "%d.%d.%d.%d.%s", ip->b4, ip->b3, ip->b2, ip->b1,
			wltmp->string);

#ifndef HAVE_FIREDNS
		host = gethostbyname(lookupbuf);
#else
		host = firedns_resolveip4(lookupbuf);
#endif







|







1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318

	wltmp = list;

	while (1) {

		char lookupbuf[BUFFERSIZE];
	
		snprintf(lookupbuf, sizeof(lookupbuf), "%hhu.%hhu.%hhu.%hhu.%s", ip->b4, ip->b3, ip->b2, ip->b1,
			wltmp->string);

#ifndef HAVE_FIREDNS
		host = gethostbyname(lookupbuf);
#else
		host = firedns_resolveip4(lookupbuf);
#endif
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
	while (1) {
		uint32_t p = 0;

		p = ip_proc;
		p &= wltmp->cidr.processed;

		if (p == wltmp->cidr.ip) {
			snprintf(msgbuf, sizeof(msgbuf), "%d.%d.%d.%d %x/%d",
				ip->b1, ip->b2, ip->b3, ip->b4,
				wltmp->cidr.ip, wltmp->cidr.network);
			return 1;
		}

		if (wltmp->next == NULL) {
			break;







|







1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
	while (1) {
		uint32_t p = 0;

		p = ip_proc;
		p &= wltmp->cidr.processed;

		if (p == wltmp->cidr.ip) {
			snprintf(msgbuf, sizeof(msgbuf), "%hhu.%hhu.%hhu.%hhu %x/%d",
				ip->b1, ip->b2, ip->b3, ip->b4,
				wltmp->cidr.ip, wltmp->cidr.network);
			return 1;
		}

		if (wltmp->next == NULL) {
			break;
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
static void get_ip_string(const struct packet_info *ip) {

	if (ip == NULL) {
		sprintf(msgbuf, "-");
		return;
	}

	snprintf(msgbuf, sizeof(msgbuf), "%d.%d.%d.%d:%d.%d", ip->b1, 
		ip->b2, ip->b3, ip->b4,
		ip->s_port,ip->d_port);
	return;
}

#ifdef USE_SOCKSTAT
/*







|







1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
static void get_ip_string(const struct packet_info *ip) {

	if (ip == NULL) {
		sprintf(msgbuf, "-");
		return;
	}

	snprintf(msgbuf, sizeof(msgbuf), "%hhu.%hhu.%hhu.%hhu:%d.%d", ip->b1, 
		ip->b2, ip->b3, ip->b4,
		ip->s_port,ip->d_port);
	return;
}

#ifdef USE_SOCKSTAT
/*