mirror of https://gerrit.osmocom.org/libosmocore
gprs_ns2: Pass peer/remote sockaddr argument to ns2_create_vc()
This is a preparation towards auto-creating SNS NS-VCs in SGSN role Related: OS#3373 Change-Id: Idf92712079cd9b7e4ff2cf8df314b372d63e6e52
This commit is contained in:
parent
a39b2592a0
commit
7d0daac1ce
|
@ -868,12 +868,14 @@ static inline int ns2_tlv_parse(struct tlv_parsed *dec,
|
|||
/*! Create a new NS-VC based on a [received] message. Depending on the bind it might create a NSE.
|
||||
* \param[in] bind the bind through which msg was received
|
||||
* \param[in] msg the actual received message
|
||||
* \param[in] remote address of remote peer sending message
|
||||
* \param[in] logname A name to describe the VC. E.g. ip address pair
|
||||
* \param[out] reject A message filled to be sent back. Only used in failure cases.
|
||||
* \param[out] success A pointer which will be set to the new VC on success
|
||||
* \return enum value indicating the status, e.g. GPRS_NS2_CS_CREATED */
|
||||
enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind,
|
||||
struct msgb *msg,
|
||||
const struct osmo_sockaddr *remote,
|
||||
const char *logname,
|
||||
struct msgb **reject,
|
||||
struct gprs_ns2_vc **success)
|
||||
|
|
|
@ -447,7 +447,7 @@ static int handle_nsfrgre_read(struct osmo_fd *bfd)
|
|||
rc = ns2_find_vc_by_dlci(bind, dlci, &nsvc);
|
||||
if (rc) {
|
||||
/* VC not found */
|
||||
rc = ns2_create_vc(bind, msg, "newconnection", &reject, &nsvc);
|
||||
rc = ns2_create_vc(bind, msg, &saddr, "newconnection", &reject, &nsvc);
|
||||
switch (rc) {
|
||||
case NS2_CS_FOUND:
|
||||
break;
|
||||
|
|
|
@ -279,6 +279,7 @@ struct gprs_ns2_vc_driver {
|
|||
|
||||
enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind,
|
||||
struct msgb *msg,
|
||||
const struct osmo_sockaddr *remote,
|
||||
const char *logname,
|
||||
struct msgb **reject,
|
||||
struct gprs_ns2_vc **success);
|
||||
|
|
|
@ -231,7 +231,7 @@ static int handle_nsip_read(struct osmo_fd *bfd)
|
|||
nsvc = gprs_ns2_nsvc_by_sockaddr_bind(bind, &saddr);
|
||||
if (!nsvc) {
|
||||
/* VC not found */
|
||||
rc = ns2_create_vc(bind, msg, "newconnection", &reject, &nsvc);
|
||||
rc = ns2_create_vc(bind, msg, &saddr, "newconnection", &reject, &nsvc);
|
||||
switch (rc) {
|
||||
case NS2_CS_FOUND:
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue