forked from acouzens/open5gs
remove s1ap_recv()
This commit is contained in:
parent
d0417d353a
commit
6b0561681f
|
@ -66,23 +66,6 @@ int s1ap_send(ogs_sock_t *sock, ogs_pkbuf_t *pkbuf,
|
|||
return OGS_OK;
|
||||
}
|
||||
|
||||
int s1ap_recv(ogs_sock_t *sock, ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
int size;
|
||||
|
||||
ogs_assert(sock);
|
||||
ogs_assert(pkbuf);
|
||||
|
||||
size = ogs_sctp_recvdata(sock, pkbuf->data, MAX_SDU_LEN, NULL, NULL);
|
||||
if (size <= 0) {
|
||||
ogs_error("s1ap_recv() failed");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
ogs_pkbuf_trim(pkbuf, size);
|
||||
return OGS_OK;;
|
||||
}
|
||||
|
||||
int s1ap_send_to_enb(mme_enb_t *enb, ogs_pkbuf_t *pkbuf, uint16_t stream_no)
|
||||
{
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
|
|
|
@ -37,7 +37,6 @@ void s1ap_recv_handler(short when, ogs_socket_t fd, void *data);
|
|||
|
||||
int s1ap_send(ogs_sock_t *sock,
|
||||
ogs_pkbuf_t *pkbuf, ogs_sockaddr_t *addr, uint16_t stream_no);
|
||||
int s1ap_recv(ogs_sock_t *sock, ogs_pkbuf_t *pkbuf);
|
||||
|
||||
int s1ap_send_to_enb(
|
||||
mme_enb_t *enb, ogs_pkbuf_t *pkb, uint16_t stream_no);
|
||||
|
|
|
@ -60,12 +60,24 @@ ogs_socknode_t *testenb_s1ap_client(const char *ipstr)
|
|||
|
||||
ogs_pkbuf_t *testenb_s1ap_read(ogs_socknode_t *node)
|
||||
{
|
||||
int size;
|
||||
ogs_pkbuf_t *recvbuf = NULL;
|
||||
|
||||
ogs_assert(node);
|
||||
ogs_assert(node->sock);
|
||||
|
||||
recvbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
||||
ogs_pkbuf_put(recvbuf, MAX_SDU_LEN);
|
||||
ogs_assert(OGS_OK == s1ap_recv(node->sock, recvbuf));
|
||||
|
||||
return recvbuf;
|
||||
size = ogs_sctp_recvdata(node->sock,
|
||||
recvbuf->data, MAX_SDU_LEN, NULL, NULL);
|
||||
if (size <= 0) {
|
||||
ogs_error("s1ap_recv() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ogs_pkbuf_trim(recvbuf, size);
|
||||
return recvbuf;;
|
||||
}
|
||||
|
||||
int testenb_s1ap_send(ogs_socknode_t *node, ogs_pkbuf_t *sendbuf)
|
||||
|
|
|
@ -213,6 +213,8 @@ static void attach_test1(abts_case *tc, void *data)
|
|||
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
ogs_msleep(50);
|
||||
|
||||
/* Send Initial Context Setup Response */
|
||||
rv = tests1ap_build_initial_context_setup_response(&sendbuf,
|
||||
16777373, 1, 5, 1, "127.0.0.5");
|
||||
|
|
|
@ -202,6 +202,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
ogs_msleep(50);
|
||||
|
||||
/* Send Initial Context Setup Response */
|
||||
rv = tests1ap_build_initial_context_setup_response(&sendbuf,
|
||||
27263233, 24, 5, 1, "127.0.0.5");
|
||||
|
|
Loading…
Reference in New Issue