2019-06-18 06:32:01 +00:00
|
|
|
/*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
#include "base/base.h"
|
2017-03-05 06:02:12 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
#if HAVE_NETINET_IP_H
|
|
|
|
#include <netinet/ip.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_NETINET_IP6_H
|
|
|
|
#include <netinet/ip6.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_NETINET_IP_ICMP_H
|
|
|
|
#include <netinet/ip_icmp.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_NETINET_ICMP6_H
|
|
|
|
#include <netinet/icmp6.h>
|
|
|
|
#endif
|
2019-06-11 13:10:47 +00:00
|
|
|
#include "mme/snow-3g.h"
|
2017-03-05 06:02:12 +00:00
|
|
|
|
2019-06-11 09:28:25 +00:00
|
|
|
#include "gtp/gtp-message.h"
|
|
|
|
#include "gtp/gtp-conv.h"
|
|
|
|
#include "gtp/gtp-node.h"
|
|
|
|
#include "gtp/gtp-path.h"
|
2017-11-30 11:13:15 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
#include "mme/ogs-sctp.h"
|
|
|
|
#include "app/context.h"
|
2017-11-30 11:13:15 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
#include "mme/s1ap-build.h"
|
|
|
|
#include "mme/s1ap-conv.h"
|
|
|
|
#include "mme/s1ap-path.h"
|
|
|
|
|
|
|
|
#include "mme/sgsap-path.h"
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int testpacket_init()
|
|
|
|
{
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
2017-12-14 01:33:03 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int testpacket_final()
|
|
|
|
{
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
2018-01-05 15:23:26 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
ogs_socknode_t *testsctp_server(const char *ipstr)
|
|
|
|
{
|
|
|
|
int rv;
|
|
|
|
ogs_sockaddr_t *addr = NULL;
|
|
|
|
ogs_socknode_t *node = NULL;
|
|
|
|
|
|
|
|
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, ipstr, SGSAP_SCTP_PORT, 0);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
|
|
|
|
node = ogs_socknode_new(addr);
|
|
|
|
ogs_assert(node);
|
|
|
|
ogs_socknode_nodelay(node, true);
|
|
|
|
|
|
|
|
ogs_sctp_server(SOCK_SEQPACKET, node);
|
|
|
|
ogs_assert(node->sock);
|
|
|
|
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
|
|
|
ogs_socknode_t *testsctp_client(const char *ipstr)
|
2017-12-14 01:33:03 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
2019-06-05 13:07:37 +00:00
|
|
|
ogs_sockaddr_t *addr = NULL;
|
2019-05-31 01:18:43 +00:00
|
|
|
ogs_socknode_t *node = NULL;
|
2018-02-04 14:15:20 +00:00
|
|
|
|
2019-06-05 13:07:37 +00:00
|
|
|
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, ipstr, S1AP_SCTP_PORT, 0);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
|
|
|
|
node = ogs_socknode_new(addr);
|
2019-05-31 01:18:43 +00:00
|
|
|
ogs_assert(node);
|
2019-06-15 07:54:49 +00:00
|
|
|
ogs_socknode_nodelay(node, true);
|
2018-01-05 15:23:26 +00:00
|
|
|
|
2019-05-31 01:18:43 +00:00
|
|
|
ogs_sctp_client(SOCK_STREAM, node);
|
|
|
|
ogs_assert(node->sock);
|
2018-01-05 15:23:26 +00:00
|
|
|
|
2019-05-31 01:18:43 +00:00
|
|
|
return node;
|
2017-12-14 01:33:03 +00:00
|
|
|
}
|
|
|
|
|
2019-06-21 15:28:21 +00:00
|
|
|
static ogs_sockaddr_t sctp_last_addr;
|
|
|
|
|
2019-07-08 09:15:19 +00:00
|
|
|
ogs_pkbuf_t *testsctp_read(ogs_socknode_t *node, int type)
|
2017-12-14 01:33:03 +00:00
|
|
|
{
|
2019-06-18 05:04:11 +00:00
|
|
|
int size;
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_pkbuf_t *recvbuf = NULL;
|
2019-06-18 05:04:11 +00:00
|
|
|
|
|
|
|
ogs_assert(node);
|
|
|
|
ogs_assert(node->sock);
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
recvbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put(recvbuf, MAX_SDU_LEN);
|
2018-02-04 14:15:20 +00:00
|
|
|
|
2019-07-08 09:15:19 +00:00
|
|
|
size = ogs_sctp_recvdata(node->sock, recvbuf->data, MAX_SDU_LEN,
|
|
|
|
type == 1 ? &sctp_last_addr : NULL, NULL);
|
2019-06-18 05:04:11 +00:00
|
|
|
if (size <= 0) {
|
2019-06-18 06:32:01 +00:00
|
|
|
ogs_error("sgsap_recv() failed");
|
2019-06-18 05:04:11 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ogs_pkbuf_trim(recvbuf, size);
|
|
|
|
return recvbuf;;
|
2019-04-27 14:54:30 +00:00
|
|
|
}
|
2017-12-14 01:33:03 +00:00
|
|
|
|
2019-05-31 01:18:43 +00:00
|
|
|
int testenb_s1ap_send(ogs_socknode_t *node, ogs_pkbuf_t *sendbuf)
|
2019-04-27 14:54:30 +00:00
|
|
|
{
|
2019-05-31 01:18:43 +00:00
|
|
|
return s1ap_send(node->sock, sendbuf, NULL, 0);
|
2019-04-27 14:54:30 +00:00
|
|
|
}
|
2018-01-05 15:23:26 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
int testvlr_sgsap_send(ogs_socknode_t *node, ogs_pkbuf_t *sendbuf)
|
2019-04-27 14:54:30 +00:00
|
|
|
{
|
2019-06-21 15:28:21 +00:00
|
|
|
return sgsap_send(node->sock, sendbuf, &sctp_last_addr, 0);
|
2017-12-14 01:33:03 +00:00
|
|
|
}
|
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
ogs_socknode_t *testenb_gtpu_server(const char *ipstr)
|
2017-11-24 13:02:40 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
2019-06-05 13:07:37 +00:00
|
|
|
ogs_sockaddr_t *addr = NULL;
|
2019-05-30 12:14:54 +00:00
|
|
|
ogs_socknode_t *node = NULL;
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_sock_t *sock = NULL;
|
2017-11-24 13:02:40 +00:00
|
|
|
|
2019-06-05 13:07:37 +00:00
|
|
|
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, ipstr, GTPV1_U_UDP_PORT, 0);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
|
|
|
|
node = ogs_socknode_new(addr);
|
2019-05-30 12:14:54 +00:00
|
|
|
ogs_assert(node);
|
2017-12-08 05:29:35 +00:00
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
sock = ogs_udp_server(node);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(sock);
|
2017-11-24 13:02:40 +00:00
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
return node;
|
2017-11-24 13:02:40 +00:00
|
|
|
}
|
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
ogs_pkbuf_t *testenb_gtpu_read(ogs_socknode_t *node)
|
2017-11-24 13:02:40 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rc = 0;
|
|
|
|
ogs_pkbuf_t *recvbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put(recvbuf, MAX_SDU_LEN);
|
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
ogs_assert(node);
|
|
|
|
ogs_assert(node->sock);
|
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
while (1) {
|
2019-05-30 12:14:54 +00:00
|
|
|
rc = ogs_recv(node->sock->fd, recvbuf->data, recvbuf->len, 0);
|
2019-06-18 06:32:01 +00:00
|
|
|
if (rc <= 0) {
|
|
|
|
if (errno == EAGAIN) {
|
2019-04-27 14:54:30 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
2019-06-18 06:32:01 +00:00
|
|
|
} else {
|
2019-04-27 14:54:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
recvbuf->len = rc;
|
|
|
|
|
|
|
|
return recvbuf;
|
2017-11-24 13:02:40 +00:00
|
|
|
}
|
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
int testenb_gtpu_send(ogs_socknode_t *node, ogs_pkbuf_t *sendbuf)
|
2017-11-24 13:02:40 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
|
|
|
ogs_hash_index_t *hi = NULL;
|
|
|
|
mme_ue_t *mme_ue = NULL;
|
|
|
|
mme_sess_t *sess = NULL;
|
|
|
|
mme_bearer_t *bearer = NULL;
|
|
|
|
|
|
|
|
ogs_sockaddr_t sgw;
|
|
|
|
ssize_t sent;
|
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
ogs_assert(node);
|
|
|
|
ogs_assert(node->sock);
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2019-06-30 11:46:15 +00:00
|
|
|
mme_ue = ogs_list_first(&mme_self()->mme_ue_list);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(mme_ue);
|
|
|
|
sess = mme_sess_first(mme_ue);
|
|
|
|
ogs_assert(sess);
|
|
|
|
bearer = mme_bearer_first(sess);
|
|
|
|
ogs_assert(bearer);
|
|
|
|
|
|
|
|
memset(&sgw, 0, sizeof(ogs_sockaddr_t));
|
2019-05-30 04:50:53 +00:00
|
|
|
sgw.ogs_sin_port = htons(GTPV1_U_UDP_PORT);
|
2019-06-18 06:32:01 +00:00
|
|
|
if (bearer->sgw_s1u_ip.ipv6) {
|
2019-05-30 04:50:53 +00:00
|
|
|
sgw.ogs_sa_family = AF_INET6;
|
2019-04-27 14:54:30 +00:00
|
|
|
if (bearer->sgw_s1u_ip.ipv4)
|
|
|
|
memcpy(sgw.sin6.sin6_addr.s6_addr,
|
|
|
|
bearer->sgw_s1u_ip.both.addr6, IPV6_LEN);
|
|
|
|
else
|
|
|
|
memcpy(sgw.sin6.sin6_addr.s6_addr,
|
|
|
|
bearer->sgw_s1u_ip.addr6, IPV6_LEN);
|
2019-05-30 10:58:27 +00:00
|
|
|
rv = ogs_socknode_fill_scope_id_in_local(&sgw);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2019-06-18 06:32:01 +00:00
|
|
|
} else {
|
2019-05-30 04:50:53 +00:00
|
|
|
sgw.ogs_sa_family = AF_INET;
|
2019-04-27 14:54:30 +00:00
|
|
|
sgw.sin.sin_addr.s_addr = bearer->sgw_s1u_ip.addr;
|
|
|
|
}
|
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
sent = ogs_sendto(node->sock->fd, sendbuf->data, sendbuf->len, 0, &sgw);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_pkbuf_free(sendbuf);
|
|
|
|
if (sent < 0 || sent != sendbuf->len)
|
|
|
|
return OGS_ERROR;
|
|
|
|
|
|
|
|
return OGS_OK;
|
2017-11-24 13:02:40 +00:00
|
|
|
}
|
|
|
|
|
2019-05-30 12:14:54 +00:00
|
|
|
void testenb_gtpu_close(ogs_socknode_t *node)
|
2017-11-24 13:02:40 +00:00
|
|
|
{
|
2019-05-30 12:14:54 +00:00
|
|
|
ogs_socknode_free(node);
|
2017-11-24 13:02:40 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_setup_req(
|
|
|
|
ogs_pkbuf_t **pkbuf, S1AP_ENB_ID_PR present, uint32_t enb_id,
|
|
|
|
int tac, uint16_t mcc, uint16_t mnc, uint16_t mnc_len)
|
2017-02-13 07:03:12 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
2018-03-10 03:21:02 +00:00
|
|
|
|
2018-01-05 15:23:26 +00:00
|
|
|
plmn_id_t plmn_id;
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2018-03-10 03:21:02 +00:00
|
|
|
S1AP_S1AP_PDU_t pdu;
|
|
|
|
S1AP_InitiatingMessage_t *initiatingMessage = NULL;
|
|
|
|
S1AP_S1SetupRequest_t *S1SetupRequest = NULL;
|
|
|
|
|
|
|
|
S1AP_S1SetupRequestIEs_t *ie = NULL;
|
|
|
|
S1AP_Global_ENB_ID_t *Global_ENB_ID = NULL;
|
|
|
|
S1AP_SupportedTAs_t *SupportedTAs = NULL;
|
|
|
|
S1AP_SupportedTAs_Item_t *SupportedTAs_Item = NULL;
|
|
|
|
S1AP_PLMNidentity_t *PLMNidentity = NULL;
|
|
|
|
S1AP_PagingDRX_t *PagingDRX = NULL;
|
|
|
|
|
|
|
|
memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
|
|
|
|
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
|
|
|
|
pdu.choice.initiatingMessage =
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_InitiatingMessage_t));
|
2018-03-10 03:21:02 +00:00
|
|
|
|
|
|
|
initiatingMessage = pdu.choice.initiatingMessage;
|
|
|
|
initiatingMessage->procedureCode = S1AP_ProcedureCode_id_S1Setup;
|
|
|
|
initiatingMessage->criticality = S1AP_Criticality_reject;
|
|
|
|
initiatingMessage->value.present =
|
|
|
|
S1AP_InitiatingMessage__value_PR_S1SetupRequest;
|
|
|
|
|
|
|
|
S1SetupRequest = &initiatingMessage->value.choice.S1SetupRequest;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
2018-03-10 03:21:02 +00:00
|
|
|
ASN_SEQUENCE_ADD(&S1SetupRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_Global_ENB_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_reject;
|
|
|
|
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_Global_ENB_ID;
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2018-03-10 03:21:02 +00:00
|
|
|
Global_ENB_ID = &ie->value.choice.Global_ENB_ID;
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
2018-03-10 03:21:02 +00:00
|
|
|
ASN_SEQUENCE_ADD(&S1SetupRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_SupportedTAs;
|
|
|
|
ie->criticality = S1AP_Criticality_reject;
|
|
|
|
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_SupportedTAs;
|
|
|
|
|
|
|
|
SupportedTAs = &ie->value.choice.SupportedTAs;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
2018-03-10 03:21:02 +00:00
|
|
|
ASN_SEQUENCE_ADD(&S1SetupRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_DefaultPagingDRX;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_PagingDRX;
|
|
|
|
|
|
|
|
PagingDRX = &ie->value.choice.PagingDRX;
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
plmn_id_build(&plmn_id, mcc, mnc, mnc_len);
|
2018-01-05 15:23:26 +00:00
|
|
|
|
2018-03-10 03:21:02 +00:00
|
|
|
s1ap_uint32_to_ENB_ID(present, enb_id, &Global_ENB_ID->eNB_ID);
|
2018-01-05 15:23:26 +00:00
|
|
|
s1ap_buffer_to_OCTET_STRING(
|
2018-03-10 03:21:02 +00:00
|
|
|
&plmn_id, PLMN_ID_LEN, &Global_ENB_ID->pLMNidentity);
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2018-03-10 03:21:02 +00:00
|
|
|
SupportedTAs_Item = (S1AP_SupportedTAs_Item_t *)
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_SupportedTAs_Item_t));
|
2018-03-10 03:21:02 +00:00
|
|
|
s1ap_uint16_to_OCTET_STRING(tac, &SupportedTAs_Item->tAC);
|
|
|
|
PLMNidentity = (S1AP_PLMNidentity_t *)
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_PLMNidentity_t));
|
2018-01-05 15:23:26 +00:00
|
|
|
s1ap_buffer_to_OCTET_STRING(
|
2018-03-10 03:21:02 +00:00
|
|
|
&plmn_id, PLMN_ID_LEN, PLMNidentity);
|
|
|
|
ASN_SEQUENCE_ADD(&SupportedTAs_Item->broadcastPLMNs.list, PLMNidentity);
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2018-03-10 03:21:02 +00:00
|
|
|
ASN_SEQUENCE_ADD(&SupportedTAs->list, SupportedTAs_Item);
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2018-03-12 11:38:21 +00:00
|
|
|
*PagingDRX = S1AP_PagingDRX_v64;
|
|
|
|
|
2018-03-10 03:21:02 +00:00
|
|
|
rv = s1ap_encode_pdu(pkbuf, &pdu);
|
|
|
|
s1ap_free_pdu(&pdu);
|
2017-02-14 00:09:01 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (rv != OGS_OK) {
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_error("s1ap_encode_pdu() failed");
|
|
|
|
return OGS_ERROR;
|
2017-02-13 07:03:12 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-02-13 07:03:12 +00:00
|
|
|
}
|
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
#define TESTS1AP_MAX_MESSAGE 64
|
2017-02-13 07:03:12 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_initial_ue_msg(ogs_pkbuf_t **pkbuf, int i)
|
2017-03-05 07:49:57 +00:00
|
|
|
{
|
2017-04-14 11:20:00 +00:00
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"000c405800000500 0800020001001a00 302f177ca0b38802 0741020809101010"
|
2017-12-14 12:42:19 +00:00
|
|
|
"3254869104e060c0 4000050221d031d1 5c0a003103e5e034 9011035758a65d01"
|
2017-12-11 07:55:11 +00:00
|
|
|
"00004300060000f1 1030390064400800 00f1101079baf000 86400130",
|
2017-04-14 11:20:00 +00:00
|
|
|
|
2018-03-11 05:38:35 +00:00
|
|
|
"000c40809b000005 000800020002001a 00737217400466af 070741020bf600f1"
|
|
|
|
"10000201fd001710 05e060c040010021 0221d011d1271a80 8021100100001081"
|
|
|
|
"0600000000830600 000000000d00000a 005255f50110225c 0a003103e5c03e13"
|
|
|
|
"55f501aaaa110357 58a6200b601404ef 65233b8878d29040 080402600400021f"
|
|
|
|
"025d0107e0004300 060000f110303900 6440080055f50100 19d0100086400130",
|
|
|
|
|
|
|
|
"000c40809b00"
|
|
|
|
"0005000800020003 001a007372178c 3e3cff070741020b f600f11000020100"
|
2017-07-28 03:48:49 +00:00
|
|
|
"00000905e060c040 0100210204d011d1 271a808021100100 0010810600000000"
|
2017-07-27 12:50:55 +00:00
|
|
|
"830600000000000d 00000a005255f501 10225c0a003103e5 c03e1355f501aaaa"
|
|
|
|
"11035758a6200b60 1404ef65233b8878 d290400804026004 00021f025d0107e0"
|
2018-01-02 09:18:45 +00:00
|
|
|
"004300060000f110 3039006440080055 f5010019d0100086 400130",
|
2017-07-26 09:49:56 +00:00
|
|
|
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2017-04-14 11:20:00 +00:00
|
|
|
"000c406800000500 080002001f001a00 403f074172080910 10103254866202e0"
|
|
|
|
"600021023cd011d1 271a808021100100 0010810600000000 830600000000000d"
|
|
|
|
"00000a005c0a0090 11034f18a6f15d01 00004300060000f1 1030390064400800"
|
|
|
|
"00f110002343d000 86400130",
|
2017-07-25 07:22:53 +00:00
|
|
|
|
2018-03-11 07:36:51 +00:00
|
|
|
"000c405200000500 0800020011001a 002a2917acba67c4 8207410108091010"
|
2017-07-26 14:27:03 +00:00
|
|
|
"103254866205f0f0 000000000e023cd0 11d1270780000a00 000d00c100430006"
|
2017-12-11 07:55:11 +00:00
|
|
|
"0000f11030390064 40080000f1109d67 aa500086400130",
|
2017-07-26 12:58:14 +00:00
|
|
|
|
2018-03-11 07:36:51 +00:00
|
|
|
"000c405200000500 0800020021001a 002a2917bcba67c4 8207410108091010"
|
2017-12-19 08:05:54 +00:00
|
|
|
"000000003005f0f0 000000000e023cd0 11d1270780000a00 000d00c100430006"
|
2017-12-11 07:55:11 +00:00
|
|
|
"0000f11030390064 40080000f1109d67 aa500086400130",
|
2017-07-26 09:49:56 +00:00
|
|
|
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
2017-07-25 07:22:53 +00:00
|
|
|
"000c"
|
|
|
|
"404c000005000800 020002001a002423 0741710809101010 3254767905f0f000"
|
2017-12-11 07:55:11 +00:00
|
|
|
"0000000e0201d011 d1270780000a0000 0d00c10043000600 00f1103039006440"
|
2017-07-25 07:22:53 +00:00
|
|
|
"080000f11054f640 100086400130",
|
2017-07-26 02:28:43 +00:00
|
|
|
"",
|
2017-12-19 08:05:54 +00:00
|
|
|
"000c"
|
|
|
|
"4070000005000800 020001001a004847 0741720809101000 0000002004f07000"
|
|
|
|
"000023020ed03127 1d80802110010000 1081060000000083 0600000000000d00"
|
|
|
|
"000300000a005c0a 003103e5e0349011 035758a65d010000 4300060000f11030"
|
|
|
|
"39006440080000f1 100019b010008640 0130",
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2018-01-19 18:11:20 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
2017-09-11 09:41:14 +00:00
|
|
|
"000c"
|
|
|
|
"4068000005000800 020001001a00403f 0741720809101010 3254861002e06000"
|
|
|
|
"210207d011d1271a 8080211001000010 8106000000008306 00000000000d0000"
|
2017-12-11 07:55:11 +00:00
|
|
|
"0a005c0a00901103 4f18a6f15d010000 4300060000f11030 39006440080000f1"
|
2017-09-11 09:41:14 +00:00
|
|
|
"1004615380008640 0130",
|
2017-09-12 04:54:55 +00:00
|
|
|
|
|
|
|
"000c"
|
2017-09-12 14:07:55 +00:00
|
|
|
"4080830000060008 0002000c001a0050 4f1744b524490507 41020bf600f11000"
|
|
|
|
"0201010003e802e0 6000210204d011d1 271a808021100100 0010810600000000"
|
|
|
|
"830600000000000d 00000a005200f110 30395c0a00901103 4f18a6f15d0100e0"
|
|
|
|
"004300060000f110 3039006440080000 f110001f20a00086 400130004b000700"
|
|
|
|
"00f110000201",
|
2017-12-19 08:05:54 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 12 */
|
2018-01-19 18:11:20 +00:00
|
|
|
"000c"
|
|
|
|
"4080810000050008 000340072d001a00 5857074172080910 10103254967305e0"
|
|
|
|
"60c0401100270209 d031d12720808021 1001000010810600 0000008306000000"
|
|
|
|
"00000d0000030000 0a000010005c0a00 3103e5e02e901103 5758a64008040260"
|
|
|
|
"0000021f005d0103 c1004300060000f1 1030390064400800 00f1100787b80000"
|
|
|
|
"86400130",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 15 */
|
2019-04-27 14:54:30 +00:00
|
|
|
"000c"
|
|
|
|
"404c000005000800 020018001a002423 0741710839011094 7856044005e0e000"
|
|
|
|
"0000000e0201d011 d1270780000a0000 0d00c10043000600 1300410033006440"
|
|
|
|
"08001300418d01b7 800086400130",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 18 */
|
|
|
|
"000c408096000005 000800020001001a 006e6d177d3278f5 090741020bf609f1"
|
|
|
|
"07000201ca001310 05f0f0c040090021 0234d011d1271a80 8021100101001081"
|
|
|
|
"0600000000830600 000000000d000010 005209f10700075c 08033103e5e07e90"
|
|
|
|
"1103571882200a60 140462918100127e 00400800021f0004 0240045d0100e0c1"
|
|
|
|
"004300060009f107 0007006440080009 f1070019b0100086 400130",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 21 */
|
|
|
|
"000c407400000700 08000200d0001a00 3c3b17c000c55201 0741010bf600f110"
|
|
|
|
"000201c5001d9005 f0f0000000001702 01d011d027108000 0a00000d00001000"
|
|
|
|
"ff00031301845264 f0130002e0004300 060000f110303900 6440080000f11000"
|
|
|
|
"0640100086400130 004b00070000f110 02000100aa400100",
|
|
|
|
"000c407400000700 08000200d1001a00 3c3b17f1f96e4a02 0741010bf600f110"
|
|
|
|
"000201c5001d9005 f0f0000000001702 01d011d027108000 0a00000d00001000"
|
|
|
|
"ff00031301845264 f0130002e0004300 060000f110303900 6440080000f11000"
|
|
|
|
"0640100086400130 004b00070000f110 02000100aa400100",
|
|
|
|
"",
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-04-14 11:20:00 +00:00
|
|
|
92,
|
2018-03-11 05:38:35 +00:00
|
|
|
160,
|
|
|
|
160,
|
2017-07-26 09:49:56 +00:00
|
|
|
|
2017-04-14 11:20:00 +00:00
|
|
|
108,
|
2018-03-11 07:36:51 +00:00
|
|
|
86,
|
|
|
|
86,
|
2017-07-26 09:49:56 +00:00
|
|
|
|
2017-07-25 07:22:53 +00:00
|
|
|
80,
|
2017-07-26 02:28:43 +00:00
|
|
|
0,
|
2017-12-19 08:05:54 +00:00
|
|
|
116,
|
2017-09-11 09:41:14 +00:00
|
|
|
|
|
|
|
108,
|
2017-09-12 14:07:55 +00:00
|
|
|
136,
|
2017-12-19 08:05:54 +00:00
|
|
|
0,
|
|
|
|
|
2018-01-19 18:11:20 +00:00
|
|
|
134,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
80,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
155,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
120,
|
|
|
|
120,
|
|
|
|
0,
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2017-03-25 01:45:49 +00:00
|
|
|
char hexbuf[MAX_SDU_LEN];
|
2017-03-05 07:49:57 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-03-05 07:49:57 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-03-05 07:49:57 +00:00
|
|
|
}
|
2017-03-06 12:45:41 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_identity_response(ogs_pkbuf_t **pkbuf, int i)
|
2017-07-28 03:48:49 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"000d"
|
2018-03-11 05:38:35 +00:00
|
|
|
"403e000005000000 05c00100009f0008 00020003001a00 121117d7e3248b57"
|
2017-07-28 03:48:49 +00:00
|
|
|
"0756080910101032 5486510064400800 00f11054f6401000 4340060000f1105b"
|
|
|
|
"a0",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2017-07-28 03:48:49 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
2017-09-12 14:07:55 +00:00
|
|
|
"",
|
|
|
|
"000d"
|
|
|
|
"403e000005000000 05c0020000c40008 0002000c001a0012 1117c07eb5f50607"
|
|
|
|
"5608091010103254 8651006440080000 f110001f20a00043 40060000f1103039",
|
2019-06-15 12:18:16 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 18 */
|
|
|
|
"000d403b00000500 0000020001000800 020001001a001211 177b973f4c0a0756"
|
2019-06-17 04:28:39 +00:00
|
|
|
"0829262400001118 93006440080009f1 070019b010004340 060009f1070007",
|
2019-06-15 12:18:16 +00:00
|
|
|
"",
|
|
|
|
"",
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
"000d403b00000500 00000200d0000800 0200d0001a001211 17d2074692020756"
|
|
|
|
"0839118900000070 52006440080064f0 1300064010004340 060064f0130002",
|
|
|
|
"000d403b00000500 00000200d1000800 0200d1001a001211 170baa6c40030756"
|
|
|
|
"0839118900000070 52006440080064f0 1300064010004340 060064f0130002",
|
|
|
|
"",
|
2017-07-28 03:48:49 +00:00
|
|
|
};
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-07-28 03:48:49 +00:00
|
|
|
0,
|
|
|
|
0,
|
2018-03-11 05:38:35 +00:00
|
|
|
66,
|
2017-07-28 03:48:49 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
2017-09-12 14:07:55 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
66,
|
2019-06-15 12:18:16 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
63,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
63,
|
|
|
|
63,
|
|
|
|
0,
|
2017-07-28 03:48:49 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-07-28 03:48:49 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-07-28 03:48:49 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_authentication_response(ogs_pkbuf_t **pkbuf, int i)
|
2017-03-06 12:45:41 +00:00
|
|
|
{
|
2017-04-14 11:20:00 +00:00
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 0 */
|
2017-04-14 11:20:00 +00:00
|
|
|
"000d403e00000500 000005c00100009d 000800020001001a 001211177c0bca9d"
|
|
|
|
"030753086a91970e 838fd07900644008 0000f1101079baf0 004340060000f110"
|
|
|
|
"5ba0",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2017-04-14 11:20:00 +00:00
|
|
|
"000d403500000500 0000020001000800 02001f001a000c0b 07530831c964f076"
|
2017-07-25 07:22:53 +00:00
|
|
|
"1378760064400800 00f110002343d000 4340060000f11030 39",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
2017-07-25 07:22:53 +00:00
|
|
|
"000d"
|
|
|
|
"4038000005000000 05c0020000c80008 00020002001a000c 0b0753087dc78e7c"
|
|
|
|
"421f9eb900644008 0000f11054f64010 004340060000f110 2b67",
|
2017-07-26 02:28:43 +00:00
|
|
|
"",
|
2017-12-19 08:05:54 +00:00
|
|
|
"000d"
|
|
|
|
"4035000005000000 0200010008000200 01001a000c0b0753 08d8b388ddacaa1f"
|
|
|
|
"36006440080000f1 100019b010004340 060000f1100001",
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
2017-09-11 09:41:14 +00:00
|
|
|
"000d"
|
|
|
|
"4038000005000000 05c0010001da0008 00020001001a000c 0b0753084ce11ef1"
|
|
|
|
"24b1854500644008 0000f11004615380 004340060000f110 5ba0",
|
2017-09-12 14:07:55 +00:00
|
|
|
"000d"
|
|
|
|
"403e000005000000 05c0020000c40008 0002000c001a0012 1117deff957c0707"
|
|
|
|
"5308e3b925330735 7093006440080000 f110001f20a00043 40060000f1103039",
|
2018-01-19 18:11:20 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 12 */
|
2018-01-19 18:11:20 +00:00
|
|
|
"000d"
|
|
|
|
"4036000005000000 0200020008000340 072d001a000c0b07 5308e2b7921bc6fe"
|
|
|
|
"b4c9006440080000 f1100787b8000043 40060000f1103039",
|
|
|
|
"",
|
|
|
|
"",
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 15 */
|
2019-04-27 14:54:30 +00:00
|
|
|
"000d"
|
|
|
|
"4038000005000000 05c001a001020008 00020018001a000c 0b0753082a080419"
|
|
|
|
"d7becfdb00644008 001300418d01b780 0043400600130041 0033",
|
|
|
|
"",
|
|
|
|
"",
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
/* 18 */
|
|
|
|
"000d403b00000500 0000020001000800 020001001a001211 17fda45fe50b0753"
|
|
|
|
"086f7ff4fc4be85f d1006440080009f1 070019b010004340 060009f1070007",
|
|
|
|
"",
|
|
|
|
"",
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
"000d403b00000500 00000200d0000800 0200d0001a001211 17c3cf6653030753"
|
|
|
|
"0831c964f0761378 76006440080064f0 1300064010004340 060064f0130002",
|
|
|
|
"000d403b00000500 00000200d1000800 0200d1001a001211 17e41759f6040753"
|
|
|
|
"0831c964f0761378 76006440080064f0 1300064010004340 060064f0130002",
|
|
|
|
"",
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2017-07-25 07:22:53 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-04-14 11:20:00 +00:00
|
|
|
66,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-04-14 11:20:00 +00:00
|
|
|
57,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-07-25 07:22:53 +00:00
|
|
|
60,
|
2017-07-26 02:28:43 +00:00
|
|
|
0,
|
2017-12-19 08:05:54 +00:00
|
|
|
57,
|
2017-09-11 09:41:14 +00:00
|
|
|
|
|
|
|
60,
|
2017-09-12 14:07:55 +00:00
|
|
|
66,
|
2018-01-19 18:11:20 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
58,
|
|
|
|
0,
|
|
|
|
0,
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
60,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
63,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
63,
|
|
|
|
63,
|
|
|
|
0,
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2017-03-25 01:45:49 +00:00
|
|
|
char hexbuf[MAX_SDU_LEN];
|
2017-03-06 12:45:41 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-03-06 12:45:41 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-03-06 12:45:41 +00:00
|
|
|
}
|
2017-03-07 05:47:17 +00:00
|
|
|
|
2017-12-18 08:10:44 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_authentication_failure(ogs_pkbuf_t **pkbuf, int i)
|
2017-12-17 15:01:07 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"000d"
|
2018-02-07 05:12:40 +00:00
|
|
|
"403d000005000000 0200030008000200 21001a001413075c 15300e61640edcfb"
|
2017-12-18 08:10:44 +00:00
|
|
|
"605d25911423ee1f 9e006440080000f1 100019b010004340 060000f1100001",
|
2018-02-07 05:12:40 +00:00
|
|
|
"000d"
|
2018-03-11 07:36:51 +00:00
|
|
|
"402d000005000000 0200030008000200 21001a00040307 5c14006440080000"
|
2018-02-07 05:12:40 +00:00
|
|
|
"f1101a2d10100043 40060000f1100001",
|
|
|
|
"",
|
|
|
|
|
2017-12-17 15:01:07 +00:00
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-17 15:01:07 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
65,
|
2018-03-11 07:36:51 +00:00
|
|
|
49,
|
2018-02-07 05:12:40 +00:00
|
|
|
0,
|
2017-12-17 15:01:07 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-12-17 15:01:07 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-17 15:01:07 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_security_mode_complete(ogs_pkbuf_t **pkbuf, int i)
|
2017-03-07 05:47:17 +00:00
|
|
|
{
|
2017-04-14 11:20:00 +00:00
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"000d403500000500 000005c00100009d 000800020001001a 000908476b8f5f64"
|
|
|
|
"00075e0064400800 00f1101079baf000 4340060000f1105b a0",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2017-04-14 11:20:00 +00:00
|
|
|
"000d403200000500 0000020001000800 02001f001a000908 473c0c819e00075e"
|
|
|
|
"006440080000f110 002343d000434006 0000f1103039",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
2017-07-25 07:22:53 +00:00
|
|
|
"000d"
|
|
|
|
"4035000005000000 05c0020000c80008 00020002001a0009 0847c0eb1eb80007"
|
|
|
|
"5e006440080000f1 1054f64010004340 060000f1102b67",
|
2017-07-26 02:28:43 +00:00
|
|
|
"",
|
2017-12-19 08:05:54 +00:00
|
|
|
"000d"
|
|
|
|
"4032000005000000 0200010008000200 01001a00090847c8 38f8d700075e0064"
|
|
|
|
"40080000f1100019 b010004340060000 f1100001",
|
2017-07-26 02:28:43 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
2017-09-11 09:41:14 +00:00
|
|
|
"000d"
|
|
|
|
"4035000005000000 05c0010001da0008 00020001001a0009 0847d3b0ef030007"
|
|
|
|
"5e006440080000f1 1004615380004340 060000f1105ba0",
|
|
|
|
|
2017-09-12 14:07:55 +00:00
|
|
|
"000d"
|
|
|
|
"4035000005000000 05c0020000c40008 0002000c001a0009 084790282df90007"
|
|
|
|
"5e006440080000f1 10001f20a0004340 060000f1103039",
|
2018-01-19 18:11:20 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 12 */
|
2018-01-19 18:11:20 +00:00
|
|
|
"000d"
|
|
|
|
"4033000005000000 0200020008000340 072d001a00090847 aaaf94cf00075e00"
|
|
|
|
"6440080000f11007 87b8000043400600 00f1103039",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 15 */
|
2019-04-27 14:54:30 +00:00
|
|
|
"000d"
|
|
|
|
"4035000005000000 05c001a001020008 00020018001a0009 084785cfd7fa0007"
|
|
|
|
"5e00644008001300 418d01b780004340 06001300410033",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 18 */
|
|
|
|
"000d403200000500 0000020001000800 020001001a000908 470ba943dd00075e"
|
|
|
|
"006440080009f107 0019b01000434006 0009f1070007",
|
|
|
|
"",
|
|
|
|
"",
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
2019-07-04 13:48:26 +00:00
|
|
|
"000d403200000500 00000200d0000800 0200d0001a000908 473c0c819e00075e"
|
2019-06-29 06:40:52 +00:00
|
|
|
"006440080064f013 0006401000434006 0064f0130002",
|
2019-07-04 13:48:26 +00:00
|
|
|
"000d403200000500 00000200d1000800 0200d1001a000908 47e68241c900075e"
|
2019-06-29 06:40:52 +00:00
|
|
|
"006440080064f013 0006401000434006 0064f0130002",
|
|
|
|
"",
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-04-14 11:20:00 +00:00
|
|
|
57,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-04-14 11:20:00 +00:00
|
|
|
54,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-07-25 07:22:53 +00:00
|
|
|
57,
|
2017-07-26 02:28:43 +00:00
|
|
|
0,
|
2017-12-19 08:05:54 +00:00
|
|
|
54,
|
2017-09-11 09:41:14 +00:00
|
|
|
|
|
|
|
57,
|
2017-09-12 14:07:55 +00:00
|
|
|
57,
|
2018-01-19 18:11:20 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
55,
|
|
|
|
0,
|
|
|
|
0,
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
57,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
54,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
54,
|
|
|
|
54,
|
|
|
|
0,
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2017-03-25 01:45:49 +00:00
|
|
|
char hexbuf[MAX_SDU_LEN];
|
2017-03-07 05:47:17 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-03-07 05:47:17 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-03-07 05:47:17 +00:00
|
|
|
}
|
2017-04-11 05:26:54 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_esm_information_response(ogs_pkbuf_t **pkbuf, int i)
|
2017-04-11 05:26:54 +00:00
|
|
|
{
|
2017-04-14 11:20:00 +00:00
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2017-04-11 05:26:54 +00:00
|
|
|
"000d40808d000005 00000005c0010000 9d00080002000100 1a006160275c0667"
|
|
|
|
"58010221da280908 696e7465726e6574 274a80c223150100 001510c09a2626c0"
|
|
|
|
"9a2626c09a2626c0 9a2626c223150200 0015103d3dda5c72 4cc497354ae64653"
|
|
|
|
"45a8088021100100 0010810600000000 830600000000000d 00000a0000644008"
|
2017-04-14 11:20:00 +00:00
|
|
|
"0000f1101079baf0 004340060000f110 5ba0",
|
2018-01-11 13:12:48 +00:00
|
|
|
"000d40808d000005 00000005c0010000 9e00080002000200 1a00616027c963b5"
|
2017-09-23 16:13:51 +00:00
|
|
|
"1b010221da280908 696e7465726e6574 274a80c223150100 001510c09a2626c0"
|
|
|
|
"9a2626c09a2626c0 9a2626c223150200 0015103d3dda5c72 4cc497354ae64653"
|
|
|
|
"45a8088021100100 0010810600000000 830600000000000d 00000a0000644008"
|
|
|
|
"0000f1101079baf0 004340060000f110 5ba0",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2017-04-14 11:20:00 +00:00
|
|
|
"000d403e00000500 0000020001000800 02001f001a001514 27505a0b5301023c"
|
|
|
|
"da280908696e7465 726e657400644008 0000f110002343d0 004340060000f110"
|
2017-07-25 07:22:53 +00:00
|
|
|
"3039",
|
2018-01-28 06:08:52 +00:00
|
|
|
"000d403e00000500 0000020002000800 020011001a001514 27b531c64f01023c"
|
2017-09-23 16:13:51 +00:00
|
|
|
"da280908696e7465 726e657400644008 0000f110002343d0 004340060000f110"
|
|
|
|
"3039",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
2017-07-25 07:22:53 +00:00
|
|
|
"000d"
|
|
|
|
"4041000005000000 05c0020000c80008 00020002001a0015 142793b2bedc0102"
|
|
|
|
"01da280908696e74 65726e6574006440 080000f11054f640 10004340060000f1"
|
2017-09-11 09:41:14 +00:00
|
|
|
"102b67",
|
2017-07-26 02:28:43 +00:00
|
|
|
"",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
2017-09-11 09:41:14 +00:00
|
|
|
"000d"
|
|
|
|
"4041000005000000 05c0010001da0008 00020001001a0015 14279a2476c80102"
|
|
|
|
"07da280908696e74 65726e6574006440 080000f110046153 80004340060000f1"
|
|
|
|
"105ba0",
|
2017-09-12 14:07:55 +00:00
|
|
|
"000d"
|
|
|
|
"4041000005000000 05c0020000c40008 0002000c001a0015 14274f280bff0102"
|
|
|
|
"04da280908696e74 65726e6574006440 080000f110001f20 a0004340060000f1"
|
|
|
|
"103039",
|
2018-01-19 18:11:20 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 12 */
|
2018-01-19 18:11:20 +00:00
|
|
|
"000d"
|
|
|
|
"403f000005000000 0200020008000340 072d001a00151427 c4a524d8010209da"
|
|
|
|
"280908696e746572 6e65740064400800 00f1100787b80000 4340060000f11030"
|
|
|
|
"39",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 15 */
|
2019-04-27 14:54:30 +00:00
|
|
|
"000d"
|
|
|
|
"4044000005000000 05c001a001020008 00020018001a0018 1727fe1c46890102"
|
|
|
|
"01da280c07737461 72656e7403636f6d 0064400800130041 8d01b78000434006"
|
|
|
|
"001300410033",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 18 */
|
|
|
|
"000d405a00000500 0000020001000800 020001001a003130 27ebeeb5d4010234"
|
|
|
|
"da280908696e7465 726e6574271a8080 2110010100108106 0000000083060000"
|
|
|
|
"0000000d00001000 006440080009f107 0019b01000434006 0009f1070007",
|
|
|
|
"",
|
|
|
|
"",
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-04-14 11:20:00 +00:00
|
|
|
146,
|
2017-09-23 16:13:51 +00:00
|
|
|
146,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
|
2017-04-14 11:20:00 +00:00
|
|
|
66,
|
2017-09-23 16:13:51 +00:00
|
|
|
66,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
|
2017-07-25 07:22:53 +00:00
|
|
|
69,
|
2017-07-26 02:28:43 +00:00
|
|
|
0,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
2017-09-11 09:41:14 +00:00
|
|
|
|
|
|
|
69,
|
2017-09-12 14:07:55 +00:00
|
|
|
69,
|
2018-01-19 18:11:20 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
67,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
72,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
94,
|
|
|
|
0,
|
|
|
|
0,
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2017-04-11 05:26:54 +00:00
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-04-11 05:26:54 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-04-11 05:26:54 +00:00
|
|
|
}
|
2017-04-13 14:14:59 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_ue_capability_info_indication(ogs_pkbuf_t **pkbuf, int i)
|
2017-04-13 14:14:59 +00:00
|
|
|
{
|
2017-04-14 11:20:00 +00:00
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"0016"
|
2017-04-13 14:14:59 +00:00
|
|
|
"40809c0000030000 0005c00100009d00 0800020001004a40 8085808304040003"
|
|
|
|
"04ec598007000820 81839b4e1e3ff8ff f1ffc7ff8ffe3ffc 7ff1ffe3ff8fff1f"
|
|
|
|
"fc7ff8ffe3ffc7ff 1ffdfd3ffa7a2060 090e194e9525c8c2 fd80000000e03fe7"
|
|
|
|
"ff5f60000000384f e9ffd3d800000002 1033035758a66014 042f6513b8800d2f"
|
2017-04-14 11:20:00 +00:00
|
|
|
"0831c1a53432b259 ef989007000cdd9c 6331200e0019a332 c662401c003200",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 3 */
|
2017-04-14 11:20:00 +00:00
|
|
|
"0016402d00000300 0000020001000800 02001f004a401a19 00b801014c598080"
|
2017-07-25 07:22:53 +00:00
|
|
|
"9c000bf06ec4d001 40302c0000000000 000000",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 6 */
|
2017-07-25 07:22:53 +00:00
|
|
|
"0016"
|
|
|
|
"403f000003000000 05c0020000c80008 00020002004a4029 28013001023cd980"
|
|
|
|
"00bc000ff06ec4d0 0141b82c00000000 07d404000ef08020 00012a0300008800"
|
|
|
|
"00",
|
2017-07-26 02:28:43 +00:00
|
|
|
"0016"
|
|
|
|
"403f000003000000 05c0020000c70008 00020004004a4029 28013001023cd980"
|
|
|
|
"00bc000ff06ec4d0 0141b82c00000000 07d404000ef08020 00012a0300008800"
|
|
|
|
"00",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 9 */
|
2017-09-11 09:41:14 +00:00
|
|
|
"0016"
|
|
|
|
"4030000003000000 05c0010001da0008 00020001004a401a 1900b801014c5980"
|
|
|
|
"809c000bf06ec4d0 0140302c00000000 0000",
|
2017-09-12 14:07:55 +00:00
|
|
|
"0016"
|
|
|
|
"4030000003000000 05c0020000c40008 0002000c004a401a 1900b801014c5980"
|
|
|
|
"0018000bf06ec4d0 0100302c00000000 0000",
|
2018-01-19 18:11:20 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 12 */
|
2018-01-19 18:11:20 +00:00
|
|
|
"0016"
|
|
|
|
"4080800000030000 0002000200080003 40072d004a406c6b 034803042c998001"
|
|
|
|
"08201838bfc1c5fd bd3ffa8a20400902 3a54930382c60000 00001c4083840008"
|
|
|
|
"0881001c40004042 080060e2ff0717f0 0040000203fa0000 0007e8000000020f"
|
|
|
|
"33035758a6601404 e09c100125600031 218d3432b2386200 40008d17960c4008"
|
|
|
|
"001100",
|
|
|
|
"",
|
|
|
|
"",
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 15 */
|
2019-04-27 14:54:30 +00:00
|
|
|
"0016"
|
|
|
|
"403f000003000000 05c001a001020008 00020018004a4029 28013001023cd980"
|
|
|
|
"00bc000ff06ec4d0 0141b82c00000000 07d404000ef08020 00016a0300008800"
|
|
|
|
"00",
|
|
|
|
"",
|
|
|
|
"",
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
"00164080b6000003 0000000200d00008 000200d0004a4080 a280a00404e80108"
|
|
|
|
"099cd98002a552f0 40b82e0bff06ec4d 00141b8748000000 02a5647400c00c00"
|
|
|
|
"80007d404380e900 04103a8001040ef0 004107a400101a82 003d200080de1001"
|
|
|
|
"ea00040690800f50 00203784007bc001 01a42003de00080d 41000e90004807a4"
|
|
|
|
"00101a42001d4000 900f500020350400 3bc001201ef00040 6f080381705c1705"
|
|
|
|
"c1705c1705c1705c 1705c1705c172a32 0000887003fc0000 000000",
|
|
|
|
"00164080b6000003 0000000200d10008 000200d1004a4080 a280a00404e80108"
|
|
|
|
"099cd98002a552f0 40b82e0bff06ec4d 00141b8748000000 02a5647400c00c00"
|
|
|
|
"80007d404380e900 04103a8001040ef0 004107a400101a82 003d200080de1001"
|
|
|
|
"ea00040690800f50 00203784007bc001 01a42003de00080d 41000e90004807a4"
|
|
|
|
"00101a42001d4000 900f500020350400 3bc001201ef00040 6f080381705c1705"
|
|
|
|
"c1705c1705c1705c 1705c1705c172a32 0000887003fc0000 000000",
|
|
|
|
"",
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-04-14 11:20:00 +00:00
|
|
|
161,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-04-14 11:20:00 +00:00
|
|
|
51,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-07-25 07:22:53 +00:00
|
|
|
67,
|
2017-07-26 02:28:43 +00:00
|
|
|
67,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
2017-09-11 09:41:14 +00:00
|
|
|
|
|
|
|
52,
|
2017-09-12 14:07:55 +00:00
|
|
|
52,
|
2018-01-19 18:11:20 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
133,
|
|
|
|
0,
|
|
|
|
0,
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
67,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
187,
|
|
|
|
187,
|
|
|
|
0,
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2017-04-13 14:14:59 +00:00
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-04-13 14:14:59 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-04-13 14:14:59 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_initial_context_setup_response(
|
|
|
|
ogs_pkbuf_t **pkbuf,
|
|
|
|
uint32_t mme_ue_s1ap_id, uint32_t enb_ue_s1ap_id,
|
|
|
|
uint8_t ebi, uint32_t teid, const char *ipstr)
|
2017-12-08 14:58:50 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
2018-03-10 13:52:21 +00:00
|
|
|
|
|
|
|
S1AP_S1AP_PDU_t pdu;
|
|
|
|
S1AP_SuccessfulOutcome_t *successfulOutcome = NULL;
|
|
|
|
S1AP_InitialContextSetupResponse_t *InitialContextSetupResponse = NULL;
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_sockaddr_t *addr = NULL;
|
2018-03-10 13:52:21 +00:00
|
|
|
|
|
|
|
S1AP_InitialContextSetupResponseIEs_t *ie = NULL;
|
|
|
|
S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_E_RABSetupListCtxtSURes_t *E_RABSetupListCtxtSURes = NULL;
|
|
|
|
|
|
|
|
S1AP_E_RABSetupItemCtxtSUResIEs_t *item = NULL;
|
|
|
|
S1AP_E_RABSetupItemCtxtSURes_t *e_rab = NULL;
|
|
|
|
|
2017-12-08 14:58:50 +00:00
|
|
|
gtp_f_teid_t f_teid;
|
|
|
|
ip_t ip;
|
|
|
|
int len;
|
|
|
|
|
2018-03-10 13:52:21 +00:00
|
|
|
memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
|
|
|
|
pdu.present = S1AP_S1AP_PDU_PR_successfulOutcome;
|
|
|
|
pdu.choice.successfulOutcome =
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_SuccessfulOutcome_t));
|
2018-03-10 13:52:21 +00:00
|
|
|
|
|
|
|
successfulOutcome = pdu.choice.successfulOutcome;
|
|
|
|
successfulOutcome->procedureCode =
|
|
|
|
S1AP_ProcedureCode_id_InitialContextSetup;
|
|
|
|
successfulOutcome->criticality = S1AP_Criticality_reject;
|
|
|
|
successfulOutcome->value.present =
|
|
|
|
S1AP_SuccessfulOutcome__value_PR_InitialContextSetupResponse;
|
2017-12-08 14:58:50 +00:00
|
|
|
|
2018-03-10 13:52:21 +00:00
|
|
|
InitialContextSetupResponse =
|
|
|
|
&successfulOutcome->value.choice.InitialContextSetupResponse;
|
2017-12-08 14:58:50 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
2018-03-10 13:52:21 +00:00
|
|
|
ASN_SEQUENCE_ADD(&InitialContextSetupResponse->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_InitialContextSetupResponseIEs__value_PR_MME_UE_S1AP_ID;
|
2017-12-08 14:58:50 +00:00
|
|
|
|
2018-03-10 13:52:21 +00:00
|
|
|
MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
2018-03-10 13:52:21 +00:00
|
|
|
ASN_SEQUENCE_ADD(&InitialContextSetupResponse->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_InitialContextSetupResponseIEs__value_PR_ENB_UE_S1AP_ID;
|
2017-12-08 14:58:50 +00:00
|
|
|
|
2018-03-10 13:52:21 +00:00
|
|
|
ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
2018-03-10 13:52:21 +00:00
|
|
|
ASN_SEQUENCE_ADD(&InitialContextSetupResponse->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_E_RABSetupListCtxtSURes;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_InitialContextSetupResponseIEs__value_PR_E_RABSetupListCtxtSURes;
|
|
|
|
|
|
|
|
E_RABSetupListCtxtSURes = &ie->value.choice.E_RABSetupListCtxtSURes;
|
|
|
|
|
|
|
|
*MME_UE_S1AP_ID = mme_ue_s1ap_id;
|
|
|
|
*ENB_UE_S1AP_ID = enb_ue_s1ap_id;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
item = ogs_calloc(1, sizeof(S1AP_E_RABSetupItemCtxtSUResIEs_t));
|
2018-03-10 13:52:21 +00:00
|
|
|
ASN_SEQUENCE_ADD(&E_RABSetupListCtxtSURes->list, item);
|
|
|
|
|
|
|
|
item->id = S1AP_ProtocolIE_ID_id_E_RABSetupItemCtxtSURes;
|
|
|
|
item->criticality = S1AP_Criticality_ignore;
|
|
|
|
item->value.present =
|
|
|
|
S1AP_E_RABSetupItemCtxtSUResIEs__value_PR_E_RABSetupItemCtxtSURes;
|
|
|
|
|
|
|
|
e_rab = &item->value.choice.E_RABSetupItemCtxtSURes;
|
2017-12-08 14:58:50 +00:00
|
|
|
|
|
|
|
e_rab->e_RAB_ID = ebi;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
rv = ogs_getaddrinfo(&addr, AF_INET, ipstr, GTPV1_U_UDP_PORT, 0);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
rv = gtp_sockaddr_to_f_teid(addr, NULL, &f_teid, &len);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
ogs_freeaddrinfo(addr);
|
|
|
|
|
2017-12-08 14:58:50 +00:00
|
|
|
rv = gtp_f_teid_to_ip(&f_teid, &ip);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-08 14:58:50 +00:00
|
|
|
|
|
|
|
rv = s1ap_ip_to_BIT_STRING(&ip, &e_rab->transportLayerAddress);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-08 14:58:50 +00:00
|
|
|
s1ap_uint32_to_OCTET_STRING(teid, &e_rab->gTP_TEID);
|
|
|
|
|
2018-03-10 13:52:21 +00:00
|
|
|
rv = s1ap_encode_pdu(pkbuf, &pdu);
|
|
|
|
s1ap_free_pdu(&pdu);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (rv != OGS_OK) {
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_error("s1ap_encode_pdu() failed");
|
|
|
|
return OGS_ERROR;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-07-10 13:04:52 +00:00
|
|
|
int tests1ap_build_ue_context_modification_response(
|
|
|
|
ogs_pkbuf_t **pkbuf,
|
|
|
|
uint32_t mme_ue_s1ap_id, uint32_t enb_ue_s1ap_id)
|
|
|
|
{
|
|
|
|
int rv;
|
|
|
|
|
|
|
|
S1AP_S1AP_PDU_t pdu;
|
|
|
|
S1AP_SuccessfulOutcome_t *successfulOutcome = NULL;
|
|
|
|
S1AP_UEContextModificationResponse_t *UEContextModificationResponse = NULL;
|
|
|
|
ogs_sockaddr_t *addr = NULL;
|
|
|
|
|
|
|
|
S1AP_UEContextModificationResponseIEs_t *ie = NULL;
|
|
|
|
S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
|
|
|
|
|
|
|
|
memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
|
|
|
|
pdu.present = S1AP_S1AP_PDU_PR_successfulOutcome;
|
|
|
|
pdu.choice.successfulOutcome =
|
|
|
|
ogs_calloc(1, sizeof(S1AP_SuccessfulOutcome_t));
|
|
|
|
|
|
|
|
successfulOutcome = pdu.choice.successfulOutcome;
|
|
|
|
successfulOutcome->procedureCode =
|
|
|
|
S1AP_ProcedureCode_id_UEContextModification;
|
|
|
|
successfulOutcome->criticality = S1AP_Criticality_reject;
|
|
|
|
successfulOutcome->value.present =
|
|
|
|
S1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse;
|
|
|
|
|
|
|
|
UEContextModificationResponse =
|
|
|
|
&successfulOutcome->value.choice.UEContextModificationResponse;
|
|
|
|
|
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_UEContextModificationResponseIEs_t));
|
|
|
|
ASN_SEQUENCE_ADD(&UEContextModificationResponse->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_UEContextModificationResponseIEs__value_PR_MME_UE_S1AP_ID;
|
|
|
|
|
|
|
|
MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
|
|
|
|
|
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_UEContextModificationResponseIEs_t));
|
|
|
|
ASN_SEQUENCE_ADD(&UEContextModificationResponse->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_UEContextModificationResponseIEs__value_PR_ENB_UE_S1AP_ID;
|
|
|
|
|
|
|
|
ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
|
|
|
|
|
|
|
|
*MME_UE_S1AP_ID = mme_ue_s1ap_id;
|
|
|
|
*ENB_UE_S1AP_ID = enb_ue_s1ap_id;
|
|
|
|
|
|
|
|
rv = s1ap_encode_pdu(pkbuf, &pdu);
|
|
|
|
s1ap_free_pdu(&pdu);
|
|
|
|
|
|
|
|
if (rv != OGS_OK) {
|
|
|
|
ogs_error("s1ap_encode_pdu() failed");
|
|
|
|
return OGS_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_initial_context_setup_failure(ogs_pkbuf_t **pkbuf, int i)
|
2018-03-15 08:22:45 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"4009 0015000003000040 0200020008400200 01000240020000",
|
|
|
|
"",
|
|
|
|
"",
|
2019-06-13 09:22:34 +00:00
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 3 */
|
2019-06-13 09:22:34 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 6 */
|
2019-06-13 09:22:34 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"4009001500000300 0040020001000840 0200010002400202 a0",
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 9 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 12 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 15 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 18 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
"4009001500000300 00400200d0000840 0200d00002400203 40",
|
2018-03-15 08:22:45 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-15 08:22:45 +00:00
|
|
|
25,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-13 09:22:34 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
25,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
25,
|
|
|
|
0,
|
|
|
|
0,
|
2018-03-15 08:22:45 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2018-03-15 08:22:45 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2018-03-15 08:22:45 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_attach_complete(ogs_pkbuf_t **pkbuf, int i)
|
2017-12-16 09:06:34 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c00100009d0008 00020001001a000e 0d27c183eb950207"
|
|
|
|
"4300035200c20064 40080000f1101079 baf0004340060000 f1105ba0",
|
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c00100009e0008 00020002001a000e 0d27e8a2a3f10207"
|
|
|
|
"4300035200c20064 40080000f1101079 baf0004340060000 f1105ba0",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2018-01-19 06:37:25 +00:00
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c0000000010008 0002001f001a000e 0d27127c47860207"
|
|
|
|
"4300035200c20064 40080000f1101079 baf0004340060000 f1105ba0",
|
2017-12-16 09:06:34 +00:00
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c0010000020008 00020011001a000e 0d27225d92bb0207"
|
|
|
|
"4300035200c20064 40080000f1101079 baf0004340060000 f1105ba0",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
2017-12-16 09:06:34 +00:00
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c0020000c80008 00020002001a000e 0d27f190fc2b0207"
|
|
|
|
"4300035200c20064 40080000f11054f6 4010004340060000 f1102b67",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
2017-12-16 09:06:34 +00:00
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c0010001da0008 00020001001a000e 0d272e3456f70207"
|
|
|
|
"4300035200c20064 40080000f1100461 5380004340060000 f1105ba0",
|
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c0020000c40008 0002000c001a000e 0d276a543e560207"
|
|
|
|
"4300035200c20064 40080000f110001f 20a0004340060000 f1103039",
|
2018-01-19 18:11:20 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 12 */
|
2018-01-19 18:11:20 +00:00
|
|
|
"000d"
|
|
|
|
"4038000005000000 0200020008000340 072d001a000e0d27 600bbd3802074300"
|
|
|
|
"035200c200644008 0000f1100787b800 004340060000f110 3039",
|
|
|
|
"",
|
|
|
|
"",
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 15 */
|
2019-04-27 14:54:30 +00:00
|
|
|
"000d"
|
|
|
|
"403a000005000000 05c001a001020008 00020018001a000e 0d2735fbc1e30207"
|
|
|
|
"4300035200c20064 4008001300418d01 b780004340060013 00410033",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 18 */
|
|
|
|
"000d403700000500 0000020001000800 020001001a000e0d 27ffe827a8020743"
|
|
|
|
"00035200c2006440 080009f1070019b0 10004340060009f1 070007",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-29 06:40:52 +00:00
|
|
|
/* 21 */
|
|
|
|
"",
|
|
|
|
"000d403700000500 00000200d1000800 0200d1001a000e0d 277c78c659010743"
|
|
|
|
"00035200c2006440 080064f013000640 10004340060064f0 130002",
|
|
|
|
"",
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
62,
|
|
|
|
62,
|
|
|
|
0,
|
|
|
|
|
2018-01-19 06:37:25 +00:00
|
|
|
62,
|
2017-12-16 09:06:34 +00:00
|
|
|
62,
|
|
|
|
0,
|
|
|
|
|
|
|
|
62,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
62,
|
|
|
|
62,
|
2018-01-19 18:11:20 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
60,
|
|
|
|
0,
|
|
|
|
0,
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
62,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
59,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
0,
|
|
|
|
59,
|
|
|
|
0,
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_emm_status(ogs_pkbuf_t **pkbuf, int i)
|
2017-12-16 09:06:34 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
2018-01-19 06:37:25 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
|
|
|
"",
|
2018-01-19 06:37:25 +00:00
|
|
|
"000d403300000500 0000020001000800 020001001a000a09 276941dec8020760"
|
|
|
|
"65006440080000f1 10002343d0004340 060000f1103039",
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
2018-01-19 06:37:25 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
|
|
|
0,
|
2018-01-19 06:37:25 +00:00
|
|
|
55,
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_detach_request(ogs_pkbuf_t **pkbuf, int i)
|
2017-12-16 09:06:34 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 05:38:35 +00:00
|
|
|
"000c404800000600 0800020002001a 001615172ba435db 040745090bf600f1"
|
2017-12-16 09:06:34 +00:00
|
|
|
"10000201020003e6 004300060000f110 2b67006440080000 f1109d67aa500086"
|
|
|
|
"4001300060000600 40020003e6",
|
2018-03-15 08:39:41 +00:00
|
|
|
"000c404800000600 0800020001001a 00161517ba258500 040745090bf600f1"
|
2018-01-17 08:17:22 +00:00
|
|
|
"10000201020003e6 004300060000f110 2b67006440080000 f1109d67aa500086"
|
|
|
|
"4001300060000600 40020003e6",
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2019-06-15 14:28:52 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 9 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 12 */
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 15 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 18 */
|
|
|
|
"000d403f00000500 0000020002000800 020002001a001615 2754d17d69040745"
|
|
|
|
"0b0bf609f1070002 01f500075e006440 080009f1070019b0 10004340060009f1"
|
|
|
|
"070007",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 05:38:35 +00:00
|
|
|
76,
|
|
|
|
76,
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
67,
|
|
|
|
0,
|
|
|
|
0,
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_ue_context_release_request(ogs_pkbuf_t **pkbuf, int i)
|
2017-12-16 09:06:34 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-02-02 11:32:13 +00:00
|
|
|
"0012"
|
|
|
|
"4018000003000000 05c00100009d0008 0002000100024002 0280",
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
2017-12-16 09:06:34 +00:00
|
|
|
"0012"
|
|
|
|
"4018000003000000 05c0020000c80008 0002000200024002 0280",
|
|
|
|
"",
|
2019-06-13 09:22:34 +00:00
|
|
|
"0012401500000300 0000020001000800 0200010002400202 a0",
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 12 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 15 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 18 */
|
|
|
|
"0012401500000300 0000020001000800 0200010002400202 80",
|
2019-07-06 13:45:15 +00:00
|
|
|
"0012401500000300 0000020002000800 0200020002400202 e0",
|
2019-06-15 12:18:16 +00:00
|
|
|
"",
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-02-02 11:32:13 +00:00
|
|
|
28,
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
28,
|
|
|
|
0,
|
2019-06-13 09:22:34 +00:00
|
|
|
25,
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
25,
|
2019-07-06 13:45:15 +00:00
|
|
|
25,
|
2019-06-15 12:18:16 +00:00
|
|
|
0,
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-12-08 14:58:50 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-08 14:58:50 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_ue_context_release_complete(ogs_pkbuf_t **pkbuf, int i)
|
2017-04-13 14:14:59 +00:00
|
|
|
{
|
2017-07-25 07:22:53 +00:00
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-01-11 13:12:48 +00:00
|
|
|
"2017001300000200 004005c00100009e 00084003400002",
|
2018-01-17 08:17:22 +00:00
|
|
|
"2017001300000200 004005c000000001 00084003400001",
|
|
|
|
"2017001200000200 004005c00100009f 000840020003",
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 3 */
|
2018-02-02 11:32:13 +00:00
|
|
|
"2017001300000200 004005c00100009d 00084003400001",
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
2018-02-07 05:12:40 +00:00
|
|
|
"2017001300000200 004005c000000003 00084003400021",
|
2017-07-25 07:22:53 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 6 */
|
2017-12-16 09:06:34 +00:00
|
|
|
"2017"
|
|
|
|
"0012000002000040 05c0020000c80008 40020002",
|
2018-02-01 02:56:01 +00:00
|
|
|
"2017"
|
2018-02-04 07:58:56 +00:00
|
|
|
"0012000002000040 05c0020000cb0008 40020026",
|
2018-01-19 06:37:25 +00:00
|
|
|
"2017001200000200 004005c000000001 00084002001f",
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 9 */
|
2017-12-16 09:06:34 +00:00
|
|
|
"2017"
|
|
|
|
"0012000002000040 05c0020000c40008 4002000c",
|
|
|
|
"2017"
|
|
|
|
"0012000002000040 05c0020000c50008 40020008",
|
|
|
|
"2017"
|
|
|
|
"0012000002000040 05c0020000c70008 40020008",
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-06-15 12:18:16 +00:00
|
|
|
/* 12 */
|
2018-01-19 18:11:20 +00:00
|
|
|
"2017"
|
|
|
|
"0010000002000040 0200010008400340 072c",
|
|
|
|
"2017"
|
|
|
|
"0010000002000040 0200030008400340 072e",
|
2019-06-15 12:18:16 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
/* 15 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 18 */
|
|
|
|
"2017000f00000200 0040020001000840 020001",
|
|
|
|
"2017000f00000200 0040020002000840 020002",
|
|
|
|
"",
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
2019-06-30 03:46:02 +00:00
|
|
|
"2017000f00000200 00400200d0000840 0200d0",
|
2019-06-29 06:40:52 +00:00
|
|
|
"",
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
23,
|
|
|
|
23,
|
2018-01-17 08:17:22 +00:00
|
|
|
22,
|
2017-07-26 09:49:56 +00:00
|
|
|
|
2018-02-02 11:32:13 +00:00
|
|
|
23,
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
2018-02-07 05:12:40 +00:00
|
|
|
23,
|
2017-07-26 09:49:56 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
22,
|
2018-02-01 02:56:01 +00:00
|
|
|
22,
|
2018-01-19 06:37:25 +00:00
|
|
|
22,
|
2017-09-11 09:41:14 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
22,
|
|
|
|
22,
|
|
|
|
22,
|
2018-01-19 18:11:20 +00:00
|
|
|
|
|
|
|
20,
|
|
|
|
20,
|
|
|
|
0,
|
2019-06-15 12:18:16 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
19,
|
|
|
|
19,
|
|
|
|
0,
|
2019-06-29 06:40:52 +00:00
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
19,
|
|
|
|
19,
|
|
|
|
0,
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2017-04-13 14:14:59 +00:00
|
|
|
char hexbuf[MAX_SDU_LEN];
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-04-13 14:14:59 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-04-14 11:20:00 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_service_request(ogs_pkbuf_t **pkbuf,
|
|
|
|
uint32_t enb_ue_s1ap_id, uint8_t seq,
|
|
|
|
uint16_t mac, uint32_t m_tmsi)
|
2017-04-14 11:20:00 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 07:36:51 +00:00
|
|
|
"000c"
|
|
|
|
"4037000006000800 020004001a0005 04c7049551004300 060000f110303900"
|
|
|
|
"6440080000f11007 87b8000086400140 0060000600400000 0001",
|
|
|
|
|
2018-01-19 18:11:20 +00:00
|
|
|
"000c"
|
2018-01-21 06:44:30 +00:00
|
|
|
"4038000006000800 03400700001a0005 04c7049551004300 060000f110303900"
|
2018-01-19 18:11:20 +00:00
|
|
|
"6440080000f11007 87b8000086400140 0060000600400000 0001",
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 07:36:51 +00:00
|
|
|
59,
|
2018-01-19 18:11:20 +00:00
|
|
|
60,
|
2017-07-25 12:15:25 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
2018-01-21 06:44:30 +00:00
|
|
|
int i = 0;
|
2018-03-11 07:36:51 +00:00
|
|
|
|
|
|
|
if (enb_ue_s1ap_id & 0x400000) i = 1;
|
2017-07-25 12:15:25 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-07-25 12:15:25 +00:00
|
|
|
|
2018-01-21 06:44:30 +00:00
|
|
|
enb_ue_s1ap_id = htonl(enb_ue_s1ap_id << 8);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 11, &enb_ue_s1ap_id, 2+i);
|
2018-01-21 06:44:30 +00:00
|
|
|
mac = htons(mac);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 19+i, &seq, 1);
|
|
|
|
memcpy((*pkbuf)->data + 20+i, &mac, 2);
|
2018-01-21 06:44:30 +00:00
|
|
|
m_tmsi = htonl(m_tmsi);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 55+i, &m_tmsi, 4);
|
2018-01-21 06:44:30 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-07-25 12:15:25 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_tau_request(ogs_pkbuf_t **pkbuf, int i,
|
|
|
|
uint32_t mme_ue_s1ap_id, uint32_t enb_ue_s1ap_id, uint8_t active_flag,
|
|
|
|
uint32_t m_tmsi, uint8_t seq, uint32_t mac, uint8_t *knas_int)
|
2018-02-01 02:56:01 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-02-02 06:30:25 +00:00
|
|
|
/* Initial UE Message */
|
2018-02-01 02:56:01 +00:00
|
|
|
"000c"
|
|
|
|
"406d000006000800 020035001a003b3a 1797c955d80a0748 010bf600f1100002"
|
|
|
|
"01d900a79e5805f0 f0c040005200f110 30395c1004570220 003103e561249011"
|
2018-02-04 07:58:56 +00:00
|
|
|
"033358a25d0103d0 e0c1004300060000 f110303900644008 0000f11054f64010"
|
2018-02-01 02:56:01 +00:00
|
|
|
"0086400130006000 060040d900a79e",
|
2018-02-02 06:30:25 +00:00
|
|
|
/* Uplink NAS Transport */
|
|
|
|
"000d"
|
|
|
|
"4063000005000000 0200030008000200 01001a003a39178a c93785030748010b"
|
|
|
|
"f600f110000201d6 004ae05805f070c0 40185200f110303a 5c0a005702200031"
|
|
|
|
"03e5e03490110357 58a65d0100e0c100 6440080000f11000 02cf900043400600"
|
|
|
|
"00f1103039",
|
|
|
|
"",
|
2018-02-01 02:56:01 +00:00
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-02-01 02:56:01 +00:00
|
|
|
113,
|
2018-02-02 06:30:25 +00:00
|
|
|
103,
|
|
|
|
0,
|
2018-02-01 02:56:01 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2018-02-01 02:56:01 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (i == 0) {
|
2018-02-02 06:30:25 +00:00
|
|
|
enb_ue_s1ap_id = htonl(enb_ue_s1ap_id << 8);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 11, &enb_ue_s1ap_id, 3);
|
2019-06-18 06:32:01 +00:00
|
|
|
if (active_flag) {
|
2019-04-27 14:54:30 +00:00
|
|
|
char *active_buf = (*pkbuf)->data + 26;
|
2018-02-04 07:58:56 +00:00
|
|
|
*active_buf |= 0x08;
|
|
|
|
}
|
2018-02-02 06:30:25 +00:00
|
|
|
mac = htonl(mac);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 19, &mac, 4);
|
|
|
|
memcpy((*pkbuf)->data + 23, &seq, 1);
|
2018-02-02 06:30:25 +00:00
|
|
|
m_tmsi = htonl(m_tmsi);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 109, &m_tmsi, 4);
|
2019-06-18 06:32:01 +00:00
|
|
|
} else if (i == 1) {
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(knas_int);
|
2018-02-02 06:30:25 +00:00
|
|
|
|
|
|
|
mme_ue_s1ap_id = htonl(mme_ue_s1ap_id << 8);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 11, &mme_ue_s1ap_id, 3);
|
2018-02-02 06:30:25 +00:00
|
|
|
enb_ue_s1ap_id = htonl(enb_ue_s1ap_id << 8);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 17, &enb_ue_s1ap_id, 3);
|
2018-02-02 06:30:25 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 29, &seq, 1);
|
2018-02-02 06:30:25 +00:00
|
|
|
|
|
|
|
m_tmsi = htonl(m_tmsi);
|
2019-04-27 14:54:30 +00:00
|
|
|
memcpy((*pkbuf)->data + 41, &m_tmsi, 4);
|
2018-02-02 06:30:25 +00:00
|
|
|
|
|
|
|
snow_3g_f9(knas_int, seq, (0 << 27), 0,
|
2019-04-27 14:54:30 +00:00
|
|
|
(*pkbuf)->data + 29, (52 << 3),
|
|
|
|
(*pkbuf)->data + 25);
|
2019-06-18 06:32:01 +00:00
|
|
|
} else
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert_if_reached();
|
2018-02-01 02:56:01 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2018-02-01 02:56:01 +00:00
|
|
|
}
|
|
|
|
|
2019-07-08 09:15:19 +00:00
|
|
|
int tests1ap_build_extended_service_request(ogs_pkbuf_t **pkbuf, int i,
|
|
|
|
uint8_t service_type, uint32_t m_tmsi, uint8_t seq, uint8_t *knas_int)
|
2019-07-06 13:16:13 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 3 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 6 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 9 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 12 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 15 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
/* 18 */
|
|
|
|
"000c"
|
|
|
|
"4038000005000800 020002001a00100f 17b51a57a504074c 000504e900a25200"
|
|
|
|
"4300060009f10700 07006440080009f1 0707080140008640 0130",
|
2019-07-10 13:04:52 +00:00
|
|
|
|
|
|
|
"000d403900000500 0000020001000800 020001001a00100f 17b51a57a504074c"
|
|
|
|
"000504e900a25200 6440080009f10700 19b0100043400600 09f1070007",
|
2019-07-06 13:16:13 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
};
|
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
60,
|
2019-07-10 13:04:52 +00:00
|
|
|
61,
|
2019-07-06 13:16:13 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
/* 21 */
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2019-07-10 13:04:52 +00:00
|
|
|
if (i == 18) {
|
|
|
|
memcpy((*pkbuf)->data + 26, &service_type, sizeof service_type);
|
|
|
|
m_tmsi = htonl(m_tmsi);
|
|
|
|
memcpy((*pkbuf)->data + 29, &m_tmsi, sizeof m_tmsi);
|
2019-07-06 13:16:13 +00:00
|
|
|
|
2019-07-10 13:04:52 +00:00
|
|
|
snow_3g_f9(knas_int, seq, (0 << 27), 0,
|
|
|
|
(*pkbuf)->data + 23, (10 << 3),
|
|
|
|
(*pkbuf)->data + 19);
|
|
|
|
} else if (i == 19) {
|
|
|
|
memcpy((*pkbuf)->data + 32, &service_type, sizeof service_type);
|
|
|
|
m_tmsi = htonl(m_tmsi);
|
|
|
|
memcpy((*pkbuf)->data + 35, &m_tmsi, sizeof m_tmsi);
|
|
|
|
snow_3g_f9(knas_int, seq, (0 << 27), 0,
|
|
|
|
(*pkbuf)->data + 29, (10 << 3),
|
|
|
|
(*pkbuf)->data + 25);
|
|
|
|
}
|
2019-07-06 13:16:13 +00:00
|
|
|
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_pdn_connectivity_request(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-07-26 05:18:28 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40640000"
|
|
|
|
"0500000002 0001000800020001 001a003b3a277c 81dab50a0205d011"
|
2017-12-16 09:06:34 +00:00
|
|
|
"281208696e746572 6e6574036e673204 6d6e6574271a8080 2110010000108106"
|
|
|
|
"0000000083060000 0000000d00000a00 006440080055f501 0019d01000434006"
|
|
|
|
"0055f5011022",
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40640000"
|
|
|
|
"0500000002 0001000800020001 001a003b3a2710 3fdafa0a0209d011"
|
2017-12-16 09:06:34 +00:00
|
|
|
"281208706e746572 6e6574036e673204 6d6e6574271a8080 2110010000108106"
|
|
|
|
"0000000083060000 0000000d00000a00 006440080055f501 0019d01000434006"
|
|
|
|
"0055f5011022",
|
|
|
|
"",
|
2017-07-26 05:18:28 +00:00
|
|
|
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
2017-07-26 05:18:28 +00:00
|
|
|
"",
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
2017-07-26 05:18:28 +00:00
|
|
|
|
|
|
|
"",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
"",
|
2017-07-26 05:18:28 +00:00
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
108,
|
|
|
|
108,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-07-26 05:18:28 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-07-26 05:18:28 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-07-26 05:18:28 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_pdn_disconnectivity_request(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-07-25 12:15:25 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40370000"
|
|
|
|
"0500000005c08000 0108000800020001 001a000b0a2732 423c53040206d206"
|
2017-12-16 09:06:34 +00:00
|
|
|
"006440080055f501 0019d01000434006 0055f5011022",
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40370000"
|
|
|
|
"0500000005c08000 0108000800020001 001a000b0a2777 693066040206d206"
|
2018-01-17 08:17:22 +00:00
|
|
|
"006440080055f501 0019d01000434006 0055f5011022",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
2017-07-25 12:15:25 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
2017-07-26 02:28:43 +00:00
|
|
|
"",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
2017-07-26 02:28:43 +00:00
|
|
|
|
2017-07-25 12:15:25 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
59,
|
|
|
|
59,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
2017-07-26 02:28:43 +00:00
|
|
|
0,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
2017-07-25 12:15:25 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-07-25 12:15:25 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-07-25 12:15:25 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_e_rab_setup_response(
|
|
|
|
ogs_pkbuf_t **pkbuf,
|
|
|
|
uint32_t mme_ue_s1ap_id, uint32_t enb_ue_s1ap_id,
|
|
|
|
uint8_t ebi, uint32_t teid, const char *ipstr)
|
2017-07-25 12:15:25 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
|
|
|
ogs_sockaddr_t *addr = NULL;
|
2018-03-11 11:41:37 +00:00
|
|
|
|
|
|
|
S1AP_S1AP_PDU_t pdu;
|
|
|
|
S1AP_SuccessfulOutcome_t *successfulOutcome = NULL;
|
|
|
|
S1AP_E_RABSetupResponse_t *E_RABSetupResponse = NULL;
|
|
|
|
|
|
|
|
S1AP_E_RABSetupResponseIEs_t *ie = NULL;
|
|
|
|
S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_E_RABSetupListBearerSURes_t *E_RABSetupListBearerSURes = NULL;
|
|
|
|
|
|
|
|
S1AP_E_RABSetupItemBearerSUResIEs_t *item = NULL;
|
|
|
|
S1AP_E_RABSetupItemBearerSURes_t *e_rab = NULL;
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
gtp_f_teid_t f_teid;
|
|
|
|
ip_t ip;
|
|
|
|
int len;
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
|
|
|
|
pdu.present = S1AP_S1AP_PDU_PR_successfulOutcome;
|
|
|
|
pdu.choice.successfulOutcome =
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_SuccessfulOutcome_t));
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
successfulOutcome = pdu.choice.successfulOutcome;
|
|
|
|
successfulOutcome->procedureCode = S1AP_ProcedureCode_id_E_RABSetup;
|
|
|
|
successfulOutcome->criticality = S1AP_Criticality_reject;
|
|
|
|
successfulOutcome->value.present =
|
|
|
|
S1AP_SuccessfulOutcome__value_PR_E_RABSetupResponse;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
E_RABSetupResponse = &successfulOutcome->value.choice.E_RABSetupResponse;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
|
2018-03-11 11:41:37 +00:00
|
|
|
ASN_SEQUENCE_ADD(&E_RABSetupResponse->protocolIEs, ie);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_MME_UE_S1AP_ID;
|
|
|
|
|
|
|
|
MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
|
2018-03-11 11:41:37 +00:00
|
|
|
ASN_SEQUENCE_ADD(&E_RABSetupResponse->protocolIEs, ie);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_ENB_UE_S1AP_ID;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
|
2018-03-11 11:41:37 +00:00
|
|
|
ASN_SEQUENCE_ADD(&E_RABSetupResponse->protocolIEs, ie);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_E_RABSetupListBearerSURes;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_E_RABSetupResponseIEs__value_PR_E_RABSetupListBearerSURes;
|
|
|
|
|
|
|
|
E_RABSetupListBearerSURes = &ie->value.choice.E_RABSetupListBearerSURes;
|
|
|
|
|
|
|
|
*MME_UE_S1AP_ID = mme_ue_s1ap_id;
|
|
|
|
*ENB_UE_S1AP_ID = enb_ue_s1ap_id;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
item = ogs_calloc(1, sizeof(S1AP_E_RABSetupItemBearerSUResIEs_t));
|
2018-03-11 11:41:37 +00:00
|
|
|
ASN_SEQUENCE_ADD(&E_RABSetupListBearerSURes->list, item);
|
|
|
|
|
|
|
|
item->id = S1AP_ProtocolIE_ID_id_E_RABSetupItemBearerSURes;
|
|
|
|
item->criticality = S1AP_Criticality_ignore;
|
|
|
|
item->value.present =
|
|
|
|
S1AP_E_RABSetupItemBearerSUResIEs__value_PR_E_RABSetupItemBearerSURes;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
e_rab = &item->value.choice.E_RABSetupItemBearerSURes;
|
2017-12-16 09:06:34 +00:00
|
|
|
e_rab->e_RAB_ID = ebi;
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
rv = ogs_getaddrinfo(&addr, AF_INET, ipstr, GTPV1_U_UDP_PORT, 0);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
rv = gtp_sockaddr_to_f_teid(addr, NULL, &f_teid, &len);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
ogs_freeaddrinfo(addr);
|
2017-12-16 09:06:34 +00:00
|
|
|
rv = gtp_f_teid_to_ip(&f_teid, &ip);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
|
|
|
rv = s1ap_ip_to_BIT_STRING(&ip, &e_rab->transportLayerAddress);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
s1ap_uint32_to_OCTET_STRING(teid, &e_rab->gTP_TEID);
|
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
rv = s1ap_encode_pdu(pkbuf, &pdu);
|
|
|
|
s1ap_free_pdu(&pdu);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (rv != OGS_OK) {
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_error("s1ap_encode_pdu() failed");
|
|
|
|
return OGS_ERROR;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_e_rab_modify_response(ogs_pkbuf_t **pkbuf, int i)
|
2018-01-17 07:01:11 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"2006"
|
|
|
|
"001b000003000040 0480000001000840 020001001f400600 002500010e",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-01-17 07:01:11 +00:00
|
|
|
31,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2018-01-17 07:01:11 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2018-01-17 07:01:11 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_e_rab_release_response(ogs_pkbuf_t **pkbuf, int i)
|
2017-12-16 09:06:34 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
"200700190000"
|
|
|
|
"0300004002 0001000840020001 0045400600000f 40010c",
|
|
|
|
"200700190000"
|
|
|
|
"0300004002 0001000840020001 0045400600000f 40010e",
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
2017-07-26 09:49:56 +00:00
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
2017-07-25 12:15:25 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
2017-07-26 02:28:43 +00:00
|
|
|
"",
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
29,
|
|
|
|
29,
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_activate_default_bearer_accept(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-12-16 09:06:34 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40360000"
|
|
|
|
"0500000005c08000 0107000800020001 001a000a0927e7 f5bb400b6200c200"
|
2017-12-16 09:06:34 +00:00
|
|
|
"6440080055f50100 19d0100043400600 55f5011022",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
2017-09-15 03:06:26 +00:00
|
|
|
|
2017-07-25 12:15:25 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
58,
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
2017-07-25 12:15:25 +00:00
|
|
|
0,
|
2017-07-26 09:49:56 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
59,
|
2017-07-26 02:28:43 +00:00
|
|
|
0,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
2017-04-14 11:20:00 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-04-14 11:20:00 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-04-13 14:14:59 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_activate_dedicated_bearer_accept(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-07-25 14:42:16 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d403600000500"
|
|
|
|
"000005c000000001 00080002000100 1a000a0927078a5f 34037200c6006440"
|
2017-12-16 09:06:34 +00:00
|
|
|
"080000f1109d67aa 50004340060000f1 102b67",
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d403600000500"
|
|
|
|
"000005c000000001 00080002000100 1a000a0927c035da 96036200c6006440"
|
2017-12-16 09:06:34 +00:00
|
|
|
"080000f1109d67aa 50004340060000f1 102b67",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
2017-07-25 14:42:16 +00:00
|
|
|
|
2017-07-26 02:28:43 +00:00
|
|
|
"",
|
2017-07-26 09:49:56 +00:00
|
|
|
"",
|
2017-12-16 09:06:34 +00:00
|
|
|
"",
|
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d403600000500"
|
|
|
|
"000005c00200003c 00080002000100 1a000a0927a27f49 d6036200c6006440"
|
2017-12-16 09:06:34 +00:00
|
|
|
"080000f1109d67aa 50004340060000f1 102b67",
|
2017-07-26 02:28:43 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
"000d"
|
|
|
|
"4036000005000000 05c0020000c40008 0002000c001a000a 0927e3c77e000362"
|
|
|
|
"00c6006440080000 f110001f20a00043 40060000f1103039",
|
2017-07-25 14:42:16 +00:00
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
58,
|
|
|
|
58,
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
|
|
|
|
2017-07-25 14:42:16 +00:00
|
|
|
0,
|
|
|
|
0,
|
2017-07-26 09:49:56 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2018-03-11 11:41:37 +00:00
|
|
|
58,
|
2017-12-16 09:06:34 +00:00
|
|
|
58,
|
2017-07-25 14:42:16 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-07-25 14:42:16 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-07-25 14:42:16 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_modify_bearer_accept(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2018-01-17 07:01:11 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"000d"
|
|
|
|
"4035000005000000 0480000001000800 020001001a000a09 27a5c0d564067200"
|
|
|
|
"ca006440080064f0 430020a000004340 060064f043020a",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-01-17 07:01:11 +00:00
|
|
|
57,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2018-01-17 07:01:11 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2018-01-17 07:01:11 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_deactivate_bearer_accept(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-09-11 12:14:55 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40330000"
|
|
|
|
"0500000002 0001000800020001 001a000a09274c b2ebbd056200ce00"
|
2018-01-16 13:14:59 +00:00
|
|
|
"6440080055f50100 19d0100043400600 55f5011022",
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40330000"
|
|
|
|
"0500000002 0001000800020001 001a000a0927a9 a1b2bd057200ce00"
|
2017-12-16 09:06:34 +00:00
|
|
|
"6440080055f50100 19d0100043400600 55f5011022",
|
2018-03-11 11:41:37 +00:00
|
|
|
"000d40330000"
|
|
|
|
"0500000002 0001000800020001 001a000a09277d 7f1f80056200ce00"
|
2018-01-17 08:17:22 +00:00
|
|
|
"6440080055f50100 19d0100043400600 55f5011022",
|
2017-09-11 12:14:55 +00:00
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
59,
|
2018-01-16 13:14:59 +00:00
|
|
|
59,
|
2018-01-17 08:17:22 +00:00
|
|
|
59,
|
2017-09-11 12:14:55 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-09-11 12:14:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-11 12:14:55 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_path_switch_request(
|
|
|
|
ogs_pkbuf_t **pkbuf, int target,
|
|
|
|
uint32_t mme_ue_s1ap_id, uint32_t enb_ue_s1ap_id,
|
|
|
|
int num_of_bearer, uint8_t ebi, uint32_t teid,
|
|
|
|
const char *ipstr1, const char *ipstr2)
|
2017-12-16 09:06:34 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
2017-12-16 09:06:34 +00:00
|
|
|
int i;
|
2018-03-12 13:47:10 +00:00
|
|
|
|
|
|
|
S1AP_S1AP_PDU_t pdu;
|
|
|
|
S1AP_InitiatingMessage_t *initiatingMessage = NULL;
|
|
|
|
S1AP_PathSwitchRequest_t *PathSwitchRequest = NULL;
|
|
|
|
|
|
|
|
S1AP_PathSwitchRequestIEs_t *ie = NULL;
|
|
|
|
S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_E_RABToBeSwitchedDLList_t *E_RABToBeSwitchedDLList = NULL;
|
|
|
|
S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_EUTRAN_CGI_t *EUTRAN_CGI = NULL;
|
|
|
|
S1AP_TAI_t *TAI = NULL;
|
|
|
|
S1AP_UESecurityCapabilities_t *UESecurityCapabilities = NULL;
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
enb_ue_t *enb_ue = NULL;
|
|
|
|
mme_ue_t *mme_ue = NULL;
|
|
|
|
|
2018-03-12 13:47:10 +00:00
|
|
|
memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
|
|
|
|
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
|
|
|
|
pdu.choice.initiatingMessage =
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_InitiatingMessage_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
|
|
|
|
initiatingMessage = pdu.choice.initiatingMessage;
|
|
|
|
initiatingMessage->procedureCode = S1AP_ProcedureCode_id_PathSwitchRequest;
|
|
|
|
initiatingMessage->criticality = S1AP_Criticality_reject;
|
|
|
|
initiatingMessage->value.present =
|
|
|
|
S1AP_InitiatingMessage__value_PR_PathSwitchRequest;
|
|
|
|
|
|
|
|
PathSwitchRequest = &initiatingMessage->value.choice.PathSwitchRequest;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
ASN_SEQUENCE_ADD(&PathSwitchRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_reject;
|
|
|
|
ie->value.present = S1AP_PathSwitchRequestIEs__value_PR_ENB_UE_S1AP_ID;
|
|
|
|
|
|
|
|
ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
ASN_SEQUENCE_ADD(&PathSwitchRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_E_RABToBeSwitchedDLList;
|
|
|
|
ie->criticality = S1AP_Criticality_reject;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_PathSwitchRequestIEs__value_PR_E_RABToBeSwitchedDLList;
|
|
|
|
|
|
|
|
E_RABToBeSwitchedDLList = &ie->value.choice.E_RABToBeSwitchedDLList;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
ASN_SEQUENCE_ADD(&PathSwitchRequest->protocolIEs, ie);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-12 13:47:10 +00:00
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_SourceMME_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_reject;
|
|
|
|
ie->value.present = S1AP_PathSwitchRequestIEs__value_PR_MME_UE_S1AP_ID;
|
|
|
|
|
|
|
|
MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
ASN_SEQUENCE_ADD(&PathSwitchRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present = S1AP_PathSwitchRequestIEs__value_PR_EUTRAN_CGI;
|
|
|
|
|
|
|
|
EUTRAN_CGI = &ie->value.choice.EUTRAN_CGI;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
ASN_SEQUENCE_ADD(&PathSwitchRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_TAI;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present = S1AP_PathSwitchRequestIEs__value_PR_TAI;
|
|
|
|
|
|
|
|
TAI = &ie->value.choice.TAI;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
ASN_SEQUENCE_ADD(&PathSwitchRequest->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_UESecurityCapabilities;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_PathSwitchRequestIEs__value_PR_UESecurityCapabilities;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-12 13:47:10 +00:00
|
|
|
UESecurityCapabilities = &ie->value.choice.UESecurityCapabilities;
|
|
|
|
|
|
|
|
*ENB_UE_S1AP_ID = enb_ue_s1ap_id;
|
|
|
|
*MME_UE_S1AP_ID = mme_ue_s1ap_id;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
|
|
|
enb_ue = enb_ue_find_by_mme_ue_s1ap_id(mme_ue_s1ap_id);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(enb_ue);
|
2017-12-16 09:06:34 +00:00
|
|
|
mme_ue = enb_ue->mme_ue;
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(mme_ue);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
for (i = 0; i < num_of_bearer; i++) {
|
2018-03-12 13:47:10 +00:00
|
|
|
S1AP_E_RABToBeSwitchedDLItemIEs_t *item = NULL;
|
|
|
|
S1AP_E_RABToBeSwitchedDLItem_t *e_rab = NULL;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_sockaddr_t *addr = NULL;
|
2017-12-16 09:06:34 +00:00
|
|
|
gtp_f_teid_t f_teid;
|
|
|
|
ip_t ip;
|
|
|
|
int len;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
item = ogs_calloc(1, sizeof(S1AP_E_RABToBeSwitchedDLItemIEs_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
ASN_SEQUENCE_ADD(&E_RABToBeSwitchedDLList->list, item);
|
|
|
|
|
|
|
|
item->id = S1AP_ProtocolIE_ID_id_E_RABToBeSwitchedDLItem;
|
|
|
|
item->criticality = S1AP_Criticality_reject;
|
|
|
|
item->value.present =
|
|
|
|
S1AP_E_RABToBeSwitchedDLItemIEs__value_PR_E_RABToBeSwitchedDLItem;
|
|
|
|
|
|
|
|
e_rab = &item->value.choice.E_RABToBeSwitchedDLItem;
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
e_rab->e_RAB_ID = ebi+i;
|
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (target == 0) {
|
2019-04-27 14:54:30 +00:00
|
|
|
rv = ogs_getaddrinfo(&addr, AF_INET, ipstr1, GTPV1_U_UDP_PORT, 0);
|
2018-02-04 14:15:20 +00:00
|
|
|
rv = gtp_sockaddr_to_f_teid(
|
2019-04-27 14:54:30 +00:00
|
|
|
addr, NULL, &f_teid, &len);
|
|
|
|
ogs_freeaddrinfo(addr);
|
2019-06-18 06:32:01 +00:00
|
|
|
} else {
|
2019-04-27 14:54:30 +00:00
|
|
|
rv = ogs_getaddrinfo(&addr, AF_INET, ipstr2, GTPV1_U_UDP_PORT, 0);
|
2018-02-04 14:15:20 +00:00
|
|
|
rv = gtp_sockaddr_to_f_teid(
|
2019-04-27 14:54:30 +00:00
|
|
|
addr, NULL, &f_teid, &len);
|
|
|
|
ogs_freeaddrinfo(addr);
|
|
|
|
}
|
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
rv = gtp_f_teid_to_ip(&f_teid, &ip);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
|
|
|
rv = s1ap_ip_to_BIT_STRING(&ip, &e_rab->transportLayerAddress);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
s1ap_uint32_to_OCTET_STRING(teid+i, &e_rab->gTP_TEID);
|
|
|
|
}
|
|
|
|
|
|
|
|
s1ap_buffer_to_OCTET_STRING(
|
2018-03-12 13:47:10 +00:00
|
|
|
&mme_ue->e_cgi.plmn_id, PLMN_ID_LEN, &EUTRAN_CGI->pLMNidentity);
|
|
|
|
EUTRAN_CGI->cell_ID.size = 4;
|
2019-04-27 14:54:30 +00:00
|
|
|
EUTRAN_CGI->cell_ID.buf = ogs_calloc(
|
|
|
|
EUTRAN_CGI->cell_ID.size, sizeof(uint8_t));
|
|
|
|
ogs_assert(EUTRAN_CGI->cell_ID.buf);
|
2018-03-12 13:47:10 +00:00
|
|
|
EUTRAN_CGI->cell_ID.buf[0] = (mme_ue->e_cgi.cell_id >> 24);
|
|
|
|
EUTRAN_CGI->cell_ID.buf[1] = (mme_ue->e_cgi.cell_id >> 16);
|
|
|
|
EUTRAN_CGI->cell_ID.buf[2] = (mme_ue->e_cgi.cell_id >> 8);
|
|
|
|
EUTRAN_CGI->cell_ID.buf[3] = (mme_ue->e_cgi.cell_id);
|
|
|
|
EUTRAN_CGI->cell_ID.bits_unused = 4;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
|
|
|
s1ap_uint16_to_OCTET_STRING(
|
2018-03-12 13:47:10 +00:00
|
|
|
mme_ue->tai.tac, &TAI->tAC);
|
2017-12-16 09:06:34 +00:00
|
|
|
s1ap_buffer_to_OCTET_STRING(
|
2018-03-12 13:47:10 +00:00
|
|
|
&mme_ue->tai.plmn_id, PLMN_ID_LEN, &TAI->pLMNidentity);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-12 13:47:10 +00:00
|
|
|
UESecurityCapabilities->encryptionAlgorithms.size = 2;
|
|
|
|
UESecurityCapabilities->encryptionAlgorithms.buf =
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(UESecurityCapabilities->encryptionAlgorithms.size,
|
|
|
|
sizeof(uint8_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
UESecurityCapabilities->encryptionAlgorithms.bits_unused = 0;
|
|
|
|
UESecurityCapabilities->encryptionAlgorithms.buf[0] =
|
2017-12-16 09:06:34 +00:00
|
|
|
(mme_ue->ue_network_capability.eea << 1);
|
|
|
|
|
2018-03-12 13:47:10 +00:00
|
|
|
UESecurityCapabilities->integrityProtectionAlgorithms.size = 2;
|
|
|
|
UESecurityCapabilities->integrityProtectionAlgorithms.buf =
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(UESecurityCapabilities->
|
|
|
|
integrityProtectionAlgorithms.size, sizeof(uint8_t));
|
2018-03-12 13:47:10 +00:00
|
|
|
UESecurityCapabilities->integrityProtectionAlgorithms.bits_unused = 0;
|
|
|
|
UESecurityCapabilities->integrityProtectionAlgorithms.buf[0] =
|
2017-12-16 09:06:34 +00:00
|
|
|
(mme_ue->ue_network_capability.eia << 1);
|
|
|
|
|
2018-03-12 13:47:10 +00:00
|
|
|
rv = s1ap_encode_pdu(pkbuf, &pdu);
|
|
|
|
s1ap_free_pdu(&pdu);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (rv != OGS_OK) {
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_error("s1ap_encode_pdu() failed");
|
|
|
|
return OGS_ERROR;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_handover_required(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-09-11 12:14:55 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
"0000"
|
|
|
|
"0081030000060000 0005c0020000c400 080002000c000100 0100000240020220"
|
|
|
|
"0004000d0000f110 0000043000f11030 3900680080d080ce 4080ab0f1014c598"
|
|
|
|
"00018000bf06ec4d 00100302c0000000 000015a800140672 0af00348f10013d0"
|
|
|
|
"3bc58414903bc588 09401de2c2100440 13f212249010127d ad808fd50398381c"
|
|
|
|
"08fd503983805f50 37868baa010c846f b057874162d62e82 1f42f2e159f821d0"
|
|
|
|
"9c0009e28aa1a001 2d888026d0600040 8008066072003e41 5250d46210208184"
|
|
|
|
"3423c135002214d6 dfb0a0b06502c402 000004008177faab 4677235334a0e867"
|
|
|
|
"213e804030000100 4e40024500004e40 0246000000f11000 043a000000f11000"
|
|
|
|
"1f20a0000022",
|
|
|
|
|
|
|
|
"0000"
|
|
|
|
"00810e0000060000 0005c0020000c500 0800020008000100 0100000240020220"
|
|
|
|
"0004000d0000f110 00001f2000f11030 3900680080db80d9 4080ab0f1014c598"
|
|
|
|
"00018000bf06ec4d 00100302c0000000 000015a800140672 0af003e8f10013d0"
|
|
|
|
"3bc58414903bc588 09401de2c2100440 13f212249010127d ad808fd50398381c"
|
|
|
|
"08fd503983805f50 37868baa010c846f b057874162d62e82 1f42f2e159f821d0"
|
|
|
|
"9c0009e28aa1a001 2d888050d1bc0040 8008066072000874 1250d46210208184"
|
|
|
|
"3423c135002214d6 dfb0a0b06502c402 000004008177faab 4677235334a0e867"
|
|
|
|
"2134804030000100 4e40024500004e40 0246000000f11000 1f20a10000f11000"
|
|
|
|
"043a000000350000 f110001f20a00000 22",
|
|
|
|
|
|
|
|
"0000"
|
|
|
|
"0081190000060000 0005c0020000c600 080002000d000100 0100000240020220"
|
|
|
|
"0004000d0000f110 0000043000f11030 3900680080e680e4 4080ab0f1014c598"
|
|
|
|
"00018000bf06ec4d 00100302c0000000 000015a800140672 0af00348f10013d0"
|
|
|
|
"3bc58414903bc588 09401de2c2100440 13f212249010127d ad808fd50398381c"
|
|
|
|
"08fd503983805f50 37868baa010c846f b057874162d62e82 1f42f2e159f821d0"
|
|
|
|
"9c0009e28aa1a001 2d888050514c0040 8008066072003e41 5250d46210208184"
|
|
|
|
"3423c135002214d6 dfb0a0b06502c402 000004008177faab 4677235334a0e867"
|
|
|
|
"213e804030000100 4e40024500004e40 0246000000f11000 043a020000f11000"
|
|
|
|
"1f20a00000340000 f11000043a000000 350000f110001f20 a0000022",
|
2017-09-11 12:14:55 +00:00
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
264,
|
|
|
|
275,
|
|
|
|
286,
|
2017-09-11 12:14:55 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-09-11 12:14:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-11 12:14:55 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_handover_failure(ogs_pkbuf_t **pkbuf, int i)
|
2018-03-15 08:22:45 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"4001 0012000002000040 05c0020000c5 000240020000",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-15 08:22:45 +00:00
|
|
|
22,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2018-03-15 08:22:45 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2018-03-15 08:22:45 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_handover_request_ack(
|
|
|
|
ogs_pkbuf_t **pkbuf, int target,
|
|
|
|
uint32_t mme_ue_s1ap_id, uint32_t enb_ue_s1ap_id,
|
|
|
|
int num_of_bearer, uint8_t ebi, uint32_t teid,
|
|
|
|
const char *ipstr1, const char *ipstr2)
|
2017-12-09 03:30:46 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
2018-03-13 08:50:11 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
S1AP_S1AP_PDU_t pdu;
|
|
|
|
S1AP_SuccessfulOutcome_t *successfulOutcome = NULL;
|
|
|
|
S1AP_HandoverRequestAcknowledge_t *HandoverRequestAcknowledge = NULL;
|
|
|
|
|
|
|
|
S1AP_HandoverRequestAcknowledgeIEs_t *ie = NULL;
|
|
|
|
S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
|
|
|
|
S1AP_E_RABAdmittedList_t *E_RABAdmittedList = NULL;
|
|
|
|
S1AP_E_RABFailedtoSetupListHOReqAck_t
|
|
|
|
*E_RABFailedtoSetupListHOReqAck = NULL;
|
|
|
|
S1AP_Target_ToSource_TransparentContainer_t
|
|
|
|
*Target_ToSource_TransparentContainer = NULL;
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
char *payload =
|
|
|
|
"00 80810bf900d8af40 00a0339057801f47 88009e81de2c20a4"
|
|
|
|
"81de2c404a00ef16 2000010044013f21 2249008093efd243 3914cd2aa0a0142f"
|
|
|
|
"f2214d6dfb82c194 0b10080000020040 bbfd55aeab41ad80 8fd50398381c08fd"
|
|
|
|
"503983804d037868 baa016423342bc3a 18b58fa084ca833f a17970acfc10e84e"
|
|
|
|
"0004f14550d00096 c88900";
|
2017-12-09 03:30:46 +00:00
|
|
|
|
2018-03-13 08:50:11 +00:00
|
|
|
memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
|
|
|
|
pdu.present = S1AP_S1AP_PDU_PR_successfulOutcome;
|
|
|
|
pdu.choice.successfulOutcome =
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_SuccessfulOutcome_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
|
|
|
|
successfulOutcome = pdu.choice.successfulOutcome;
|
|
|
|
successfulOutcome->procedureCode = S1AP_ProcedureCode_id_HandoverResourceAllocation;
|
|
|
|
successfulOutcome->criticality = S1AP_Criticality_reject;
|
|
|
|
successfulOutcome->value.present =
|
|
|
|
S1AP_SuccessfulOutcome__value_PR_HandoverRequestAcknowledge;
|
|
|
|
|
|
|
|
HandoverRequestAcknowledge =
|
|
|
|
&successfulOutcome->value.choice.HandoverRequestAcknowledge;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_HandoverRequestAcknowledgeIEs_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
ASN_SEQUENCE_ADD(&HandoverRequestAcknowledge->protocolIEs, ie);
|
2017-12-09 03:30:46 +00:00
|
|
|
|
2018-03-13 08:50:11 +00:00
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_HandoverRequestAcknowledgeIEs__value_PR_MME_UE_S1AP_ID;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-13 08:50:11 +00:00
|
|
|
MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_HandoverRequestAcknowledgeIEs_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
ASN_SEQUENCE_ADD(&HandoverRequestAcknowledge->protocolIEs, ie);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2018-03-13 08:50:11 +00:00
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_HandoverRequestAcknowledgeIEs__value_PR_ENB_UE_S1AP_ID;
|
|
|
|
|
|
|
|
ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_HandoverRequestAcknowledgeIEs_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
ASN_SEQUENCE_ADD(&HandoverRequestAcknowledge->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_E_RABAdmittedList;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present =
|
|
|
|
S1AP_HandoverRequestAcknowledgeIEs__value_PR_E_RABAdmittedList;
|
|
|
|
|
|
|
|
E_RABAdmittedList = &ie->value.choice.E_RABAdmittedList;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ie = ogs_calloc(1, sizeof(S1AP_HandoverRequestAcknowledgeIEs_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
ASN_SEQUENCE_ADD(&HandoverRequestAcknowledge->protocolIEs, ie);
|
|
|
|
|
|
|
|
ie->id = S1AP_ProtocolIE_ID_id_Target_ToSource_TransparentContainer;
|
|
|
|
ie->criticality = S1AP_Criticality_ignore;
|
|
|
|
ie->value.present = S1AP_HandoverRequestAcknowledgeIEs__value_PR_Target_ToSource_TransparentContainer;
|
|
|
|
|
|
|
|
Target_ToSource_TransparentContainer =
|
|
|
|
&ie->value.choice.Target_ToSource_TransparentContainer;
|
|
|
|
|
|
|
|
*MME_UE_S1AP_ID = mme_ue_s1ap_id;
|
|
|
|
*ENB_UE_S1AP_ID = enb_ue_s1ap_id;
|
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
for (i = 0; i < num_of_bearer; i++) {
|
2018-03-13 08:50:11 +00:00
|
|
|
S1AP_E_RABAdmittedItemIEs_t *item = NULL;
|
|
|
|
S1AP_E_RABAdmittedItem_t *e_rab = NULL;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_sockaddr_t *addr = NULL;
|
2017-12-16 09:06:34 +00:00
|
|
|
gtp_f_teid_t f_teid;
|
|
|
|
ip_t ip;
|
|
|
|
int len;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
item = ogs_calloc(1, sizeof(S1AP_E_RABAdmittedItemIEs_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
ASN_SEQUENCE_ADD(&E_RABAdmittedList->list, item);
|
|
|
|
|
|
|
|
item->id = S1AP_ProtocolIE_ID_id_E_RABAdmittedItem;
|
|
|
|
item->criticality = S1AP_Criticality_ignore;
|
|
|
|
item->value.present =
|
|
|
|
S1AP_E_RABAdmittedItemIEs__value_PR_E_RABAdmittedItem;
|
|
|
|
|
|
|
|
e_rab = &item->value.choice.E_RABAdmittedItem;
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
e_rab->e_RAB_ID = ebi+i;
|
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (target == 0) {
|
2019-04-27 14:54:30 +00:00
|
|
|
rv = ogs_getaddrinfo(&addr, AF_INET, ipstr1, GTPV1_U_UDP_PORT, 0);
|
2018-02-04 14:15:20 +00:00
|
|
|
rv = gtp_sockaddr_to_f_teid(
|
2019-04-27 14:54:30 +00:00
|
|
|
addr, NULL, &f_teid, &len);
|
|
|
|
ogs_freeaddrinfo(addr);
|
2019-06-18 06:32:01 +00:00
|
|
|
} else {
|
2019-04-27 14:54:30 +00:00
|
|
|
rv = ogs_getaddrinfo(&addr, AF_INET, ipstr2, GTPV1_U_UDP_PORT, 0);
|
2018-02-04 14:15:20 +00:00
|
|
|
rv = gtp_sockaddr_to_f_teid(
|
2019-04-27 14:54:30 +00:00
|
|
|
addr, NULL, &f_teid, &len);
|
|
|
|
ogs_freeaddrinfo(addr);
|
|
|
|
}
|
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
rv = gtp_f_teid_to_ip(&f_teid, &ip);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
|
|
|
rv = s1ap_ip_to_BIT_STRING(&ip, &e_rab->transportLayerAddress);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2017-12-16 09:06:34 +00:00
|
|
|
s1ap_uint32_to_OCTET_STRING(teid+i, &e_rab->gTP_TEID);
|
|
|
|
|
|
|
|
e_rab->dL_transportLayerAddress =
|
2018-03-05 14:01:07 +00:00
|
|
|
(S1AP_TransportLayerAddress_t *)
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_TransportLayerAddress_t));
|
2017-12-16 09:06:34 +00:00
|
|
|
rv = s1ap_ip_to_BIT_STRING(&ip, e_rab->dL_transportLayerAddress);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2018-03-05 14:01:07 +00:00
|
|
|
e_rab->dL_gTP_TEID = (S1AP_GTP_TEID_t *)
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_GTP_TEID_t));
|
2017-12-16 09:06:34 +00:00
|
|
|
s1ap_uint32_to_OCTET_STRING(teid+i+10, e_rab->dL_gTP_TEID);
|
|
|
|
|
2018-03-13 08:50:11 +00:00
|
|
|
e_rab->uL_TransportLayerAddress =
|
2018-03-05 14:01:07 +00:00
|
|
|
(S1AP_TransportLayerAddress_t *)
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_TransportLayerAddress_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
rv = s1ap_ip_to_BIT_STRING(&ip, e_rab->uL_TransportLayerAddress);
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert(rv == OGS_OK);
|
2018-03-13 08:50:11 +00:00
|
|
|
e_rab->uL_GTP_TEID = (S1AP_GTP_TEID_t *)
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_calloc(1, sizeof(S1AP_GTP_TEID_t));
|
2018-03-13 08:50:11 +00:00
|
|
|
s1ap_uint32_to_OCTET_STRING(teid+i+20, e_rab->uL_GTP_TEID);
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
2017-12-09 03:30:46 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
s1ap_buffer_to_OCTET_STRING(
|
2019-04-27 14:54:30 +00:00
|
|
|
OGS_HEX(payload, strlen(payload), hexbuf), 132,
|
2018-03-13 08:50:11 +00:00
|
|
|
Target_ToSource_TransparentContainer);
|
2017-12-09 03:30:46 +00:00
|
|
|
|
2018-03-13 08:50:11 +00:00
|
|
|
rv = s1ap_encode_pdu(pkbuf, &pdu);
|
|
|
|
s1ap_free_pdu(&pdu);
|
2017-12-09 03:30:46 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (rv != OGS_OK) {
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_error("s1ap_encode_pdu() failed");
|
|
|
|
return OGS_ERROR;
|
2017-12-09 03:30:46 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-09 03:30:46 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_handover_request_ack_static(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-09-07 14:41:05 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
"2001"
|
|
|
|
"0080e80000040000 4005c0020000c500 0840020008001240 47010014401f78a1"
|
|
|
|
"f07f000001010007 080f807f00000101 0007090f807f0000 010100070a001440"
|
|
|
|
"1f78c1f07f000001 010007100f807f00 0001010007110f80 7f00000101000712"
|
|
|
|
"007b008086808400 80810bf900d8af40 00a0339057801f47 88009e81de2c20a4"
|
|
|
|
"81de2c404a00ef16 2000010044013f21 2249008093efd243 3914cd2aa0a0142f"
|
|
|
|
"f2214d6dfb82c194 0b10080000020040 bbfd55aeab41ad80 8fd50398381c08fd"
|
|
|
|
"503983804d037868 baa016423342bc3a 18b58fa084ca833f a17970acfc10e84e"
|
|
|
|
"0004f14550d00096 c88900",
|
2017-09-07 14:41:05 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
"2001"
|
|
|
|
"0080e80000040000 4005c0020000c600 084002000d001240 47010014401f78a1"
|
|
|
|
"f00a01237b010009 080f800a01237b01 0009090f800a0123 7b0100090a001440"
|
|
|
|
"1f78c1f00a01237b 010009100f800a01 237b010009110f80 0a01237b01000912"
|
|
|
|
"007b008086808400 80810bf900d8af40 00a0339057801a47 88009e81de2c20a4"
|
|
|
|
"81de2c404a00ef16 2000010044013f21 2249008093effa43 3914cd2aa0a0140f"
|
|
|
|
"f2214d6dfb82c194 0b10080000020040 bbfd55aeab01ad80 8fd50398381c08fd"
|
|
|
|
"503983804d037868 baa016423342bc3a 18b58fa084ca833f a17970acfc10e84e"
|
|
|
|
"0004f14550d00096 c88980",
|
2017-09-07 14:41:05 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
"2001"
|
|
|
|
"0080e80000040000 4005c0020000c700 0840020009001240 47010014401f78a1"
|
|
|
|
"f00a01237c010008 080f800a01237c01 0008090f800a0123 7c0100080a001440"
|
|
|
|
"1f78c1f00a01237c 010008100f800a01 237c010008110f80 0a01237c01000812"
|
|
|
|
"007b008086808400 80810bf900d8af40 00a0339057801f47 88009e81de2c20a4"
|
|
|
|
"81de2c404a00ef16 2000010044013f21 2249008093efd243 3914cd2aa0a0144f"
|
|
|
|
"f2214d6dfb82c194 0b10080000020040 bbfd55aeab81ad80 8fd50398381c08fd"
|
|
|
|
"503983804d037868 baa016423342bc3a 18b58fa084ca833f a17970acfc10e84e"
|
|
|
|
"0004f14550d00096 c88a00",
|
2017-09-06 15:37:16 +00:00
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
237,
|
|
|
|
237,
|
|
|
|
237,
|
2017-09-04 16:17:24 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
0,
|
2017-09-04 16:17:24 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-09-04 16:17:24 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-04 16:17:24 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_enb_status_transfer(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2017-09-04 16:17:24 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
"0018"
|
|
|
|
"4027000003000000 05c0020000c40008 0002000c005a0011 00000059400b0500"
|
|
|
|
"004b000000001100 00",
|
|
|
|
"0018"
|
|
|
|
"4027000003000000 05c0020000c50008 00020008005a0011 00000059400b0500"
|
|
|
|
"00a8000000004100 00",
|
2017-09-04 16:17:24 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
43,
|
|
|
|
43,
|
2017-09-04 16:17:24 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
2017-09-11 09:41:14 +00:00
|
|
|
0,
|
2017-09-04 16:17:24 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-09-04 16:17:24 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-04 16:17:24 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_enb_configuration_transfer(
|
|
|
|
ogs_pkbuf_t **pkbuf, int i)
|
2018-03-07 12:53:53 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"0028"
|
2018-03-24 01:08:55 +00:00
|
|
|
"403b000001008140 3440049699000004 3004969900020004 969900001f200496"
|
|
|
|
"9900020000000098 401341f0ac110e02 0000009940070200 f8ac110e02",
|
|
|
|
"0028"
|
|
|
|
"403b000001008140 344004969900001f 2004969900020004 9699000004300496"
|
|
|
|
"9900020000000098 401341f0ac110e02 0000009940070200 f8ac110e02",
|
2018-03-07 12:53:53 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-24 01:08:55 +00:00
|
|
|
63,
|
|
|
|
63,
|
2018-03-07 12:53:53 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2018-03-07 12:53:53 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2018-03-07 12:53:53 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_handover_notify(ogs_pkbuf_t **pkbuf, int i)
|
2017-09-07 14:41:05 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
"0002"
|
|
|
|
"4028000004000000 05c0020000c50008 0002000800644008 0000f11000043a00"
|
|
|
|
"004340060000f110 3039",
|
|
|
|
"0002"
|
|
|
|
"4028000004000000 05c0020000c60008 0002000d00644008 0000f110001f20a0"
|
|
|
|
"004340060000f110 3039",
|
2017-09-07 14:41:05 +00:00
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
44,
|
|
|
|
44,
|
2017-09-07 14:41:05 +00:00
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-12-09 09:21:22 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-07 14:41:05 +00:00
|
|
|
}
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_handover_cancel(ogs_pkbuf_t **pkbuf, int i)
|
2017-09-12 14:07:55 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
"0004"
|
|
|
|
"0018000003000000 05c0020000c60008 0002000d00024002 0120",
|
|
|
|
"",
|
|
|
|
"",
|
2017-09-12 14:07:55 +00:00
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
28,
|
|
|
|
0,
|
|
|
|
0,
|
2017-09-12 14:07:55 +00:00
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-12 14:07:55 +00:00
|
|
|
}
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int tests1ap_build_s1_reset(ogs_pkbuf_t **pkbuf, int i)
|
2018-03-21 07:10:20 +00:00
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"000e001500000200 0240020060005c00 084000005b000220 04",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2018-03-21 07:10:20 +00:00
|
|
|
25,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-12-16 09:06:34 +00:00
|
|
|
}
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t in_cksum(uint16_t *addr, int len); /* from pgw_gtp_path.c */
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int testgtpu_build_ping(
|
|
|
|
ogs_pkbuf_t **sendbuf, const char *src_ip, const char *dst_ip)
|
2017-09-12 14:07:55 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
int rv;
|
|
|
|
ogs_pkbuf_t *pkbuf = NULL;
|
2017-12-16 09:06:34 +00:00
|
|
|
gtp_header_t *gtp_h = NULL;
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_ipsubnet_t src_ipsub, dst_ipsub;
|
|
|
|
|
|
|
|
ogs_assert(src_ip);
|
|
|
|
ogs_assert(dst_ip);
|
|
|
|
rv = ogs_ipsubnet(&src_ipsub, src_ip, NULL);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
rv = ogs_ipsubnet(&dst_ipsub, dst_ip, NULL);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
|
|
|
|
|
|
|
pkbuf = ogs_pkbuf_alloc(NULL,
|
|
|
|
200 /* enough for ICMP; use smaller buffer */);
|
|
|
|
ogs_pkbuf_put(pkbuf, 200);
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
gtp_h = (gtp_header_t *)pkbuf->data;
|
2017-12-16 09:06:34 +00:00
|
|
|
gtp_h->flags = 0x30;
|
|
|
|
gtp_h->type = GTPU_MSGTYPE_GPDU;
|
|
|
|
gtp_h->teid = htonl(1);
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-06-18 06:32:01 +00:00
|
|
|
if (dst_ipsub.family == AF_INET) {
|
2017-12-17 02:07:04 +00:00
|
|
|
struct ip *ip_h = NULL;
|
2017-12-17 02:22:12 +00:00
|
|
|
struct icmp *icmp_h = NULL;
|
2017-12-17 02:07:04 +00:00
|
|
|
|
2017-12-17 02:22:12 +00:00
|
|
|
gtp_h->length = htons(sizeof *ip_h + ICMP_MINLEN);
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ip_h = (struct ip *)(pkbuf->data + GTPV1U_HEADER_LEN);
|
|
|
|
icmp_h = (struct icmp *)((uint8_t *)ip_h + sizeof *ip_h);
|
2017-12-17 02:22:12 +00:00
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
ip_h->ip_v = 4;
|
|
|
|
ip_h->ip_hl = 5;
|
|
|
|
ip_h->ip_tos = 0;
|
|
|
|
ip_h->ip_id = rand();
|
|
|
|
ip_h->ip_off = 0;
|
|
|
|
ip_h->ip_ttl = 255;
|
|
|
|
ip_h->ip_p = IPPROTO_ICMP;
|
|
|
|
ip_h->ip_len = gtp_h->length;
|
|
|
|
ip_h->ip_src.s_addr = src_ipsub.sub[0];
|
|
|
|
ip_h->ip_dst.s_addr = dst_ipsub.sub[0];
|
2019-04-27 14:54:30 +00:00
|
|
|
ip_h->ip_sum = in_cksum((uint16_t *)ip_h, sizeof *ip_h);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2017-12-17 02:22:12 +00:00
|
|
|
icmp_h->icmp_type = 8;
|
|
|
|
icmp_h->icmp_seq = rand();
|
|
|
|
icmp_h->icmp_id = rand();
|
2019-04-27 14:54:30 +00:00
|
|
|
icmp_h->icmp_cksum = in_cksum((uint16_t *)icmp_h, ICMP_MINLEN);
|
2019-06-18 06:32:01 +00:00
|
|
|
} else if (dst_ipsub.family == AF_INET6) {
|
2017-12-17 02:07:04 +00:00
|
|
|
struct ip6_hdr *ip6_h = NULL;
|
|
|
|
struct icmp6_hdr *icmp6_h = NULL;
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t plen = 0;
|
|
|
|
uint8_t nxt = 0;
|
|
|
|
uint8_t *p = NULL;
|
2017-12-17 02:07:04 +00:00
|
|
|
|
|
|
|
gtp_h->length = htons(sizeof *ip6_h + sizeof *icmp6_h);
|
|
|
|
plen = htons(sizeof *icmp6_h);
|
|
|
|
nxt = IPPROTO_ICMPV6;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
p = (uint8_t *)pkbuf->data + GTPV1U_HEADER_LEN;
|
2017-12-17 02:07:04 +00:00
|
|
|
ip6_h = (struct ip6_hdr *)p;
|
2019-04-27 14:54:30 +00:00
|
|
|
icmp6_h = (struct icmp6_hdr *)((uint8_t *)ip6_h + sizeof *ip6_h);
|
2017-12-17 02:07:04 +00:00
|
|
|
|
|
|
|
memcpy(p, src_ipsub.sub, sizeof src_ipsub.sub);
|
|
|
|
p += sizeof src_ipsub.sub;
|
|
|
|
memcpy(p, dst_ipsub.sub, sizeof dst_ipsub.sub);
|
|
|
|
p += sizeof dst_ipsub.sub;
|
|
|
|
p += 2; memcpy(p, &plen, 2); p += 2;
|
|
|
|
p += 3; *p = nxt; p += 1;
|
|
|
|
|
|
|
|
icmp6_h->icmp6_type = ICMP6_ECHO_REQUEST;
|
2017-12-16 09:19:31 +00:00
|
|
|
icmp6_h->icmp6_seq = rand();
|
|
|
|
icmp6_h->icmp6_id = rand();
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2017-12-17 02:07:04 +00:00
|
|
|
icmp6_h->icmp6_cksum = in_cksum(
|
2019-04-27 14:54:30 +00:00
|
|
|
(uint16_t *)ip6_h, sizeof *ip6_h + sizeof *icmp6_h);
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2017-12-17 02:07:04 +00:00
|
|
|
ip6_h->ip6_flow = htonl(0x60000001);
|
|
|
|
ip6_h->ip6_plen = plen;
|
|
|
|
ip6_h->ip6_nxt = nxt;;
|
|
|
|
ip6_h->ip6_hlim = 0xff;
|
|
|
|
memcpy(ip6_h->ip6_src.s6_addr, src_ipsub.sub, sizeof src_ipsub.sub);
|
|
|
|
memcpy(ip6_h->ip6_dst.s6_addr, dst_ipsub.sub, sizeof dst_ipsub.sub);
|
2019-06-18 06:32:01 +00:00
|
|
|
} else
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_assert_if_reached();
|
2017-12-16 09:06:34 +00:00
|
|
|
|
|
|
|
*sendbuf = pkbuf;
|
2017-09-12 14:07:55 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-12 14:07:55 +00:00
|
|
|
}
|
2017-09-15 03:06:26 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int testgtpu_build_slacc_rs(ogs_pkbuf_t **pkbuf, int i)
|
2017-09-15 03:06:26 +00:00
|
|
|
{
|
2017-12-16 09:06:34 +00:00
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
2018-01-13 05:15:00 +00:00
|
|
|
"32ff003400000001 00000000 6000000000083aff fe80000000000000 0000000000000002"
|
|
|
|
"ff02000000000000 0000000000000002 85007d3500000000",
|
2017-09-15 03:06:26 +00:00
|
|
|
|
|
|
|
};
|
2019-04-27 14:54:30 +00:00
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
2017-12-16 09:06:34 +00:00
|
|
|
60,
|
2017-09-15 03:06:26 +00:00
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
2017-09-15 03:06:26 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-09-15 03:06:26 +00:00
|
|
|
}
|
2017-12-16 09:06:34 +00:00
|
|
|
|
2019-06-21 15:28:21 +00:00
|
|
|
int testsgsap_location_update_accept(ogs_pkbuf_t **pkbuf, int i)
|
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"0a01082926240000 111893040509f107 09260e05f49ee88e 64",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
25,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
|
|
|
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
2019-07-05 06:55:07 +00:00
|
|
|
|
|
|
|
int testsgsap_location_update_reject(ogs_pkbuf_t **pkbuf, int i)
|
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"0b01082926240000 1118930f01030405 09f1070926",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
21,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
|
|
|
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
2019-07-05 09:13:32 +00:00
|
|
|
|
|
|
|
int testsgsap_imsi_detach_ack(ogs_pkbuf_t **pkbuf, int i)
|
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"1401082926240000 111893"
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
11,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
|
|
|
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
2019-07-07 01:16:21 +00:00
|
|
|
|
2019-07-08 09:15:19 +00:00
|
|
|
int testsgsap_paging_request(ogs_pkbuf_t **pkbuf, int i)
|
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"0101082926240000 111893021003766c 72076578616d706c 65036e6574200101"
|
|
|
|
"040509f1070926",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
39,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
|
|
|
|
|
|
|
return OGS_OK;
|
|
|
|
}
|
|
|
|
|
2019-07-07 01:16:21 +00:00
|
|
|
int testsgsap_reset_indication(ogs_pkbuf_t **pkbuf, int i)
|
|
|
|
{
|
|
|
|
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
"15021003766c7207 6578616d706c6503 6e6574",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
};
|
|
|
|
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
|
|
|
19,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
char hexbuf[MAX_SDU_LEN];
|
|
|
|
|
|
|
|
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
|
|
|
ogs_pkbuf_put_data(*pkbuf,
|
|
|
|
OGS_HEX(payload[i], strlen(payload[i]), hexbuf), len[i]);
|
|
|
|
|
|
|
|
return OGS_OK;
|
|
|
|
}
|