Skip to content
Snippets Groups Projects
Commit d2fff93c authored by Rich Fought's avatar Rich Fought
Browse files

Source cleanup for upstream

parent 2d707513
Branches
No related merge requests found
......@@ -780,47 +780,47 @@ struct nfnl_ct {
};
union nfnl_exp_protodata {
struct {
uint16_t src;
uint16_t dst;
} port;
struct {
uint16_t id;
uint8_t type;
uint8_t code;
} icmp;
struct {
uint16_t src;
uint16_t dst;
} port;
struct {
uint16_t id;
uint8_t type;
uint8_t code;
} icmp;
};
// Allow for different master/expect l4 protocols
struct nfnl_exp_proto
{
uint8_t l4protonum;
union nfnl_exp_protodata l4protodata;
uint8_t l4protonum;
union nfnl_exp_protodata l4protodata;
};
struct nfnl_exp_dir {
struct nl_addr * src;
struct nl_addr * dst;
struct nfnl_exp_proto proto;
struct nl_addr * src;
struct nl_addr * dst;
struct nfnl_exp_proto proto;
};
struct nfnl_exp {
NLHDR_COMMON
uint8_t exp_family; // IPv4, IPv6, etc - required
uint32_t exp_timeout; // required afaik
uint32_t exp_id; // optional
uint16_t exp_zone; // optional
uint32_t exp_class; // optional
uint32_t exp_flags; // optional
char * exp_helper_name; //optional
char * exp_fn; //optional
uint8_t exp_nat_dir; // optional
struct nfnl_exp_dir exp_expect; // required
struct nfnl_exp_dir exp_master; // required
struct nfnl_exp_dir exp_mask; // required
struct nfnl_exp_dir exp_nat; // optional
NLHDR_COMMON
uint8_t exp_family;
uint32_t exp_timeout;
uint32_t exp_id;
uint16_t exp_zone;
uint32_t exp_class;
uint32_t exp_flags;
char * exp_helper_name;
char * exp_fn;
uint8_t exp_nat_dir;
struct nfnl_exp_dir exp_expect;
struct nfnl_exp_dir exp_master;
struct nfnl_exp_dir exp_mask;
struct nfnl_exp_dir exp_nat;
};
struct nfnl_log {
......
......@@ -29,11 +29,11 @@ extern "C" {
struct nfnl_exp;
enum nfnl_exp_tuples {
NFNL_EXP_TUPLE_EXPECT,
NFNL_EXP_TUPLE_MASTER,
NFNL_EXP_TUPLE_MASK,
NFNL_EXP_TUPLE_NAT,
NFNL_EXP_TUPLE_MAX
NFNL_EXP_TUPLE_EXPECT,
NFNL_EXP_TUPLE_MASTER,
NFNL_EXP_TUPLE_MASK,
NFNL_EXP_TUPLE_NAT,
NFNL_EXP_TUPLE_MAX
};
extern struct nl_object_ops exp_obj_ops;
......@@ -50,15 +50,15 @@ extern void nfnl_exp_put(struct nfnl_exp *);
extern int nfnl_exp_dump_request(struct nl_sock *);
extern int nfnl_exp_build_add_request(const struct nfnl_exp *, int,
struct nl_msg **);
struct nl_msg **);
extern int nfnl_exp_add(struct nl_sock *, const struct nfnl_exp *, int);
extern int nfnl_exp_build_delete_request(const struct nfnl_exp *, int,
struct nl_msg **);
struct nl_msg **);
extern int nfnl_exp_del(struct nl_sock *, const struct nfnl_exp *, int);
extern int nfnl_exp_build_query_request(const struct nfnl_exp *, int,
struct nl_msg **);
struct nl_msg **);
extern int nfnl_exp_query(struct nl_sock *, const struct nfnl_exp *, int);
extern void nfnl_exp_set_family(struct nfnl_exp *, uint8_t);
......@@ -122,7 +122,6 @@ extern uint16_t nfnl_exp_get_icmp_id(const struct nfnl_exp *, int);
extern uint8_t nfnl_exp_get_icmp_type(const struct nfnl_exp *, int);
extern uint8_t nfnl_exp_get_icmp_code(const struct nfnl_exp *, int);
#ifdef __cplusplus
}
#endif
......
......@@ -32,17 +32,17 @@
static struct nl_cache_ops nfnl_exp_ops;
static struct nla_policy exp_policy[CTA_EXPECT_MAX+1] = {
[CTA_EXPECT_MASTER] = { .type = NLA_NESTED },
[CTA_EXPECT_TUPLE] = { .type = NLA_NESTED },
[CTA_EXPECT_MASK] = { .type = NLA_NESTED },
[CTA_EXPECT_TIMEOUT] = { .type = NLA_U32 },
[CTA_EXPECT_ID] = { .type = NLA_U32 },
[CTA_EXPECT_HELP_NAME] = { .type = NLA_STRING },
[CTA_EXPECT_ZONE] = { .type = NLA_U16 }, // Added in kernel 2.6.34
[CTA_EXPECT_FLAGS] = { .type = NLA_U32 }, // Added in kernel 2.6.37
[CTA_EXPECT_CLASS] = { .type = NLA_U32 }, // Added in kernel 3.5
[CTA_EXPECT_NAT] = { .type = NLA_NESTED }, // Added in kernel 3.5
[CTA_EXPECT_FN] = { .type = NLA_STRING }, // Added in kernel 3.5
[CTA_EXPECT_MASTER] = { .type = NLA_NESTED },
[CTA_EXPECT_TUPLE] = { .type = NLA_NESTED },
[CTA_EXPECT_MASK] = { .type = NLA_NESTED },
[CTA_EXPECT_TIMEOUT] = { .type = NLA_U32 },
[CTA_EXPECT_ID] = { .type = NLA_U32 },
[CTA_EXPECT_HELP_NAME] = { .type = NLA_STRING },
[CTA_EXPECT_ZONE] = { .type = NLA_U16 },
[CTA_EXPECT_FLAGS] = { .type = NLA_U32 }, // Added in kernel 2.6.37
[CTA_EXPECT_CLASS] = { .type = NLA_U32 }, // Added in kernel 3.5
[CTA_EXPECT_NAT] = { .type = NLA_NESTED }, // Added in kernel 3.5
[CTA_EXPECT_FN] = { .type = NLA_STRING }, // Added in kernel 3.5
};
static struct nla_policy exp_tuple_policy[CTA_TUPLE_MAX+1] = {
......@@ -58,10 +58,10 @@ static struct nla_policy exp_ip_policy[CTA_IP_MAX+1] = {
};
static struct nla_policy exp_proto_policy[CTA_PROTO_MAX+1] = {
[CTA_PROTO_NUM] = { .type = NLA_U8 },
[CTA_PROTO_NUM] = { .type = NLA_U8 },
[CTA_PROTO_SRC_PORT] = { .type = NLA_U16 },
[CTA_PROTO_DST_PORT] = { .type = NLA_U16 },
[CTA_PROTO_ICMP_ID] = { .type = NLA_U16 },
[CTA_PROTO_ICMP_ID] = { .type = NLA_U16 },
[CTA_PROTO_ICMP_TYPE] = { .type = NLA_U8 },
[CTA_PROTO_ICMP_CODE] = { .type = NLA_U8 },
[CTA_PROTO_ICMPV6_ID] = { .type = NLA_U16 },
......@@ -70,8 +70,8 @@ static struct nla_policy exp_proto_policy[CTA_PROTO_MAX+1] = {
};
static struct nla_policy exp_nat_policy[CTA_EXPECT_NAT_MAX+1] = {
[CTA_EXPECT_NAT_DIR] = { .type = NLA_U8 },
[CTA_EXPECT_NAT_TUPLE] = { .type = NLA_NESTED },
[CTA_EXPECT_NAT_DIR] = { .type = NLA_U8 },
[CTA_EXPECT_NAT_TUPLE] = { .type = NLA_NESTED },
};
static int exp_parse_ip(struct nfnl_exp *exp, int tuple, struct nlattr *attr)
......@@ -80,7 +80,7 @@ static int exp_parse_ip(struct nfnl_exp *exp, int tuple, struct nlattr *attr)
struct nl_addr *addr;
int err;
err = nla_parse_nested(tb, CTA_IP_MAX, attr, exp_ip_policy);
err = nla_parse_nested(tb, CTA_IP_MAX, attr, exp_ip_policy);
if (err < 0)
goto errout;
......@@ -144,20 +144,20 @@ static int exp_parse_proto(struct nfnl_exp *exp, int tuple, struct nlattr *attr)
nfnl_exp_set_l4protonum(exp, tuple, nla_get_u8(tb[CTA_PROTO_NUM]));
if (tb[CTA_PROTO_SRC_PORT])
srcport = ntohs(nla_get_u16(tb[CTA_PROTO_SRC_PORT]));
srcport = ntohs(nla_get_u16(tb[CTA_PROTO_SRC_PORT]));
if (tb[CTA_PROTO_DST_PORT])
dstport = ntohs(nla_get_u16(tb[CTA_PROTO_DST_PORT]));
dstport = ntohs(nla_get_u16(tb[CTA_PROTO_DST_PORT]));
if (tb[CTA_PROTO_SRC_PORT] || tb[CTA_PROTO_DST_PORT])
nfnl_exp_set_ports(exp, tuple, srcport, dstport);
nfnl_exp_set_ports(exp, tuple, srcport, dstport);
if (tb[CTA_PROTO_ICMP_ID])
icmpid = ntohs(nla_get_u16(tb[CTA_PROTO_ICMP_ID]));
icmpid = ntohs(nla_get_u16(tb[CTA_PROTO_ICMP_ID]));
if (tb[CTA_PROTO_ICMP_TYPE])
icmptype = nla_get_u8(tb[CTA_PROTO_ICMP_TYPE]);
if (tb[CTA_PROTO_ICMP_CODE])
icmpcode = nla_get_u8(tb[CTA_PROTO_ICMP_CODE]);
if (tb[CTA_PROTO_ICMP_ID] || tb[CTA_PROTO_ICMP_TYPE] || tb[CTA_PROTO_ICMP_CODE])
nfnl_exp_set_icmp(exp, tuple, icmpid, icmptype, icmpcode);
nfnl_exp_set_icmp(exp, tuple, icmpid, icmptype, icmpcode);
return 0;
}
......@@ -187,23 +187,23 @@ static int exp_parse_tuple(struct nfnl_exp *exp, int tuple, struct nlattr *attr)
static int exp_parse_nat(struct nfnl_exp *exp, struct nlattr *attr)
{
struct nlattr *tb[CTA_EXPECT_NAT_MAX+1];
int err;
struct nlattr *tb[CTA_EXPECT_NAT_MAX+1];
int err;
err = nla_parse_nested(tb, CTA_EXPECT_NAT_MAX, attr, exp_nat_policy);
if (err < 0)
return err;
err = nla_parse_nested(tb, CTA_EXPECT_NAT_MAX, attr, exp_nat_policy);
if (err < 0)
return err;
if (tb[CTA_EXPECT_NAT_DIR])
nfnl_exp_set_nat_dir(exp, nla_get_u8(tb[CTA_EXPECT_NAT_DIR]));
if (tb[CTA_EXPECT_NAT_DIR])
nfnl_exp_set_nat_dir(exp, nla_get_u8(tb[CTA_EXPECT_NAT_DIR]));
if (tb[CTA_EXPECT_NAT_TUPLE]) {
err = exp_parse_tuple(exp, NFNL_EXP_TUPLE_NAT, tb[CTA_EXPECT_NAT_TUPLE]);
if (err < 0)
return err;
}
if (tb[CTA_EXPECT_NAT_TUPLE]) {
err = exp_parse_tuple(exp, NFNL_EXP_TUPLE_NAT, tb[CTA_EXPECT_NAT_TUPLE]);
if (err < 0)
return err;
}
return 0;
return 0;
}
int nfnlmsg_exp_group(struct nlmsghdr *nlh)
......@@ -241,10 +241,10 @@ int nfnlmsg_exp_parse(struct nlmsghdr *nlh, struct nfnl_exp **result)
nfnl_exp_set_family(exp, nfnlmsg_family(nlh));
if (tb[CTA_EXPECT_TUPLE]) {
err = exp_parse_tuple(exp, NFNL_EXP_TUPLE_EXPECT, tb[CTA_EXPECT_TUPLE]);
if (err < 0)
goto errout;
}
err = exp_parse_tuple(exp, NFNL_EXP_TUPLE_EXPECT, tb[CTA_EXPECT_TUPLE]);
if (err < 0)
goto errout;
}
if (tb[CTA_EXPECT_MASTER]) {
err = exp_parse_tuple(exp, NFNL_EXP_TUPLE_MASTER, tb[CTA_EXPECT_MASTER]);
if (err < 0)
......@@ -256,18 +256,17 @@ int nfnlmsg_exp_parse(struct nlmsghdr *nlh, struct nfnl_exp **result)
goto errout;
}
if (tb[CTA_EXPECT_NAT])
err = exp_parse_nat(exp, tb[CTA_EXPECT_MASK]);
if (err < 0)
goto errout;
if (tb[CTA_EXPECT_CLASS])
nfnl_exp_set_class(exp, ntohl(nla_get_u32(tb[CTA_EXPECT_CLASS])));
if (tb[CTA_EXPECT_FN])
nfnl_exp_set_fn(exp, nla_data(tb[CTA_EXPECT_FN]));
if (tb[CTA_EXPECT_NAT]) {
err = exp_parse_nat(exp, tb[CTA_EXPECT_MASK]);
if (err < 0)
goto errout;
}
if (tb[CTA_EXPECT_CLASS])
nfnl_exp_set_class(exp, ntohl(nla_get_u32(tb[CTA_EXPECT_CLASS])));
if (tb[CTA_EXPECT_FN])
nfnl_exp_set_fn(exp, nla_data(tb[CTA_EXPECT_FN]));
if (tb[CTA_EXPECT_TIMEOUT])
nfnl_exp_set_timeout(exp, ntohl(nla_get_u32(tb[CTA_EXPECT_TIMEOUT])));
......@@ -276,13 +275,13 @@ int nfnlmsg_exp_parse(struct nlmsghdr *nlh, struct nfnl_exp **result)
nfnl_exp_set_id(exp, ntohl(nla_get_u32(tb[CTA_EXPECT_ID])));
if (tb[CTA_EXPECT_HELP_NAME])
nfnl_exp_set_helper_name(exp, nla_data(tb[CTA_EXPECT_HELP_NAME]));
nfnl_exp_set_helper_name(exp, nla_data(tb[CTA_EXPECT_HELP_NAME]));
if (tb[CTA_EXPECT_ZONE])
nfnl_exp_set_zone(exp, ntohs(nla_get_u16(tb[CTA_EXPECT_ZONE])));
if (tb[CTA_EXPECT_ZONE])
nfnl_exp_set_zone(exp, ntohs(nla_get_u16(tb[CTA_EXPECT_ZONE])));
if (tb[CTA_EXPECT_FLAGS])
nfnl_exp_set_flags(exp, ntohl(nla_get_u32(tb[CTA_EXPECT_FLAGS])));
if (tb[CTA_EXPECT_FLAGS])
nfnl_exp_set_flags(exp, ntohl(nla_get_u32(tb[CTA_EXPECT_FLAGS])));
*result = exp;
return 0;
......@@ -320,25 +319,25 @@ static int exp_request_update(struct nl_cache *cache, struct nl_sock *sk)
static int exp_get_tuple_attr(int tuple)
{
int attr = 0;
switch (tuple) {
case CTA_EXPECT_MASTER:
attr = NFNL_EXP_TUPLE_MASTER;
break;
case CTA_EXPECT_MASK:
attr = NFNL_EXP_TUPLE_MASK;
break;
//case CTA_EXPECT_NAT:
// attr = NFNL_EXP_TUPLE_NAT;
// break;
case CTA_EXPECT_TUPLE:
default :
attr = NFNL_EXP_TUPLE_EXPECT;
break;
}
return attr;
int attr = 0;
switch (tuple) {
case CTA_EXPECT_MASTER:
attr = NFNL_EXP_TUPLE_MASTER;
break;
case CTA_EXPECT_MASK:
attr = NFNL_EXP_TUPLE_MASK;
break;
case CTA_EXPECT_NAT:
attr = NFNL_EXP_TUPLE_NAT;
break;
case CTA_EXPECT_TUPLE:
default :
attr = NFNL_EXP_TUPLE_EXPECT;
break;
}
return attr;
}
static int nfnl_exp_build_tuple(struct nl_msg *msg, const struct nfnl_exp *exp,
......@@ -411,24 +410,24 @@ nla_put_failure:
static int nfnl_exp_build_nat(struct nl_msg *msg, const struct nfnl_exp *exp)
{
struct nlattr *nat;
int err;
struct nlattr *nat;
int err;
nat = nla_nest_start(msg, CTA_EXPECT_NAT);
nat = nla_nest_start(msg, CTA_EXPECT_NAT);
if (nfnl_exp_test_nat_dir(exp)) {
NLA_PUT_U8(msg, CTA_EXPECT_NAT_DIR,
nfnl_exp_get_nat_dir(exp));
}
if (nfnl_exp_test_nat_dir(exp)) {
NLA_PUT_U8(msg, CTA_EXPECT_NAT_DIR,
nfnl_exp_get_nat_dir(exp));
}
if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_NAT_TUPLE)) < 0)
goto nla_put_failure;
if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_NAT_TUPLE)) < 0)
goto nla_put_failure;
nla_nest_end(msg, nat);
return 0;
nla_nest_end(msg, nat);
return 0;
nla_put_failure:
return -NLE_MSGSIZE;
return -NLE_MSGSIZE;
}
static int nfnl_exp_build_message(const struct nfnl_exp *exp, int cmd, int flags,
......@@ -445,38 +444,37 @@ static int nfnl_exp_build_message(const struct nfnl_exp *exp, int cmd, int flags
if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_TUPLE)) < 0)
goto err_out;
if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_MASTER)) < 0)
goto err_out;
if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_MASK)) < 0)
goto err_out;
if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_MASTER)) < 0)
goto err_out;
if (nfnl_exp_test_src(exp, NFNL_EXP_TUPLE_NAT)) {
if ((err = nfnl_exp_build_nat(msg, exp)) < 0)
goto err_out;
}
if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_MASK)) < 0)
goto err_out;
if (nfnl_exp_test_class(exp))
NLA_PUT_U32(msg, CTA_EXPECT_CLASS, htonl(nfnl_exp_get_class(exp)));
if (nfnl_exp_test_src(exp, NFNL_EXP_TUPLE_NAT)) {
if ((err = nfnl_exp_build_nat(msg, exp)) < 0)
goto err_out;
}
if (nfnl_exp_test_fn(exp))
NLA_PUT_STRING(msg, CTA_EXPECT_FN, nfnl_exp_get_fn(exp));
if (nfnl_exp_test_class(exp))
NLA_PUT_U32(msg, CTA_EXPECT_CLASS, htonl(nfnl_exp_get_class(exp)));
if (nfnl_exp_test_fn(exp))
NLA_PUT_STRING(msg, CTA_EXPECT_FN, nfnl_exp_get_fn(exp));
if (nfnl_exp_test_id(exp))
NLA_PUT_U32(msg, CTA_EXPECT_ID, htonl(nfnl_exp_get_id(exp)));
if (nfnl_exp_test_id(exp))
NLA_PUT_U32(msg, CTA_EXPECT_ID, htonl(nfnl_exp_get_id(exp)));
if (nfnl_exp_test_timeout(exp))
NLA_PUT_U32(msg, CTA_EXPECT_TIMEOUT, htonl(nfnl_exp_get_timeout(exp)));
if (nfnl_exp_test_timeout(exp))
NLA_PUT_U32(msg, CTA_EXPECT_TIMEOUT, htonl(nfnl_exp_get_timeout(exp)));
if (nfnl_exp_test_helper_name(exp))
NLA_PUT_STRING(msg, CTA_EXPECT_HELP_NAME, nfnl_exp_get_helper_name(exp));
if (nfnl_exp_test_helper_name(exp))
NLA_PUT_STRING(msg, CTA_EXPECT_HELP_NAME, nfnl_exp_get_helper_name(exp));
if (nfnl_exp_test_zone(exp))
NLA_PUT_U16(msg, CTA_EXPECT_ZONE, htons(nfnl_exp_get_zone(exp)));
if (nfnl_exp_test_zone(exp))
NLA_PUT_U16(msg, CTA_EXPECT_ZONE, htons(nfnl_exp_get_zone(exp)));
if (nfnl_exp_test_flags(exp))
NLA_PUT_U32(msg, CTA_EXPECT_FLAGS, htonl(nfnl_exp_get_flags(exp)));
if (nfnl_exp_test_flags(exp))
NLA_PUT_U32(msg, CTA_EXPECT_FLAGS, htonl(nfnl_exp_get_flags(exp)));
*result = msg;
return 0;
......@@ -600,10 +598,10 @@ static struct nl_cache_ops nfnl_exp_ops = {
END_OF_MSGTYPES_LIST,
},
.co_protocol = NETLINK_NETFILTER,
.co_groups = exp_groups,
.co_groups = exp_groups,
.co_request_update = exp_request_update,
.co_msg_parser = exp_msg_parser,
.co_obj_ops = &exp_obj_ops,
.co_obj_ops = &exp_obj_ops,
};
static void __init exp_init(void)
......
This diff is collapsed.
......@@ -62,36 +62,36 @@ void nl_cli_exp_parse_id(struct nfnl_exp *exp, char *arg)
void nl_cli_exp_parse_helper_name(struct nfnl_exp *exp, char *arg)
{
nfnl_exp_set_helper_name(exp, arg);
nfnl_exp_set_helper_name(exp, arg);
}
void nl_cli_exp_parse_zone(struct nfnl_exp *exp, char *arg)
{
uint32_t zone = nl_cli_parse_u32(arg);
nfnl_exp_set_zone(exp, zone);
uint32_t zone = nl_cli_parse_u32(arg);
nfnl_exp_set_zone(exp, zone);
}
void nl_cli_exp_parse_flags(struct nfnl_exp *exp, char *arg)
{
uint32_t flags = nl_cli_parse_u32(arg);
nfnl_exp_set_flags(exp, flags);
uint32_t flags = nl_cli_parse_u32(arg);
nfnl_exp_set_flags(exp, flags);
}
void nl_cli_exp_parse_class(struct nfnl_exp *exp, char *arg)
{
uint32_t class = nl_cli_parse_u32(arg);
nfnl_exp_set_class(exp, class);
uint32_t class = nl_cli_parse_u32(arg);
nfnl_exp_set_class(exp, class);
}
void nl_cli_exp_parse_nat_dir(struct nfnl_exp *exp, char *arg)
{
uint32_t nat_dir = nl_cli_parse_u32(arg);
nfnl_exp_set_nat_dir(exp, nat_dir);
uint32_t nat_dir = nl_cli_parse_u32(arg);
nfnl_exp_set_nat_dir(exp, nat_dir);
}
void nl_cli_exp_parse_fn(struct nfnl_exp *exp, char *arg)
{
nfnl_exp_set_fn(exp, arg);
nfnl_exp_set_fn(exp, arg);
}
void nl_cli_exp_parse_src(struct nfnl_exp *exp, int tuple, char *arg)
......@@ -114,20 +114,20 @@ void nl_cli_exp_parse_dst(struct nfnl_exp *exp, int tuple, char *arg)
void nl_cli_exp_parse_l4protonum(struct nfnl_exp *exp, int tuple, char *arg)
{
int l4protonum;
int l4protonum;
if ((l4protonum = nl_str2ip_proto(arg)) < 0)
nl_cli_fatal(l4protonum,
"Unable to nl_cli_exp_parse protocol \"%s\": %s",
arg, nl_geterror(l4protonum));
if ((l4protonum = nl_str2ip_proto(arg)) < 0)
nl_cli_fatal(l4protonum,
"Unable to nl_cli_exp_parse protocol \"%s\": %s",
arg, nl_geterror(l4protonum));
nfnl_exp_set_l4protonum(exp, tuple, l4protonum);
nfnl_exp_set_l4protonum(exp, tuple, l4protonum);
}
void nl_cli_exp_parse_src_port(struct nfnl_exp *exp, int tuple, char *arg)
{
uint32_t sport = nl_cli_parse_u32(arg);
uint16_t dport = nfnl_exp_get_dst_port(exp, tuple);
uint16_t dport = nfnl_exp_get_dst_port(exp, tuple);
nfnl_exp_set_ports(exp, tuple, sport, dport);
}
......@@ -140,26 +140,26 @@ void nl_cli_exp_parse_dst_port(struct nfnl_exp *exp, int tuple, char *arg)
void nl_cli_exp_parse_icmp_id(struct nfnl_exp *exp, int tuple, char *arg)
{
uint32_t id = nl_cli_parse_u32(arg);
uint8_t type = nfnl_exp_get_icmp_type(exp, tuple);
uint8_t code = nfnl_exp_get_icmp_code(exp, tuple);
nfnl_exp_set_icmp(exp, tuple, id, type, code);
uint32_t id = nl_cli_parse_u32(arg);
uint8_t type = nfnl_exp_get_icmp_type(exp, tuple);
uint8_t code = nfnl_exp_get_icmp_code(exp, tuple);
nfnl_exp_set_icmp(exp, tuple, id, type, code);
}
void nl_cli_exp_parse_icmp_type(struct nfnl_exp *exp, int tuple, char *arg)
{
uint32_t type = nl_cli_parse_u32(arg);
uint16_t id = nfnl_exp_get_icmp_id(exp, tuple);
uint8_t code = nfnl_exp_get_icmp_code(exp, tuple);
nfnl_exp_set_icmp(exp, tuple, id, type, code);
uint32_t type = nl_cli_parse_u32(arg);
uint16_t id = nfnl_exp_get_icmp_id(exp, tuple);
uint8_t code = nfnl_exp_get_icmp_code(exp, tuple);
nfnl_exp_set_icmp(exp, tuple, id, type, code);
}
void nl_cli_exp_parse_icmp_code(struct nfnl_exp *exp, int tuple, char *arg)
{
uint32_t code = nl_cli_parse_u32(arg);
uint16_t id = nfnl_exp_get_icmp_id(exp, tuple);
uint8_t type = nfnl_exp_get_icmp_type(exp, tuple);
nfnl_exp_set_icmp(exp, tuple, id, type, code);
uint32_t code = nl_cli_parse_u32(arg);
uint16_t id = nfnl_exp_get_icmp_id(exp, tuple);
uint8_t type = nfnl_exp_get_icmp_type(exp, tuple);
nfnl_exp_set_icmp(exp, tuple, id, type, code);
}
/** @} */
......@@ -24,31 +24,31 @@ static void print_usage(void)
"Usage: nf-exp-list [OPTION]... [CONNTRACK ENTRY]\n"
"\n"
"Options\n"
" --replace Replace the address if it exists.\n"
" -q, --quiet Do not print informal notifications.\n"
" --replace Replace the address if it exists.\n"
" -q, --quiet Do not print informal notifications.\n"
" -h, --help Show this help\n"
" -v, --version Show versioning information\n"
"\n"
"Expectation Selection\n"
" -i, --id=NUM Identifier\n"
" --expect-proto=PROTOCOL Expectation protocol\n"
" --expect-proto=PROTOCOL Expectation protocol\n"
" --expect-src=ADDR Expectation source address\n"
" --expect-sport=PORT Expectation source port\n"
" --expect-dst=ADDR Expectation destination address\n"
" --expect-dport=PORT Expectation destination port\n"
" --master-proto=PROTOCOL Master conntrack protocol\n"
" --master-proto=PROTOCOL Master conntrack protocol\n"
" --master-src=ADDR Master conntrack source address\n"
" --master-sport=PORT Master conntrack source port\n"
" --master-dst=ADDR Master conntrack destination address\n"
" --master-dport=PORT Master conntrack destination port\n"
" --mask-proto=PROTOCOL Mask protocol\n"
" --mask-src=ADDR Mask source address\n"
" --mask-sport=PORT Mask source port\n"
" --mask-dst=ADDR Mask destination address\n"
" --mask-dport=PORT Mask destination port\n"
" --mask-proto=PROTOCOL Mask protocol\n"
" --mask-src=ADDR Mask source address\n"
" --mask-sport=PORT Mask source port\n"
" --mask-dst=ADDR Mask destination address\n"
" --mask-dport=PORT Mask destination port\n"
" -F, --family=FAMILY Address family\n"
" --timeout=NUM Timeout value\n"
" --helper=STRING Helper Name\n"
" --helper=STRING Helper Name\n"
" --flags Flags (Kernel 2.6.37)\n"
);
exit(0);
......@@ -76,24 +76,24 @@ int main(int argc, char *argv[])
ARG_EXPECT_SPORT,
ARG_EXPECT_DST,
ARG_EXPECT_DPORT,
ARG_MASTER_PROTO,
ARG_MASTER_PROTO,
ARG_MASTER_SRC,
ARG_MASTER_SPORT,
ARG_MASTER_DST,
ARG_MASTER_DPORT,
ARG_MASK_PROTO,
ARG_MASK_SRC,
ARG_MASK_SPORT,
ARG_MASK_DST,
ARG_MASK_DPORT,
ARG_MASK_PROTO,
ARG_MASK_SRC,
ARG_MASK_SPORT,
ARG_MASK_DST,
ARG_MASK_DPORT,
ARG_TIMEOUT,
ARG_HELPER_NAME,
ARG_REPLACE,
ARG_HELPER_NAME,
ARG_REPLACE,
ARG_FLAGS,
};
static struct option long_opts[] = {
{ "replace", 1, 0, ARG_REPLACE },
{ "quiet", 0, 0, 'q' },
{ "quiet", 0, 0, 'q' },
{ "help", 0, 0, 'h' },
{ "version", 0, 0, 'v' },
{ "id", 1, 0, 'i' },
......@@ -102,20 +102,20 @@ int main(int argc, char *argv[])
{ "expect-sport", 1, 0, ARG_EXPECT_SPORT },
{ "expect-dst", 1, 0, ARG_EXPECT_DST },
{ "expect-dport", 1, 0, ARG_EXPECT_DPORT },
{ "master-proto", 1, 0, ARG_MASTER_PROTO },
{ "master-proto", 1, 0, ARG_MASTER_PROTO },
{ "master-src", 1, 0, ARG_MASTER_SRC },
{ "master-sport", 1, 0, ARG_MASTER_SPORT },
{ "master-dst", 1, 0, ARG_MASTER_DST },
{ "master-dport", 1, 0, ARG_MASTER_DPORT },
{ "mask-proto", 1, 0, ARG_MASK_PROTO },
{ "mask-src", 1, 0, ARG_MASK_SRC },
{ "mask-sport", 1, 0, ARG_MASK_SPORT },
{ "mask-dst", 1, 0, ARG_MASK_DST },
{ "mask-dport", 1, 0, ARG_MASK_DPORT },
{ "mask-proto", 1, 0, ARG_MASK_PROTO },
{ "mask-src", 1, 0, ARG_MASK_SRC },
{ "mask-sport", 1, 0, ARG_MASK_SPORT },
{ "mask-dst", 1, 0, ARG_MASK_DST },
{ "mask-dport", 1, 0, ARG_MASK_DPORT },
{ "family", 1, 0, 'F' },
{ "timeout", 1, 0, ARG_TIMEOUT },
{ "helper", 1, 0, ARG_HELPER_NAME },
{ "flags", 1, 0, ARG_FLAGS},
{ "flags", 1, 0, ARG_FLAGS},
{ 0, 0, 0, 0 }
};
......@@ -125,9 +125,9 @@ int main(int argc, char *argv[])
switch (c) {
case '?': exit(NLE_INVAL);
case ARG_REPLACE: nlflags |= NLM_F_REPLACE; break;
case 'q': quiet = 1; break;
case '4': nfnl_exp_set_family(exp, AF_INET); break;
case ARG_REPLACE: nlflags |= NLM_F_REPLACE; break;
case 'q': quiet = 1; break;
case '4': nfnl_exp_set_family(exp, AF_INET); break;
case '6': nfnl_exp_set_family(exp, AF_INET6); break;
case 'h': print_usage(); break;
case 'v': nl_cli_print_version(); break;
......@@ -137,19 +137,19 @@ int main(int argc, char *argv[])
case ARG_EXPECT_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_EXPECT_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_EXPECT_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_MASTER_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASK_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case 'F': nl_cli_exp_parse_family(exp, optarg); break;
case ARG_TIMEOUT: nl_cli_exp_parse_timeout(exp, optarg); break;
case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
case ARG_FLAGS: nl_cli_exp_parse_flags(exp, optarg); break;
}
}
......@@ -157,15 +157,13 @@ int main(int argc, char *argv[])
sock = nl_cli_alloc_socket();
nl_cli_connect(sock, NETLINK_NETFILTER);
if ((err = nfnl_exp_add(sock, exp, nlflags)) < 0)
nl_cli_fatal(err, "Unable to add expectation: %s",
nl_geterror(err));
if (!quiet) {
printf("Added ");
nl_object_dump(OBJ_CAST(exp), &params);
}
if ((err = nfnl_exp_add(sock, exp, nlflags)) < 0)
nl_cli_fatal(err, "Unable to add expectation: %s", nl_geterror(err));
if (!quiet) {
printf("Added ");
nl_object_dump(OBJ_CAST(exp), &params);
}
return 0;
}
......@@ -23,31 +23,31 @@ static void print_usage(void)
"Usage: nf-exp-list [OPTION]... [CONNTRACK ENTRY]\n"
"\n"
"Options\n"
" --replace Replace the address if it exists.\n"
" -q, --quiet Do not print informal notifications.\n"
" --replace Replace the address if it exists.\n"
" -q, --quiet Do not print informal notifications.\n"
" -h, --help Show this help\n"
" -v, --version Show versioning information\n"
"\n"
"Expectation Selection\n"
" -i, --id=NUM Identifier\n"
" --expect-proto=PROTOCOL Expectation protocol\n"
" --expect-proto=PROTOCOL Expectation protocol\n"
" --expect-src=ADDR Expectation source address\n"
" --expect-sport=PORT Expectation source port\n"
" --expect-dst=ADDR Expectation destination address\n"
" --expect-dport=PORT Expectation destination port\n"
" --master-proto=PROTOCOL Master conntrack protocol\n"
" --master-proto=PROTOCOL Master conntrack protocol\n"
" --master-src=ADDR Master conntrack source address\n"
" --master-sport=PORT Master conntrack source port\n"
" --master-dst=ADDR Master conntrack destination address\n"
" --master-dport=PORT Master conntrack destination port\n"
" --mask-proto=PROTOCOL Mask protocol\n"
" --mask-src=ADDR Mask source address\n"
" --mask-sport=PORT Mask source port\n"
" --mask-dst=ADDR Mask destination address\n"
" --mask-dport=PORT Mask destination port\n"
" --mask-proto=PROTOCOL Mask protocol\n"
" --mask-src=ADDR Mask source address\n"
" --mask-sport=PORT Mask source port\n"
" --mask-dst=ADDR Mask destination address\n"
" --mask-dport=PORT Mask destination port\n"
" -F, --family=FAMILY Address family\n"
" --timeout=NUM Timeout value\n"
" --helper=STRING Helper Name\n"
" --helper=STRING Helper Name\n"
" --flags Flags\n"
);
exit(0);
......@@ -75,22 +75,22 @@ int main(int argc, char *argv[])
ARG_EXPECT_SPORT,
ARG_EXPECT_DST,
ARG_EXPECT_DPORT,
ARG_MASTER_PROTO,
ARG_MASTER_PROTO,
ARG_MASTER_SRC,
ARG_MASTER_SPORT,
ARG_MASTER_DST,
ARG_MASTER_DPORT,
ARG_MASK_PROTO,
ARG_MASK_SRC,
ARG_MASK_SPORT,
ARG_MASK_DST,
ARG_MASK_DPORT,
ARG_MASK_PROTO,
ARG_MASK_SRC,
ARG_MASK_SPORT,
ARG_MASK_DST,
ARG_MASK_DPORT,
ARG_TIMEOUT,
ARG_HELPER_NAME,
ARG_HELPER_NAME,
ARG_FLAGS,
};
static struct option long_opts[] = {
{ "quiet", 0, 0, 'q' },
{ "quiet", 0, 0, 'q' },
{ "help", 0, 0, 'h' },
{ "version", 0, 0, 'v' },
{ "id", 1, 0, 'i' },
......@@ -99,20 +99,20 @@ int main(int argc, char *argv[])
{ "expect-sport", 1, 0, ARG_EXPECT_SPORT },
{ "expect-dst", 1, 0, ARG_EXPECT_DST },
{ "expect-dport", 1, 0, ARG_EXPECT_DPORT },
{ "master-proto", 1, 0, ARG_MASTER_PROTO },
{ "master-proto", 1, 0, ARG_MASTER_PROTO },
{ "master-src", 1, 0, ARG_MASTER_SRC },
{ "master-sport", 1, 0, ARG_MASTER_SPORT },
{ "master-dst", 1, 0, ARG_MASTER_DST },
{ "master-dport", 1, 0, ARG_MASTER_DPORT },
{ "mask-proto", 1, 0, ARG_MASK_PROTO },
{ "mask-src", 1, 0, ARG_MASK_SRC },
{ "mask-sport", 1, 0, ARG_MASK_SPORT },
{ "mask-dst", 1, 0, ARG_MASK_DST },
{ "mask-dport", 1, 0, ARG_MASK_DPORT },
{ "mask-proto", 1, 0, ARG_MASK_PROTO },
{ "mask-src", 1, 0, ARG_MASK_SRC },
{ "mask-sport", 1, 0, ARG_MASK_SPORT },
{ "mask-dst", 1, 0, ARG_MASK_DST },
{ "mask-dport", 1, 0, ARG_MASK_DPORT },
{ "family", 1, 0, 'F' },
{ "timeout", 1, 0, ARG_TIMEOUT },
{ "helper", 1, 0, ARG_HELPER_NAME },
{ "flags", 1, 0, ARG_FLAGS},
{ "flags", 1, 0, ARG_FLAGS},
{ 0, 0, 0, 0 }
};
......@@ -122,8 +122,8 @@ int main(int argc, char *argv[])
switch (c) {
case '?': exit(NLE_INVAL);
case 'q': quiet = 1; break;
case '4': nfnl_exp_set_family(exp, AF_INET); break;
case 'q': quiet = 1; break;
case '4': nfnl_exp_set_family(exp, AF_INET); break;
case '6': nfnl_exp_set_family(exp, AF_INET6); break;
case 'h': print_usage(); break;
case 'v': nl_cli_print_version(); break;
......@@ -133,19 +133,19 @@ int main(int argc, char *argv[])
case ARG_EXPECT_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_EXPECT_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_EXPECT_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_MASTER_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASK_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case ARG_MASK_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
case 'F': nl_cli_exp_parse_family(exp, optarg); break;
case ARG_TIMEOUT: nl_cli_exp_parse_timeout(exp, optarg); break;
case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
case ARG_FLAGS: nl_cli_exp_parse_flags(exp, optarg); break;
}
}
......@@ -153,15 +153,13 @@ int main(int argc, char *argv[])
sock = nl_cli_alloc_socket();
nl_cli_connect(sock, NETLINK_NETFILTER);
if ((err = nfnl_exp_del(sock, exp, nlflags)) < 0)
nl_cli_fatal(err, "Unable to delete expectation: %s",
nl_geterror(err));
if (!quiet) {
printf("Deleted ");
nl_object_dump(OBJ_CAST(exp), &params);
}
if ((err = nfnl_exp_del(sock, exp, nlflags)) < 0)
nl_cli_fatal(err, "Unable to delete expectation: %s", nl_geterror(err));
if (!quiet) {
printf("Deleted ");
nl_object_dump(OBJ_CAST(exp), &params);
}
return 0;
}
......@@ -27,19 +27,19 @@ static void print_usage(void)
"\n"
"Expectation Selection\n"
" -i, --id=NUM Identifier\n"
" --expect-proto=PROTOCOL Expectation protocol\n"
" --expect-proto=PROTOCOL Expectation protocol\n"
" --expect-src=ADDR Expectation source address\n"
" --expect-sport=PORT Expectation source port\n"
" --expect-dst=ADDR Expectation destination address\n"
" --expect-dport=PORT Expectation destination port\n"
" --master-proto=PROTOCOL Master conntrack protocol\n"
" --master-proto=PROTOCOL Master conntrack protocol\n"
" --master-src=ADDR Master conntrack source address\n"
" --master-sport=PORT Master conntrack source port\n"
" --master-dst=ADDR Master conntrack destination address\n"
" --master-dport=PORT Master conntrack destination port\n"
" -F, --family=FAMILY Address family\n"
" --timeout=NUM Timeout value\n"
" --helper=STRING Helper Name\n"
" --helper=STRING Helper Name\n"
//" --flags Flags\n"
);
exit(0);
......@@ -67,14 +67,14 @@ int main(int argc, char *argv[])
ARG_EXPECT_SPORT,
ARG_EXPECT_DST,
ARG_EXPECT_DPORT,
ARG_MASTER_PROTO,
ARG_MASTER_PROTO,
ARG_MASTER_SRC,
ARG_MASTER_SPORT,
ARG_MASTER_DST,
ARG_MASTER_DPORT,
ARG_TIMEOUT,
ARG_HELPER_NAME,
//ARG_FLAGS,
ARG_HELPER_NAME,
ARG_FLAGS,
};
static struct option long_opts[] = {
{ "format", 1, 0, 'f' },
......@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
{ "expect-sport", 1, 0, ARG_EXPECT_SPORT },
{ "expect-dst", 1, 0, ARG_EXPECT_DST },
{ "expect-dport", 1, 0, ARG_EXPECT_DPORT },
{ "master-proto", 1, 0, ARG_MASTER_PROTO },
{ "master-proto", 1, 0, ARG_MASTER_PROTO },
{ "master-src", 1, 0, ARG_MASTER_SRC },
{ "master-sport", 1, 0, ARG_MASTER_SPORT },
{ "master-dst", 1, 0, ARG_MASTER_DST },
......@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
{ "family", 1, 0, 'F' },
{ "timeout", 1, 0, ARG_TIMEOUT },
{ "helper", 1, 0, ARG_HELPER_NAME },
//{ "flags", 1, 0, ARG_FLAGS},
{ "flags", 1, 0, ARG_FLAGS},
{ 0, 0, 0, 0 }
};
......@@ -115,15 +115,15 @@ int main(int argc, char *argv[])
case ARG_EXPECT_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_EXPECT_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_EXPECT_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_EXPECT, optarg); break;
case ARG_MASTER_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case ARG_MASTER_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASTER, optarg); break;
case 'F': nl_cli_exp_parse_family(exp, optarg); break;
case ARG_TIMEOUT: nl_cli_exp_parse_timeout(exp, optarg); break;
case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
//case ARG_FLAGS: nl_cli_exp_parse_flags(exp, optarg); break;
case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
case ARG_FLAGS: nl_cli_exp_parse_flags(exp, optarg); break;
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment