Skip to content

Added SGW_S8 contexts #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: rsarwad_create_s8_task
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ openwrt/ @emakeev @uri200
# More specific mappings for lte/gateway will override this top-level one
lte/gateway @ardzoht @pshelar
lte/gateway/c/session_manager @themarwhal @uri200
lte/gateway/c/oai @ssanadhya @ulaskozat @lionelgo
lte/gateway/c/oai @ssanadhya @ulaskozat @lionelgo @ardzoht
lte/gateway/c/sctpd @ssanadhya @ulaskozat
lte/gateway/c/connection_tracker @koolzz
lte/gateway/docker @rdefosse @tmdzk
Expand Down
79 changes: 40 additions & 39 deletions feg/cloud/go/protos/s6a_proxy.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ type SubscriptionData struct {
APNConfigurationProfile APNConfigurationProfile `avp:"APN-Configuration-Profile"`
SubscribedPeriodicRauTauTimer uint32 `avp:"Subscribed-Periodic-RAU-TAU-Timer"`
TgppChargingCharacteristics string `avp:"TGPP-Charging-Characteristics"`
RegionalSubscriptionZoneCode []datatype.OctetString `avp:"Regional-Subscription-Zone-Code"`
RegionalSubscriptionZoneCode []datatype.OctetString `avp:"Regional-Subscription-Zone-Code"`
}

