X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fopenvswitch%2Fdatapath-protocol.h;h=94723ef051e38d23d8b8b939659e429a4ede5e4d;hb=f2459fe7d91c4c325dfaa3ed18f56200b63ae27e;hp=6c5354548ea4ae38e373f5f94728973d326708a3;hpb=5f55c39b21e69025045437ffbd3bb98fe6ce2e89;p=openvswitch diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h index 6c535454..94723ef0 100644 --- a/include/openvswitch/datapath-protocol.h +++ b/include/openvswitch/datapath-protocol.h @@ -61,8 +61,8 @@ #define ODP_GET_LISTEN_MASK _IOW('O', 5, int) #define ODP_SET_LISTEN_MASK _IOR('O', 6, int) -#define ODP_PORT_ADD _IOR('O', 7, struct odp_port) -#define ODP_PORT_DEL _IOR('O', 8, int) +#define ODP_PORT_ATTACH _IOR('O', 7, struct odp_port) +#define ODP_PORT_DETACH _IOR('O', 8, int) #define ODP_PORT_QUERY _IOWR('O', 9, struct odp_port) #define ODP_PORT_LIST _IOWR('O', 10, struct odp_portvec) @@ -80,6 +80,15 @@ #define ODP_SET_SFLOW_PROBABILITY _IOR('O', 19, int) #define ODP_GET_SFLOW_PROBABILITY _IOW('O', 20, int) +#define ODP_VPORT_ADD _IOR('O', 21, struct odp_vport_add) +#define ODP_VPORT_MOD _IOR('O', 22, struct odp_vport_mod) +#define ODP_VPORT_DEL _IO('O', 23) +#define ODP_VPORT_STATS_GET _IOWR('O', 24, struct odp_vport_stats_req) +#define ODP_VPORT_ETHER_GET _IOWR('O', 25, struct odp_vport_ether) +#define ODP_VPORT_ETHER_SET _IOW('O', 26, struct odp_vport_ether) +#define ODP_VPORT_MTU_GET _IOWR('O', 27, struct odp_vport_mtu) +#define ODP_VPORT_MTU_SET _IOW('O', 28, struct odp_vport_mtu) + struct odp_stats { /* Flows. */ __u32 n_flows; /* Number of flows in flow table. */ @@ -127,7 +136,8 @@ struct odp_stats { * @arg: Argument value whose meaning depends on @type. * * For @type == %_ODPL_MISS_NR, the header is followed by packet data. The - * @arg member is unused and set to 0. + * @arg member is the ID (in network byte order) of the tunnel that + * encapsulated this packet. It is 0 if the packet was not received on a tunnel. * * For @type == %_ODPL_ACTION_NR, the header is followed by packet data. The * @arg member is copied from the &struct odp_action_controller that caused @@ -191,6 +201,7 @@ struct odp_flow_stats { }; struct odp_flow_key { + __be32 tun_id; /* Encapsulating tunnel ID. */ __be32 nw_src; /* IP source address. */ __be32 nw_dst; /* IP destination address. */ __u16 in_port; /* Input switch port. */ @@ -253,7 +264,8 @@ struct odp_flowvec { #define ODPAT_SET_NW_TOS 10 /* IP ToS/DSCP field (6 bits). */ #define ODPAT_SET_TP_SRC 11 /* TCP/UDP source port. */ #define ODPAT_SET_TP_DST 12 /* TCP/UDP destination port. */ -#define ODPAT_N_ACTIONS 13 +#define ODPAT_SET_TUNNEL 13 /* Set the encapsulating tunnel ID. */ +#define ODPAT_N_ACTIONS 14 struct odp_action_output { __u16 type; /* ODPAT_OUTPUT. */ @@ -275,6 +287,12 @@ struct odp_action_controller { __u32 arg; /* Copied to struct odp_msg 'arg' member. */ }; +struct odp_action_tunnel { + __u16 type; /* ODPAT_SET_TUNNEL. */ + __u16 reserved; + __be32 tun_id; /* Tunnel ID. */ +}; + /* Action structure for ODPAT_SET_VLAN_VID. */ struct odp_action_vlan_vid { __u16 type; /* ODPAT_SET_VLAN_VID. */ @@ -326,6 +344,7 @@ union odp_action { struct odp_action_output output; struct odp_action_output_group output_group; struct odp_action_controller controller; + struct odp_action_tunnel tunnel; struct odp_action_vlan_vid vlan_vid; struct odp_action_vlan_pcp vlan_pcp; struct odp_action_dl_addr dl_addr; @@ -346,6 +365,48 @@ struct odp_execute { __u32 length; }; +#define VPORT_TYPE_SIZE 16 +struct odp_vport_add { + char port_type[VPORT_TYPE_SIZE]; + char devname[16]; /* IFNAMSIZ */ + void *config; +}; + +struct odp_vport_mod { + char devname[16]; /* IFNAMSIZ */ + void *config; +}; + +struct odp_vport_stats { + __u64 rx_packets; + __u64 tx_packets; + __u64 rx_bytes; + __u64 tx_bytes; + __u64 rx_dropped; + __u64 tx_dropped; + __u64 rx_errors; + __u64 tx_errors; + __u64 rx_frame_err; + __u64 rx_over_err; + __u64 rx_crc_err; + __u64 collisions; +}; + +struct odp_vport_stats_req { + char devname[16]; /* IFNAMSIZ */ + struct odp_vport_stats stats; +}; + +struct odp_vport_ether { + char devname[16]; /* IFNAMSIZ */ + unsigned char ether_addr[ETH_ALEN]; +}; + +struct odp_vport_mtu { + char devname[16]; /* IFNAMSIZ */ + __u16 mtu; +}; + /* Values below this cutoff are 802.3 packets and the two bytes * following MAC addresses are used as a frame length. Otherwise, the * two bytes are used as the Ethernet type.