Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25ed8910 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: Nicer names for ipt_connbytes constants

parent 8ffde671
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -2,9 +2,9 @@
#define _IPT_CONNBYTES_H
#define _IPT_CONNBYTES_H


enum ipt_connbytes_what {
enum ipt_connbytes_what {
	IPT_CONNBYTES_WHAT_PKTS,
	IPT_CONNBYTES_PKTS,
	IPT_CONNBYTES_WHAT_BYTES,
	IPT_CONNBYTES_BYTES,
	IPT_CONNBYTES_WHAT_AVGPKT,
	IPT_CONNBYTES_AVGPKT,
};
};


enum ipt_connbytes_direction {
enum ipt_connbytes_direction {
+6 −6
Original line number Original line Diff line number Diff line
@@ -54,7 +54,7 @@ match(const struct sk_buff *skb,
		return 0; /* no match */
		return 0; /* no match */


	switch (sinfo->what) {
	switch (sinfo->what) {
	case IPT_CONNBYTES_WHAT_PKTS:
	case IPT_CONNBYTES_PKTS:
		switch (sinfo->direction) {
		switch (sinfo->direction) {
		case IPT_CONNBYTES_DIR_ORIGINAL:
		case IPT_CONNBYTES_DIR_ORIGINAL:
			what = ct->counters[IP_CT_DIR_ORIGINAL].packets;
			what = ct->counters[IP_CT_DIR_ORIGINAL].packets;
@@ -68,7 +68,7 @@ match(const struct sk_buff *skb,
			break;
			break;
		}
		}
		break;
		break;
	case IPT_CONNBYTES_WHAT_BYTES:
	case IPT_CONNBYTES_BYTES:
		switch (sinfo->direction) {
		switch (sinfo->direction) {
		case IPT_CONNBYTES_DIR_ORIGINAL:
		case IPT_CONNBYTES_DIR_ORIGINAL:
			what = ct->counters[IP_CT_DIR_ORIGINAL].bytes;
			what = ct->counters[IP_CT_DIR_ORIGINAL].bytes;
@@ -82,7 +82,7 @@ match(const struct sk_buff *skb,
			break;
			break;
		}
		}
		break;
		break;
	case IPT_CONNBYTES_WHAT_AVGPKT:
	case IPT_CONNBYTES_AVGPKT:
		switch (sinfo->direction) {
		switch (sinfo->direction) {
		case IPT_CONNBYTES_DIR_ORIGINAL:
		case IPT_CONNBYTES_DIR_ORIGINAL:
			what = div64_64(ct->counters[IP_CT_DIR_ORIGINAL].bytes,
			what = div64_64(ct->counters[IP_CT_DIR_ORIGINAL].bytes,
@@ -128,9 +128,9 @@ static int check(const char *tablename,
	if (matchsize != IPT_ALIGN(sizeof(struct ipt_connbytes_info)))
	if (matchsize != IPT_ALIGN(sizeof(struct ipt_connbytes_info)))
		return 0;
		return 0;


	if (sinfo->what != IPT_CONNBYTES_WHAT_PKTS &&
	if (sinfo->what != IPT_CONNBYTES_PKTS &&
	    sinfo->what != IPT_CONNBYTES_WHAT_BYTES &&
	    sinfo->what != IPT_CONNBYTES_BYTES &&
	    sinfo->what != IPT_CONNBYTES_WHAT_AVGPKT)
	    sinfo->what != IPT_CONNBYTES_AVGPKT)
		return 0;
		return 0;


	if (sinfo->direction != IPT_CONNBYTES_DIR_ORIGINAL &&
	if (sinfo->direction != IPT_CONNBYTES_DIR_ORIGINAL &&