type ULA struct {
Expand Down
5 changes: 4 additions & 1 deletion feg/gateway/services/s6a_proxy/servicers/s6a_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ limitations under the License.
package servicers_test

import (
"bytes"
"fmt"
"math/rand"
"net"
Expand Down Expand Up @@ -107,8 +108,10 @@ func TestS6aProxyService(t *testing.T) {
if ulResp.ErrorCode != protos.ErrorCode_UNDEFINED {
t.Errorf("Unexpected ULA Error Code: %d", ulResp.ErrorCode)
}
assert.NoError(t, err)
if len(ulResp.RegionalSubscriptionZoneCode) != 2 ||
(ulResp.RegionalSubscriptionZoneCode[0] != "112233" || ulResp.RegionalSubscriptionZoneCode[1]!= "445566") {
!bytes.Equal(ulResp.RegionalSubscriptionZoneCode[0], []byte{155, 36, 12, 2, 227, 43, 246, 254}) ||
!bytes.Equal(ulResp.RegionalSubscriptionZoneCode[1], []byte{1, 1, 0, 1}) {
t.Errorf("There should be 2 Regional Subscription Zone Codes : %+v", ulResp.RegionalSubscriptionZoneCode)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ func testSendULA(settings *sm.Settings, w io.Writer, m *diam.Message) (n int64,
diam.NewAVP(avp.AccessRestrictionData, avp.Mbit|avp.Vbit, VENDOR_3GPP, datatype.Unsigned32(47)),
diam.NewAVP(avp.SubscriberStatus, avp.Mbit|avp.Vbit, VENDOR_3GPP, datatype.Unsigned32(0)),
diam.NewAVP(avp.NetworkAccessMode, avp.Mbit|avp.Vbit, VENDOR_3GPP, datatype.Unsigned32(2)),
diam.NewAVP(avp.RegionalSubscriptionZoneCode, avp.Mbit|avp.Vbit, VENDOR_3GPP, datatype.OctetString("112233")),
diam.NewAVP(avp.RegionalSubscriptionZoneCode, avp.Mbit|avp.Vbit, VENDOR_3GPP, datatype.OctetString("445566")),
diam.NewAVP(avp.RegionalSubscriptionZoneCode, avp.Mbit|avp.Vbit, VENDOR_3GPP, datatype.OctetString([]byte{155, 36, 12, 2, 227, 43, 246, 254})),
diam.NewAVP(avp.RegionalSubscriptionZoneCode, avp.Mbit|avp.Vbit, VENDOR_3GPP, datatype.OctetString([]byte{1, 1, 0, 1})),
diam.NewAVP(avp.AMBR, avp.Mbit|avp.Vbit, VENDOR_3GPP, &diam.GroupedAVP{
AVP: []*diam.AVP{
diam.NewAVP(
Expand Down
4 changes: 2 additions & 2 deletions feg/gateway/services/s6a_proxy/servicers/ul.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ func (s *s6aProxy) UpdateLocationImpl(req *protos.UpdateLocationRequest) (*proto
res.AllApnsIncluded =
ula.SubscriptionData.APNConfigurationProfile.AllAPNConfigurationsIncludedIndicator == 0
res.NetworkAccessMode = protos.UpdateLocationAnswer_NetworkAccessMode(ula.SubscriptionData.NetworkAccessMode)
res.RegionalSubscriptionZoneCode = make([]string, len(ula.SubscriptionData.RegionalSubscriptionZoneCode))
res.RegionalSubscriptionZoneCode = make([][]byte, len(ula.SubscriptionData.RegionalSubscriptionZoneCode))
for i, code := range ula.SubscriptionData.RegionalSubscriptionZoneCode {
res.RegionalSubscriptionZoneCode[i] = string(code)
res.RegionalSubscriptionZoneCode[i] = code.Serialize()
}
for _, apnCfg := range ula.SubscriptionData.APNConfigurationProfile.APNConfigs {
res.Apn = append(
Expand Down
2 changes: 1 addition & 1 deletion feg/protos/s6a_proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ message UpdateLocationAnswer {

NetworkAccessMode network_access_mode = 8;

repeated string regional_subscription_zone_code = 9;
repeated bytes regional_subscription_zone_code = 9;

message APNConfiguration {
// APN identifier
Expand Down
3 changes: 3 additions & 0 deletions lte/gateway/c/oai/common/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ int log_init(
&g_oai_log.log_proto2str[LOG_S11][0], LOG_MAX_PROTO_NAME_LENGTH, "S11");
snprintf(
&g_oai_log.log_proto2str[LOG_S6A][0], LOG_MAX_PROTO_NAME_LENGTH, "S6A");
snprintf(
&g_oai_log.log_proto2str[LOG_SGW_S8][0], LOG_MAX_PROTO_NAME_LENGTH,
"SGW_S8");
snprintf(
&g_oai_log.log_proto2str[LOG_SECU][0], LOG_MAX_PROTO_NAME_LENGTH, "SECU");
snprintf(
Expand Down
1 change: 1 addition & 0 deletions lte/gateway/c/oai/common/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ typedef enum {
LOG_ASYNC_SYSTEM,
LOG_ASSERT,
LOG_COMMON,
LOG_SGW_S8,
MAX_LOG_PROTOS,
} log_proto_t;

Expand Down
71 changes: 71 additions & 0 deletions lte/gateway/c/oai/include/sgw_context_manager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the terms found in the LICENSE file in the root of this source tree.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* [email protected]
*/

/*! \file sgw_context_manager.h
* \brief
* \author Lionel Gauthier
* \company Eurecom
* \email: [email protected]
*/
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

#include "3gpp_24.007.h"

#include "spgw_state.h"

void sgw_display_sgw_eps_bearer_context(
const sgw_eps_bearer_ctxt_t* eps_bearer_ctxt);
void sgw_display_s11teid2mme(mme_sgw_tunnel_t* mme_sgw_tunnel);
void sgw_display_s11_bearer_context_information(
s_plus_p_gw_eps_bearer_context_information_t* sp_context_information);
void pgw_lite_cm_free_apn(pgw_apn_t** apnP);

teid_t sgw_get_new_S11_tunnel_id(spgw_state_t* state);
mme_sgw_tunnel_t* sgw_cm_create_s11_tunnel(
teid_t remote_teid, teid_t local_teid);
s_plus_p_gw_eps_bearer_context_information_t*
sgw_cm_create_bearer_context_information_in_collection(
spgw_state_t* spgw_state, teid_t teid, imsi64_t imsi64);
int sgw_cm_remove_bearer_context_information(
spgw_state_t* state, teid_t teid, imsi64_t imsi64);
sgw_eps_bearer_ctxt_t* sgw_cm_create_eps_bearer_ctxt_in_collection(
sgw_pdn_connection_t* const sgw_pdn_connection, const ebi_t eps_bearer_idP);
sgw_eps_bearer_ctxt_t* sgw_cm_insert_eps_bearer_ctxt_in_collection(
sgw_pdn_connection_t* const sgw_pdn_connection,
sgw_eps_bearer_ctxt_t* const sgw_eps_bearer_ctxt);
sgw_eps_bearer_ctxt_t* sgw_cm_get_eps_bearer_entry(
sgw_pdn_connection_t* const sgw_pdn_connection, ebi_t ebi);
int sgw_cm_remove_eps_bearer_entry(
sgw_pdn_connection_t* const sgw_pdn_connection, ebi_t eps_bearer_idP);
// Returns SPGW state pointer for given UE indexed by IMSI
s_plus_p_gw_eps_bearer_context_information_t* sgw_cm_get_spgw_context(
teid_t teid);
spgw_ue_context_t* spgw_create_or_get_ue_context(
spgw_state_t* spgw_state, imsi64_t imsi64);

int spgw_update_teid_in_ue_context(
spgw_state_t* spgw_state, imsi64_t imsi64, teid_t teid);

#ifdef __cplusplus
}
#endif
Loading