diff options
author | Ben Pfaff <blp@nicira.com> | 2011-01-26 12:28:59 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-01-27 21:08:37 -0800 |
commit | c19e653509deb3f1002c4ed99714e16549ec74e9 (patch) | |
tree | 099ccf3353b072d43b4514aa69502127fe53044d /datapath/vport-capwap.c | |
parent | 7897d3fa21ec370997e4f108b01de2664bec0a67 (diff) |
datapath: Change userspace vport interface to use Netlink attributes.
One of the goals for Open vSwitch is to decouple kernel and userspace
software, so that either one can be upgraded or rolled back independent of
the other. To do this in full generality, it must be possible to add new
features to the kernel vport layer without changing userspace software.
The customary way to do this in the Linux networking stack is to use
Netlink and in particular Netlink attributes. This commit adopts that
model for the vport layer. It does not yet actually start using the
Netlink socket layer, which will come later.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/vport-capwap.c')
-rw-r--r-- | datapath/vport-capwap.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/datapath/vport-capwap.c b/datapath/vport-capwap.c index a674b614..4fb43933 100644 --- a/datapath/vport-capwap.c +++ b/datapath/vport-capwap.c @@ -115,14 +115,17 @@ static struct netns_frags frag_netns_state = { static struct socket *capwap_rcv_socket; -static int capwap_hdr_len(const struct tnl_port_config *port_config) +static int capwap_hdr_len(const struct tnl_mutable_config *mutable) { - /* CAPWAP has neither checksums nor keys, so reject ports with those. */ - if (port_config->flags & (TNL_F_CSUM | TNL_F_IN_KEY_MATCH | - TNL_F_OUT_KEY_ACTION)) + /* CAPWAP has no checksums. */ + if (mutable->flags & TNL_F_CSUM) return -EINVAL; - if (port_config->in_key != 0 || port_config->out_key != 0) + /* CAPWAP has no keys, so check that the configuration for keys is the + * default if no key-specific attributes are used. + */ + if ((mutable->flags & (TNL_F_IN_KEY_MATCH | TNL_F_OUT_KEY_ACTION)) != + (TNL_F_IN_KEY_MATCH | TNL_F_OUT_KEY_ACTION)) return -EINVAL; return CAPWAP_HLEN; @@ -650,13 +653,13 @@ const struct vport_ops capwap_vport_ops = { .init = capwap_init, .exit = capwap_exit, .create = capwap_create, - .modify = tnl_modify, .destroy = tnl_destroy, .set_mtu = tnl_set_mtu, .set_addr = tnl_set_addr, .get_name = tnl_get_name, .get_addr = tnl_get_addr, - .get_config = tnl_get_config, + .get_options = tnl_get_options, + .set_options = tnl_set_options, .get_dev_flags = vport_gen_get_dev_flags, .is_running = vport_gen_is_running, .get_operstate = vport_gen_get_operstate, |