rename filename for s1ap-path

This commit is contained in:
Sukchan Lee 2019-06-01 09:52:38 +00:00
parent d4023da087
commit 756859d05c
20 changed files with 173 additions and 69 deletions

View File

@ -5,7 +5,7 @@ noinst_LTLIBRARIES = libmme.la
libmme_la_SOURCES = \
mme_kdf.h kasumi.h snow_3g.h zuc.h \
mme_event.h mme_context.h \
s1ap_build.h s1ap_handler.h s1ap_conv.h s1ap_path.h \
s1ap_build.h s1ap_handler.h s1ap_conv.h s1ap-path.h \
ogs-sctp.h \
mme_fd_path.h mme_s6a_handler.h \
nas_conv.h nas_security.h nas_path.h \
@ -15,7 +15,7 @@ libmme_la_SOURCES = \
mme_sm.h mme_path.h \
mme_kdf.c kasumi.c snow_3g.c zuc.c \
mme_init.c mme_event.c mme_context.c \
s1ap_sm.c s1ap_build.c s1ap_handler.c s1ap_conv.c s1ap_path.c \
s1ap_sm.c s1ap_build.c s1ap_handler.c s1ap_conv.c s1ap-path.c \
ogs-sctp.c \
mme_fd_path.c mme_s6a_handler.c \
nas_conv.c nas_security.c nas_path.c \

View File

@ -6,7 +6,7 @@
#include "nas_security.h"
#include "nas_conv.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "nas_path.h"
#include "mme_fd_path.h"
#include "mme_gtp_path.h"

View File

@ -10,7 +10,7 @@
#include "emm_build.h"
#include "esm_handler.h"
#include "nas_path.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "mme_gtp_path.h"
#include "mme_path.h"
#include "mme_sm.h"

View File

@ -13,7 +13,7 @@
#include "nas_conv.h"
#include "mme_context.h"
#include "mme_event.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "s1ap_handler.h"
#include "mme_sm.h"

View File

@ -1,7 +1,7 @@
#include "mme_event.h"
#include "mme_context.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#define EVENT_POOL 32 /* FIXME : 32 */
void mme_event_init(void)

View File

@ -8,7 +8,7 @@
#include "mme_event.h"
#include "mme_fd_path.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
static ogs_thread_t *thread;
static void mme_main(void *data);

View File

@ -1,4 +1,4 @@
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "nas_path.h"
#include "mme_gtp_path.h"
#include "mme_path.h"

View File

@ -6,7 +6,7 @@
#include "mme_sm.h"
#include "mme_context.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "mme_gtp_path.h"
#include "nas_path.h"
#include "mme_fd_path.h"

View File

@ -1,6 +1,6 @@
#include "fd/s6a/s6a_message.h"
#include "nas_path.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "mme_sm.h"
#include "mme_s6a_handler.h"

View File

@ -7,7 +7,7 @@
#include "mme_sm.h"
#include "s1ap_handler.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "nas_security.h"
#include "nas_path.h"
#include "emm_handler.h"

View File

@ -1,4 +1,4 @@
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "s1ap_build.h"
#include "esm_build.h"
#include "emm_build.h"

View File

@ -1,3 +1,22 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-sctp.h"
void ogs_sctp_set_option(ogs_sockopt_t *option, ogs_socknode_t *node)

View File

@ -1,3 +1,22 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-sctp.h"
static void ogs_debug_printf(const char *format, ...);

View File

@ -1,6 +1,25 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-sctp.h"
#include "mme_event.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
static void accept_handler(short when, ogs_socket_t fd, void *data);

View File

