debian: install openvswitch kernel module under "updates" directory
[cascardo/ovs.git] / ofproto / ofproto-provider.h
index 158f86e..9222fe4 100644 (file)
@@ -99,7 +99,7 @@ struct ofproto {
     struct hmap learned_cookies OVS_GUARDED_BY(ofproto_mutex);
 
     /* List of expirable flows, in all flow tables. */
-    struct list expirable OVS_GUARDED_BY(ofproto_mutex);
+    struct ovs_list expirable OVS_GUARDED_BY(ofproto_mutex);
 
     /* Meter table.
      * OpenFlow meters start at 1.  To avoid confusion we leave the first
@@ -346,6 +346,9 @@ struct rule {
     uint16_t hard_timeout OVS_GUARDED; /* In seconds from ->modified. */
     uint16_t idle_timeout OVS_GUARDED; /* In seconds from ->used. */
 
+    /* Eviction precedence. */
+    uint16_t importance OVS_GUARDED;
+
     /* Eviction groups (see comment on struct eviction_group for explanation) .
      *
      * 'eviction_group' is this rule's eviction group, or NULL if it is not in
@@ -359,7 +362,7 @@ struct rule {
     OVSRCU_TYPE(const struct rule_actions *) actions;
 
     /* In owning meter's 'rules' list.  An empty list if there is no meter. */
-    struct list meter_list_node OVS_GUARDED_BY(ofproto_mutex);
+    struct ovs_list meter_list_node OVS_GUARDED_BY(ofproto_mutex);
 
     /* Flow monitors (e.g. for NXST_FLOW_MONITOR, related to struct ofmonitor).
      *
@@ -372,7 +375,7 @@ struct rule {
 
     /* Optimisation for flow expiry.  In ofproto's 'expirable' list if this
      * rule is expirable, otherwise empty. */
-    struct list expirable OVS_GUARDED_BY(ofproto_mutex);
+    struct ovs_list expirable OVS_GUARDED_BY(ofproto_mutex);
 
     /* Times.  Last so that they are more likely close to the stats managed
      * by the provider. */
@@ -494,8 +497,10 @@ struct ofgroup {
     const long long int created;      /* Creation time. */
     const long long int modified;     /* Time of last modification. */
 
-    struct list buckets;        /* Contains "struct ofputil_bucket"s. */
+    struct ovs_list buckets;        /* Contains "struct ofputil_bucket"s. */
     const uint32_t n_buckets;
+
+    const struct ofputil_group_props props;
 };
 
 bool ofproto_group_lookup(const struct ofproto *ofproto, uint32_t group_id,
@@ -626,9 +631,10 @@ struct ofproto_class {
      * may choose to remove it all. */
     void (*init)(const struct shash *iface_hints);
 
-    /* Enumerates the types of all support ofproto types into 'types'.  The
-     * caller has already initialized 'types' and other ofproto classes might
-     * already have added names to it. */
+    /* Enumerates the types of all supported ofproto types into 'types'.  The
+     * caller has already initialized 'types'.  The implementation should add
+     * its own types to 'types' but not remove any existing ones, because other
+     * ofproto classes might already have added names to it. */
     void (*enumerate_types)(struct sset *types);
 
     /* Enumerates the names of all existing datapath of the specified 'type'
@@ -1030,9 +1036,18 @@ struct ofproto_class {
      * problem), or -1 if LACP is not enabled on 'port'.
      *
      * This function may be a null pointer if the ofproto implementation does
-     * not support LACP. */
+     * not support LACP.
+     */
     int (*port_is_lacp_current)(const struct ofport *port);
 
+    /* Get LACP port stats. Returns -1 if LACP is not enabled on 'port'.
+     *
+     * This function may be a null pointer if the ofproto implementation does
+     * not support LACP.
+     */
+    int (*port_get_lacp_stats)(const struct ofport *port,
+                               struct lacp_slave_stats *stats);
+
 /* ## ----------------------- ## */
 /* ## OpenFlow Rule Functions ## */
 /* ## ----------------------- ## */
@@ -1179,7 +1194,7 @@ struct ofproto_class {
      *
      * Returns 0 if successful, otherwise an OpenFlow error code. */
     enum ofperr (*rule_execute)(struct rule *rule, const struct flow *flow,
-                                struct ofpbuf *packet);
+                                struct dp_packet *packet);
 
     /* If the datapath can properly implement changing 'rule''s actions to the
      * 'ofpacts_len' bytes in 'ofpacts', returns 0.  Otherwise, returns an enum
@@ -1280,7 +1295,7 @@ struct ofproto_class {
      * statistics should not be included in OpenFlow flow statistics.
      *
      * Returns 0 if successful, otherwise an OpenFlow error code. */
-    enum ofperr (*packet_out)(struct ofproto *ofproto, struct ofpbuf *packet,
+    enum ofperr (*packet_out)(struct ofproto *ofproto, struct dp_packet *packet,
                               const struct flow *flow,
                               const struct ofpact *ofpacts,
                               size_t ofpacts_len);
@@ -1347,6 +1362,77 @@ struct ofproto_class {
     int (*get_cfm_status)(const struct ofport *ofport,
                           struct cfm_status *status);
 
+    /* Configures LLDP on 'ofport'.
+     *
+     * EOPNOTSUPP as a return value indicates that this ofproto_class does not
+     * support LLDP, as does a null pointer. */
+    int (*set_lldp)(struct ofport *ofport, const struct smap *cfg);
+
+    /* Checks the status of LLDP configured on 'ofport'.  Returns true if the
+     * port's LLDP status was successfully stored into '*status'.  Returns
+     * false if the port did not have LLDP configured, in which case '*status'
+     * is indeterminate.
+     *
+     * The caller must provide and own '*status'.  '*status' is indeterminate
+     * if the return value is non-zero. */
+    bool (*get_lldp_status)(const struct ofport *ofport,
+                            struct lldp_status *status);
+
+    /* Configures Auto Attach.
+     *
+     * If 's' is nonnull, configures Auto Attach according to its members.
+     *
+     * If 's' is null, removes any Auto Attach configuration.
+     */
+    int (*set_aa)(struct ofproto *ofproto,
+                  const struct aa_settings *s);
+
+    /* If 's' is nonnull, this function registers a mapping associated with
+     * client data pointer 'aux' in 'ofproto'.  If 'aux' is already registered
+     * then this function updates its configuration to 's'.  Otherwise, this
+     * function registers a new mapping.
+     *
+     * An implementation that does not support mapping at all may set
+     * it to NULL or return EOPNOTSUPP.  An implementation that supports
+     * only a subset of the functionality should implement what it can
+     * and return 0.
+     */
+    int (*aa_mapping_set)(struct ofproto *ofproto, void *aux,
+                          const struct aa_mapping_settings *s);
+
+    /* If 's' is nonnull, this function unregisters a mapping associated with
+     * client data pointer 'aux' in 'ofproto'.  If 'aux' is already registered
+     * then this function updates its configuration to 's'.  Otherwise, this
+     * function unregisters a new mapping.
+     *
+     * An implementation that does not support mapping at all may set
+     * it to NULL or return EOPNOTSUPP.  An implementation that supports
+     * only a subset of the functionality should implement what it can
+     * and return 0.
+     */
+    int (*aa_mapping_unset)(struct ofproto *ofproto, void *aux);
+
+    /*
+     * Returns the a list of AutoAttach VLAN operations.  When Auto Attach is
+     * enabled, the VLAN associated with an I-SID/VLAN mapping is first
+     * negotiated with an Auto Attach Server.  Once an I-SID VLAN mapping
+     * becomes active, the corresponding VLAN needs to be communicated to the
+     * bridge in order to add the VLAN to the trunk port linking the Auto
+     * Attach Client (in this case openvswitch) and the Auto Attach Server.
+     *
+     * The list entries are of type "struct bridge_aa_vlan".  Each entry
+     * specifies the operation (add or remove), the interface on which to
+     * execute the operation and the VLAN.
+     */
+    int (*aa_vlan_get_queued)(struct ofproto *ofproto, struct ovs_list *list);
+
+    /*
+     * Returns the current number of entries in the list of VLAN operations
+     * in the Auto Attach Client (see previous function description
+     * aa_vlan_get_queued).  Returns 0 if Auto Attach is disabled.
+     */
+    unsigned int (*aa_vlan_get_queue_size)(struct ofproto *ofproto);
+
     /* Configures BFD on 'ofport'.
      *
      * If 'cfg' is NULL, or 'cfg' does not contain the key value pair
@@ -1576,14 +1662,15 @@ struct ofproto_class {
 
     /* Configures multicast snooping port's flood setting on 'ofproto'.
      *
-     * All multicast traffic is sent to struct port 'aux' in 'ofproto'
-     * if 'flood' is true. Otherwise, struct port 'aux' is an ordinary
-     * switch port.
+     * If 's' is nonnull, this function updates multicast snooping
+     * configuration to 's' in 'ofproto'.
+     *
+     * If 's' is NULL, this function doesn't change anything.
      *
      * An implementation that does not support multicast snooping may set
      * it to NULL or return EOPNOTSUPP. */
     int (*set_mcast_snooping_port)(struct ofproto *ofproto_, void *aux,
-                                   bool flood);
+                          const struct ofproto_mcast_snooping_port_settings *s);
 
 /* Linux VLAN device support (e.g. "eth0.10" for VLAN 10.)
  *
@@ -1659,6 +1746,19 @@ struct ofproto_class {
 
     enum ofperr (*group_get_stats)(const struct ofgroup *,
                                    struct ofputil_group_stats *);
+
+/* ## --------------------- ## */
+/* ## Datapath information  ## */
+/* ## --------------------- ## */
+    /* Retrieve the version string of the datapath. The version
+     * string can be NULL if it can not be determined.
+     *
+     * The version retuned is read only. The caller should not
+     * free it.
+     *
+     * This function should be NULL if an implementation does not support it.
+     */
+    const char *(*get_datapath_version)(const struct ofproto *);
 };
 
 extern const struct ofproto_class ofproto_dpif_class;
@@ -1668,12 +1768,10 @@ int ofproto_class_unregister(const struct ofproto_class *);
 
 int ofproto_flow_mod(struct ofproto *, struct ofputil_flow_mod *)
     OVS_EXCLUDED(ofproto_mutex);
-void ofproto_add_flow(struct ofproto *, const struct match *,
-                      unsigned int priority,
+void ofproto_add_flow(struct ofproto *, const struct match *, int priority,
                       const struct ofpact *ofpacts, size_t ofpacts_len)
     OVS_EXCLUDED(ofproto_mutex);
-void ofproto_delete_flow(struct ofproto *,
-                         const struct match *, unsigned int priority)
+void ofproto_delete_flow(struct ofproto *, const struct match *, int priority)
     OVS_EXCLUDED(ofproto_mutex);
 void ofproto_flush_flows(struct ofproto *);