From 84cdc70e0bbeddf33404df472f3c992f5446ff12 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 8 Oct 2013 12:04:44 +0200 Subject: gb: Separate nsvc creation from NS message processing This patch refactors gprs_ns_rcvmsg() by moving the parts relevant to the NS messages into the new functions gprs_ns_vc_create() (nsvc object creation) and gprs_ns_process_msg() (main NS automaton). These do not contain code that directly depends on the link layer (they call other functions that still do). This reduces the gprs_ns_rcvmsg() function to calling these two functions and optionally setting up the link layer specific fields of the nsvc. Sponsored-by: On-Waves ehf --- include/osmocom/gprs/gprs_ns.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/osmocom/gprs/gprs_ns.h') diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 8ca5a887..c709312a 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -49,6 +49,15 @@ enum gprs_ns_evt { GPRS_NS_EVT_UNIT_DATA, }; +/*! \brief Osmocom NS VC create status */ +enum gprs_ns_cs { + GPRS_NS_CS_CREATED, /*!< A NSVC object has been created */ + GPRS_NS_CS_FOUND, /*!< A NSVC object has been found */ + GPRS_NS_CS_REJECTED, /*!< Rejected and answered message */ + GPRS_NS_CS_SKIPPED, /*!< Skipped message */ + GPRS_NS_CS_ERROR, /*!< Failed to process message */ +}; + struct gprs_nsvc; /*! \brief Osmocom GPRS callback function type */ typedef int gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, -- cgit v1.2.3