X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fprivate.h;h=80c59e466eb98fc0ee9f94938399edc3047272d5;hb=d1e9b9bf30de1cdcac4d4da74d2a5c017f41519d;hp=16d30d50205b3c86b59619022299ec4df2ee6e98;hpb=b2fda3effc787f265b5ad5dfa967ac00627bd075;p=openvswitch diff --git a/ofproto/private.h b/ofproto/private.h index 16d30d50..80c59e46 100644 --- a/ofproto/private.h +++ b/ofproto/private.h @@ -45,7 +45,6 @@ struct ofproto { char *dp_desc; /* Datapath description. */ /* Datapath. */ - struct netdev_monitor *netdev_monitor; struct hmap ports; /* Contains "struct ofport"s. */ struct shash port_by_name; @@ -70,6 +69,7 @@ struct ofport { struct netdev *netdev; struct ofp_phy_port opp; uint16_t ofp_port; /* OpenFlow port number. */ + unsigned int change_seq; }; /* An OpenFlow flow within a "struct ofproto". @@ -506,6 +506,25 @@ struct ofproto_class { /* ## OpenFlow Rule Functions ## */ /* ## ----------------------- ## */ + /* Chooses an appropriate table for 'cls_rule' within 'ofproto'. On + * success, stores the table ID into '*table_idp' and returns 0. On + * failure, returns an OpenFlow error code (as returned by ofp_mkerr()). + * + * The choice of table should be a function of 'cls_rule' and 'ofproto''s + * datapath capabilities. It should not depend on the flows already in + * 'ofproto''s flow tables. Failure implies that an OpenFlow rule with + * 'cls_rule' as its matching condition can never be inserted into + * 'ofproto', even starting from an empty flow table. + * + * If multiple tables are candidates for inserting the flow, the function + * should choose one arbitrarily (but deterministically). + * + * This function will never be called for an ofproto that has only one + * table, so it may be NULL in that case. */ + int (*rule_choose_table)(const struct ofproto *ofproto, + const struct cls_rule *cls_rule, + uint8_t *table_idp); + /* Life-cycle functions for a "struct rule" (see "Life Cycle" above). * * ->rule_construct() should first check whether the rule is acceptable: @@ -653,25 +672,22 @@ struct ofproto_class { /* Configures connectivity fault management on 'ofport'. * - * If 'cfm' is nonnull, takes basic configuration from the configuration - * members in 'cfm', and the set of remote maintenance points from the - * 'n_remote_mps' elements in 'remote_mps'. Ignores the statistics members - * of 'cfm'. + * If 'cfm_settings' is nonnull, configures CFM according to its members. * - * If 'cfm' is null, removes any connectivity fault management + * If 'cfm_settings' is null, removes any connectivity fault management * configuration from 'ofport'. * * EOPNOTSUPP as a return value indicates that this ofproto_class does not * support CFM, as does a null pointer. */ - int (*set_cfm)(struct ofport *ofport, const struct cfm *cfm, - const uint16_t *remote_mps, size_t n_remote_mps); + int (*set_cfm)(struct ofport *ofport, const struct cfm_settings *s); - /* Stores the connectivity fault management object associated with 'ofport' - * in '*cfmp'. Stores a null pointer in '*cfmp' if CFM is not configured - * on 'ofport'. The caller must not modify or destroy the returned object. + /* Checks the fault status of CFM configured on 'ofport'. Returns 1 if CFM + * is faulted (generally indicating a connectivity problem), 0 if CFM is + * not faulted, or -1 if CFM is not enabled on 'port' * - * This function may be NULL if this ofproto_class does not support CFM. */ - int (*get_cfm)(struct ofport *ofport, const struct cfm **cfmp); + * This function may be a null pointer if the ofproto implementation does + * not support CFM. */ + int (*get_cfm_fault)(const struct ofport *ofport); /* If 's' is nonnull, this function registers a "bundle" associated with * client data pointer 'aux' in 'ofproto'. A bundle is the same concept as