mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 20:55:13 +02:00
ipset: update to 4.2
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
HEAD
|
||||
====
|
||||
- ipset: update to 4.2
|
||||
|
||||
|
||||
Xtables-addons 1.22 (January 22 2009)
|
||||
|
@@ -185,7 +185,6 @@ ipportnethash_add(struct ip_set *set,
|
||||
if (ret == 0) {
|
||||
if (!map->nets[cidr-1]++)
|
||||
add_cidr_size(map->cidr, cidr);
|
||||
map->elements++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@@ -136,7 +136,6 @@ nethash_add(struct ip_set *set, ip_set_ip_t ip, uint8_t cidr)
|
||||
if (ret == 0) {
|
||||
if (!map->nets[cidr-1]++)
|
||||
add_cidr_size(map->cidr, cidr);
|
||||
map->elements++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
|
||||
#endif
|
||||
|
||||
#define IPSET_VERSION "4.1"
|
||||
#define IPSET_VERSION "4.2"
|
||||
|
||||
char program_name[] = "ipset";
|
||||
char program_version[] = IPSET_VERSION;
|
||||
|
@@ -200,8 +200,7 @@ iphash_printips(struct set *set UNUSED, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ip = data + offset;
|
||||
if (*ip)
|
||||
printf("%s\n", ip_tostring(*ip, options));
|
||||
printf("%s\n", ip_tostring(*ip, options));
|
||||
offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
|
||||
}
|
||||
}
|
||||
@@ -230,9 +229,7 @@ iphash_saveips(struct set *set UNUSED, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ip = data + offset;
|
||||
if (*ip)
|
||||
printf("-A %s %s\n", set->name,
|
||||
ip_tostring(*ip, options));
|
||||
printf("-A %s %s\n", set->name, ip_tostring(*ip, options));
|
||||
offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
|
||||
}
|
||||
}
|
||||
|
@@ -259,13 +259,11 @@ ipporthash_printips(struct set *set, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ipptr = data + offset;
|
||||
if (*ipptr) {
|
||||
ip = (*ipptr>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) *ipptr;
|
||||
printf("%s,%s\n",
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
}
|
||||
ip = (*ipptr>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) *ipptr;
|
||||
printf("%s,%s\n",
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
|
||||
}
|
||||
}
|
||||
@@ -296,13 +294,11 @@ ipporthash_saveips(struct set *set, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ipptr = data + offset;
|
||||
if (*ipptr) {
|
||||
ip = (*ipptr>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) *ipptr;
|
||||
printf("-A %s %s,%s\n", set->name,
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
}
|
||||
ip = (*ipptr>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) *ipptr;
|
||||
printf("-A %s %s,%s\n", set->name,
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
|
||||
}
|
||||
}
|
||||
|
@@ -265,15 +265,13 @@ ipportiphash_printips(struct set *set, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ipptr = data + offset;
|
||||
if (ipptr->ip && ipptr->ip1) {
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("%s,%s,",
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
ip_tostring(ipptr->ip1, options));
|
||||
}
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("%s,%s,",
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
ip_tostring(ipptr->ip1, options));
|
||||
offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
|
||||
}
|
||||
}
|
||||
@@ -305,15 +303,13 @@ ipportiphash_saveips(struct set *set, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ipptr = data + offset;
|
||||
if (ipptr->ip && ipptr->ip1) {
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("-A %s %s,%s,", set->name,
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
ip_tostring(ipptr->ip1, options));
|
||||
}
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("-A %s %s,%s,", set->name,
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
ip_tostring(ipptr->ip1, options));
|
||||
offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
|
||||
}
|
||||
}
|
||||
|
@@ -330,15 +330,13 @@ ipportnethash_printips(struct set *set, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ipptr = data + offset;
|
||||
if (ipptr->ip || ipptr->ip1) {
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("%s,%s,",
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
unpack_ip_tostring(ipptr->ip1, options));
|
||||
}
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("%s,%s,",
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
unpack_ip_tostring(ipptr->ip1, options));
|
||||
offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
|
||||
}
|
||||
}
|
||||
@@ -370,15 +368,13 @@ ipportnethash_saveips(struct set *set, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ipptr = data + offset;
|
||||
if (ipptr) {
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("-A %s %s,%s,", set->name,
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
unpack_ip_tostring(ipptr->ip, options));
|
||||
}
|
||||
ip = (ipptr->ip>>16) + mysetdata->first_ip;
|
||||
port = (uint16_t) ipptr->ip;
|
||||
printf("-A %s %s,%s,", set->name,
|
||||
ip_tostring(ip, options),
|
||||
port_tostring(port, options));
|
||||
printf("%s\n",
|
||||
unpack_ip_tostring(ipptr->ip, options));
|
||||
offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
|
||||
}
|
||||
}
|
||||
|
@@ -232,8 +232,7 @@ nethash_printips(struct set *set UNUSED, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ip = data + offset;
|
||||
if (*ip)
|
||||
printf("%s\n", unpack_ip_tostring(*ip, options));
|
||||
printf("%s\n", unpack_ip_tostring(*ip, options));
|
||||
offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
|
||||
}
|
||||
}
|
||||
@@ -258,9 +257,8 @@ nethash_saveips(struct set *set UNUSED, void *data, u_int32_t len,
|
||||
|
||||
while (offset < len) {
|
||||
ip = data + offset;
|
||||
if (*ip)
|
||||
printf("-A %s %s\n", set->name,
|
||||
unpack_ip_tostring(*ip, options));
|
||||
printf("-A %s %s\n", set->name,
|
||||
unpack_ip_tostring(*ip, options));
|
||||
offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user