From a56104575c4db202bfc5db3079ea969820d77867 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Fri, 13 May 2011 15:37:23 -0700 Subject: cfm: Cleanup CFM module interface. This patch makes the CFM module interface a bit more like the LACP module interface. In my opinion it's much cleaner. --- lib/cfm.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'lib/cfm.h') diff --git a/lib/cfm.h b/lib/cfm.h index 5472cda67..02f50d5fd 100644 --- a/lib/cfm.h +++ b/lib/cfm.h @@ -47,17 +47,13 @@ struct ccm { } __attribute__((packed)); BUILD_ASSERT_DECL(CCM_LEN == sizeof(struct ccm)); -/* A 'cfm' represent a local Maintenance Point (MP) and its Connectivity Fault - * Management (CFM) state machine. Its configuration variables should be set - * by clients of the CFM library. */ -struct cfm { - /* Configuration Variables. */ +struct cfm_settings { uint16_t mpid; /* The MPID of this CFM. */ int interval; /* The requested transmission interval. */ const char *name; /* Name of this CFM object. */ - /* Statistics. */ - bool fault; /* Indicates connectivity vaults. */ + const uint16_t *remote_mpids; /* Array of remote MPIDs */ + size_t n_remote_mpids; /* Number of MPIDs in 'remote_mpids'. */ }; void cfm_init(void); @@ -74,12 +70,12 @@ void cfm_compose_ccm(struct cfm *, struct ccm *); void cfm_wait(struct cfm *); -bool cfm_configure(struct cfm *); - -void cfm_update_remote_mps(struct cfm *, const uint16_t *mpid, size_t n_mpids); +bool cfm_configure(struct cfm *, const struct cfm_settings *); bool cfm_should_process_flow(const struct flow *); void cfm_process_heartbeat(struct cfm *, const struct ofpbuf *packet); +bool cfm_get_fault(const struct cfm *); + #endif /* cfm.h */ -- cgit v1.2.1