diff options
author | Maria Matejka <mq@ucw.cz> | 2022-03-26 11:56:02 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-04 15:37:41 +0200 |
commit | 0d0f6554a5c233bf2bf830ae319191c4b1808d49 (patch) | |
tree | b90790a9450dc4eaefd1cab522d49221d358a5d9 /sysdep/linux/netlink.c | |
parent | 80272d4b64a38ee6f04a1c4e8566cac3a2293176 (diff) |
Unified attribute and filter types
This commit removes the EAF_TYPE_* namespace completely and also for
route attributes, filter-based types T_* are used. This simplifies
fetching and setting route attributes from filters.
Also, there is now union bval which serves as an universal value holder
instead of private unions held separately by eattr and filter code.
Diffstat (limited to 'sysdep/linux/netlink.c')
-rw-r--r-- | sysdep/linux/netlink.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index 6c8228fd..eb4be711 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -1587,12 +1587,12 @@ nl_announce_route(struct nl_parse_state *s) ea->attrs[0] = (eattr) { .id = EA_KRT_SOURCE, - .type = EAF_TYPE_INT, + .type = T_INT, .u.data = s->krt_proto, }; ea->attrs[1] = (eattr) { .id = EA_KRT_METRIC, - .type = EAF_TYPE_INT, + .type = T_INT, .u.data = s->krt_metric, }; @@ -1873,7 +1873,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) ea->count = 1; ea->attrs[0].id = EA_KRT_SCOPE; ea->attrs[0].flags = 0; - ea->attrs[0].type = EAF_TYPE_INT; + ea->attrs[0].type = T_INT; ea->attrs[0].u.data = i->rtm_scope; } @@ -1888,7 +1888,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) ea->count = 1; ea->attrs[0].id = EA_KRT_PREFSRC; ea->attrs[0].flags = 0; - ea->attrs[0].type = EAF_TYPE_IP_ADDRESS; + ea->attrs[0].type = T_IP; struct adata *ad = lp_alloc(s->pool, sizeof(struct adata) + sizeof(ps)); ad->length = sizeof(ps); @@ -1907,7 +1907,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) ea->count = 1; ea->attrs[0].id = EA_KRT_REALM; ea->attrs[0].flags = 0; - ea->attrs[0].type = EAF_TYPE_INT; + ea->attrs[0].type = T_INT; ea->attrs[0].u.data = s->rta_flow; } @@ -1928,7 +1928,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) { ea->attrs[n].id = EA_CODE(PROTOCOL_KERNEL, KRT_METRICS_OFFSET + t); ea->attrs[n].flags = 0; - ea->attrs[n].type = EAF_TYPE_INT; + ea->attrs[n].type = T_INT; ea->attrs[n].u.data = metrics[t]; n++; } |