[sccp] Add a utility for the nat..

Add a small helper to determine the type of a message
This commit is contained in:
Holger Hans Peter Freyther 2010-01-13 09:55:43 +01:00
parent 3b9516e0d8
commit a692fbcff5
2 changed files with 14 additions and 0 deletions

View File

@ -143,4 +143,10 @@ extern const struct sockaddr_sccp sccp_ssn_bssap;
u_int32_t sccp_src_ref_to_int(struct sccp_source_reference *ref);
struct sccp_source_reference sccp_src_ref_from_int(u_int32_t);
/*
* helper functions for the nat code
*/
int sccp_determine_msg_type(struct msgb *msg);
#endif

View File

@ -1160,6 +1160,14 @@ struct sccp_source_reference sccp_src_ref_from_int(u_int32_t int_ref)
return ref;
}
int sccp_determine_msg_type(struct msgb *msg)
{
if (msgb_l2len(msg) < 1)
return -1;
return msg->l2h[0];
}
static __attribute__((constructor)) void on_dso_load(void)
{
tall_sccp_ctx = talloc_named_const(NULL, 1, "sccp");