diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2020-12-01 01:03:52 +0100 |
---|---|---|
committer | lynxis lazus <lynxis@fe80.eu> | 2020-12-15 11:46:45 +0000 |
commit | d923cff170904e4d22ef00dd410b0d6256f95068 (patch) | |
tree | 8da2620ac71558b45409587c6f6359343ccdfc8f /include | |
parent | c8158ecfc40e29a2b6b9f328aafb2dad0007def2 (diff) |
gprs_ns2: introduce NS dialects
A NS dialect describes how the NS Entity interacts with
different virtual circuits. E.g. ipaccess use reset/block on udp
and is a dynamic connection.
A single NS Entity can only support one dialect. This can be later
used to protect a NS Entity against dynamic NS virtual circuits of a
different type.
It further allows a bind to support multiple dialects at the same time.
Change-Id: Ia118bb6f994845d84db09de7a94856f5ca573404
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/gprs/gprs_ns2.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/osmocom/gprs/gprs_ns2.h b/include/osmocom/gprs/gprs_ns2.h index 45753292..6140da24 100644 --- a/include/osmocom/gprs/gprs_ns2.h +++ b/include/osmocom/gprs/gprs_ns2.h @@ -32,6 +32,14 @@ enum gprs_ns2_vc_mode { NS2_VC_MODE_ALIVE, }; +enum gprs_ns2_dialect { + NS2_DIALECT_UNDEF, + NS2_DIALECT_STATIC_ALIVE, + NS2_DIALECT_STATIC_RESETBLOCK, + NS2_DIALECT_IPACCESS, + NS2_DIALECT_SNS, +}; + /*! Osmocom NS link layer types */ enum gprs_ns2_ll { GPRS_NS2_LL_UDP, /*!< NS/UDP/IP */ @@ -144,7 +152,8 @@ int gprs_ns2_nse_foreach_nsvc(struct gprs_ns2_nse *nse, gprs_ns2_foreach_nsvc_cb cb, void *cb_data); struct gprs_ns2_nse *gprs_ns2_nse_by_nsei(struct gprs_ns2_inst *nsi, uint16_t nsei); struct gprs_ns2_nse *gprs_ns2_create_nse(struct gprs_ns2_inst *nsi, uint16_t nsei, - enum gprs_ns2_ll linklayer); + enum gprs_ns2_ll linklayer, + enum gprs_ns2_dialect dialect); uint16_t gprs_ns2_nse_nsei(struct gprs_ns2_nse *nse); void gprs_ns2_free_nse(struct gprs_ns2_nse *nse); void gprs_ns2_free_nses(struct gprs_ns2_inst *nsi); @@ -160,7 +169,6 @@ int gprs_ns2_ip_bind(struct gprs_ns2_inst *nsi, struct gprs_ns2_vc_bind **result); struct gprs_ns2_vc_bind *gprs_ns2_ip_bind_by_sockaddr(struct gprs_ns2_inst *nsi, const struct osmo_sockaddr *sockaddr); -void gprs_ns2_bind_set_mode(struct gprs_ns2_vc_bind *bind, enum gprs_ns2_vc_mode mode); /* FR VL driver */ struct gprs_ns2_vc_bind *gprs_ns2_fr_bind_by_netif( @@ -188,7 +196,8 @@ struct gprs_ns2_vc *gprs_ns2_ip_connect(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_vc *gprs_ns2_ip_connect2(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *remote, uint16_t nsei, - uint16_t nsvci); + uint16_t nsvci, + enum gprs_ns2_dialect dialect); struct gprs_ns2_vc *gprs_ns2_ip_connect_inactive(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *remote, struct gprs_ns2_nse *nse, @@ -238,7 +247,5 @@ const char *gprs_ns2_nsvc_state_name(struct gprs_ns2_vc *nsvc); int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi, const struct osmo_sockaddr_str *default_bind); int gprs_ns2_vty_create(); -void gprs_ns2_vty_force_vc_mode(bool force, enum gprs_ns2_vc_mode mode, const char *reason); - /*! @} */ |