@ -1,3 +1,22 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-sctp.h"
#include "app/context.h"
@ -8,7 +27,7 @@
#include "s1ap_conv.h"
#include "s1ap_build.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
int s1ap_open(void)
{
@ -84,8 +103,7 @@ int s1ap_send_to_enb(mme_enb_t *enb, ogs_pkbuf_t *pkbuf, uint16_t stream_no)
rv = s1ap_send(enb->sock, pkbuf,
enb->sock_type == SOCK_STREAM ? NULL : enb->addr,
stream_no);
if (rv != OGS_OK)
{
if (rv != OGS_OK) {
ogs_error("s1_send error");
ogs_pkbuf_free(pkbuf);
}
@ -113,8 +131,7 @@ int s1ap_delayed_send_to_enb_ue(
ogs_assert(enb_ue);
ogs_assert(pkbuf);
if (duration)
{
if (duration) {
mme_event_t *e = NULL;
e = mme_event_new(MME_EVT_S1AP_DELAYED_SEND);
@ -127,9 +144,7 @@ int s1ap_delayed_send_to_enb_ue(
ogs_timer_start(e->timer, duration);
return OGS_OK;
}
else
{
} else {
mme_enb_t *enb = NULL;
enb = enb_ue->enb;
ogs_assert(enb);
@ -182,49 +197,46 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
ogs_assert(sh);
memset(&security_header_type, 0, sizeof(nas_security_header_type_t));
switch(sh->security_header_type)
{
case NAS_SECURITY_HEADER_PLAIN_NAS_MESSAGE:
break;
case NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE:
security_header_type.service_request = 1;
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED:
security_header_type.integrity_protected = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED:
security_header_type.integrity_protected = 1;
security_header_type.ciphered = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT:
security_header_type.integrity_protected = 1;
security_header_type.new_security_context = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT:
security_header_type.integrity_protected = 1;
security_header_type.ciphered = 1;
security_header_type.new_security_context = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
default:
ogs_error("Not implemented(securiry header type:0x%x)",
sh->security_header_type);
return OGS_ERROR;
switch(sh->security_header_type) {
case NAS_SECURITY_HEADER_PLAIN_NAS_MESSAGE:
break;
case NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE:
security_header_type.service_request = 1;
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED:
security_header_type.integrity_protected = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED:
security_header_type.integrity_protected = 1;
security_header_type.ciphered = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT:
security_header_type.integrity_protected = 1;
security_header_type.new_security_context = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
case NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT:
security_header_type.integrity_protected = 1;
security_header_type.ciphered = 1;
security_header_type.new_security_context = 1;
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
break;
default:
ogs_error("Not implemented(securiry header type:0x%x)",
sh->security_header_type);
return OGS_ERROR;
}
if (enb_ue->mme_ue)
{
if (enb_ue->mme_ue) {
ogs_assert(nas_security_decode(
enb_ue->mme_ue, security_header_type, nasbuf) == OGS_OK);
}
h = nasbuf->data;
ogs_assert(h);
if (h->protocol_discriminator == NAS_PROTOCOL_DISCRIMINATOR_EMM)
{
if (h->protocol_discriminator == NAS_PROTOCOL_DISCRIMINATOR_EMM) {
int rv;
e = mme_event_new(MME_EVT_EMM_MESSAGE);
ogs_assert(e);
@ -238,14 +250,11 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
ogs_pkbuf_free(e->pkbuf);
mme_event_free(e);
}
}
else if (h->protocol_discriminator == NAS_PROTOCOL_DISCRIMINATOR_ESM)
{
} else if (h->protocol_discriminator == NAS_PROTOCOL_DISCRIMINATOR_ESM) {
mme_ue_t *mme_ue = enb_ue->mme_ue;
ogs_assert(mme_ue);
s1ap_send_to_esm(mme_ue, nasbuf);
}
else
} else
ogs_assert_if_reached();
return OGS_OK;

View File

@ -1,5 +1,24 @@
#ifndef __S1AP_PATH_H__
#define __S1AP_PATH_H__
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef S1AP_PATH_H
#define S1AP_PATH_H
#include "mme_context.h"
#include "asn1c/s1ap_message.h"
@ -72,6 +91,6 @@ int s1ap_send_s1_reset_ack(
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
#endif /* !__S1_PATH_H__ */
#endif /* S1AP_PATH_H */

View File

@ -1,6 +1,25 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-sctp.h"
#include "mme_event.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
int s1ap_usrsctp_recv_handler(struct socket *sock,
union sctp_sockstore addr, void *data, size_t datalen,

View File

@ -2,7 +2,7 @@
#include "mme_kdf.h"
#include "s1ap_conv.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "nas_path.h"
#include "mme_gtp_path.h"

View File

@ -1,5 +1,5 @@
#include "mme_context.h"
#include "s1ap_path.h"
#include "s1ap-path.h"
#include "s1ap_build.h"
#include "sbc_handler.h"

View File

@ -18,7 +18,7 @@
#endif
#include "mme/s1ap_build.h"
#include "mme/s1ap_conv.h"
#include "mme/s1ap_path.h"
#include "mme/s1ap-path.h"
#include "mme/snow_3g.h"
#include "gtp/gtp_message.h"