[ftmod_misdn] Extend misdn_event_types[] and use a helper macro.

Add missing mISDN event/message types (e.g. MPH_INFORMATION_IND)
and use a helper macro (MISDN_EVENT_TYPE) to define the entries,
like we already do for misdn_control_types[].

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
Stefan Knoblich 2012-02-07 16:44:55 +01:00
parent a14c46c38c
commit b6ec127194
1 changed files with 21 additions and 12 deletions

View File

@ -96,18 +96,27 @@ const static struct {
const int id;
const char *name;
} misdn_event_types[] = {
{ PH_DATA_REQ, "PH_DATA_REQ" },
{ PH_DATA_IND, "PH_DATA_IND" },
{ PH_DATA_CNF, "PH_DATA_CNF" },
{ PH_CONTROL_REQ, "PH_CONTROL_REQ" },
{ PH_CONTROL_IND, "PH_CONTROL_IND" },
{ PH_CONTROL_CNF, "PH_CONTROL_CNF" },
{ PH_ACTIVATE_REQ, "PH_ACTIVATE_REQ" },
{ PH_ACTIVATE_IND, "PH_ACTIVATE_IND" },
{ PH_ACTIVATE_CNF, "PH_ACTIVATE_CNF" },
{ PH_DEACTIVATE_REQ, "PH_DEACTIVATE_REQ" },
{ PH_DEACTIVATE_IND, "PH_DEACTIVATE_IND" },
{ PH_DEACTIVATE_CNF, "PH_DEACTIVATE_CNF" },
#define MISDN_EVENT_TYPE(x) { x, #x }
MISDN_EVENT_TYPE(PH_DATA_REQ),
MISDN_EVENT_TYPE(PH_DATA_IND),
MISDN_EVENT_TYPE(PH_DATA_CNF),
MISDN_EVENT_TYPE(PH_DATA_E_IND),
MISDN_EVENT_TYPE(PH_CONTROL_REQ),
MISDN_EVENT_TYPE(PH_CONTROL_IND),
MISDN_EVENT_TYPE(PH_CONTROL_CNF),
MISDN_EVENT_TYPE(PH_ACTIVATE_REQ),
MISDN_EVENT_TYPE(PH_ACTIVATE_IND),
MISDN_EVENT_TYPE(PH_ACTIVATE_CNF),
MISDN_EVENT_TYPE(PH_DEACTIVATE_REQ),
MISDN_EVENT_TYPE(PH_DEACTIVATE_IND),
MISDN_EVENT_TYPE(PH_DEACTIVATE_CNF),
MISDN_EVENT_TYPE(MPH_ACTIVATE_REQ),
MISDN_EVENT_TYPE(MPH_ACTIVATE_IND),
MISDN_EVENT_TYPE(MPH_DEACTIVATE_REQ),
MISDN_EVENT_TYPE(MPH_DEACTIVATE_IND),
MISDN_EVENT_TYPE(MPH_INFORMATION_REQ),
MISDN_EVENT_TYPE(MPH_INFORMATION_IND),
#undef MISDN_EVENT_TYPE
};
static const char *misdn_event2str(const int event)