daniel has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/33198?usp=email )

Change subject: stream: Add client-side (segmentation) support for IPA
......................................................................

stream: Add client-side (segmentation) support for IPA

With this commit, IPA segmentation is taken care of by setting the
segmentation callback provided by libosmo-netif.

The ipa-stream-server example needs to prepend IPA headers now because
those are stripped by the segm. cb on both sides.

Depends: libosmocore.git I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f

Related: OS#5753, OS#5751
Change-Id: I822abf52c6ae396c90b5c50228a0a39c848d3de6
---
M examples/ipa-stream-client.c
M examples/ipa-stream-server.c
M include/osmocom/netif/stream.h
M src/stream_cli.c
M tests/stream/stream_test.c
M tests/stream/stream_test.err
M tests/stream/stream_test.ok
7 files changed, 333 insertions(+), 18 deletions(-)

Approvals:
  daniel: Looks good to me, approved
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve




diff --git a/examples/ipa-stream-client.c b/examples/ipa-stream-client.c
index 10eb786..db7d441 100644
--- a/examples/ipa-stream-client.c
+++ b/examples/ipa-stream-client.c
@@ -106,7 +106,7 @@

 static int read_cb(struct osmo_stream_cli *conn, struct msgb *msg)
 {
-       LOGP(DIPATEST, LOGL_DEBUG, "received message from stream (len=%d)\n", 
msgb_length(msg));
+       LOGP(DIPATEST, LOGL_DEBUG, "received message from stream (payload 
len=%d)\n", msgb_length(msg));

        if (osmo_ipa_process_msg(msg) < 0) {
                LOGP(DIPATEST, LOGL_ERROR, "bad IPA message\n");
@@ -116,7 +116,7 @@
        int num;
        struct msg_sent *cur, *tmp, *found = NULL;

-       num = ntohl(*((int *)(msg->data + sizeof(struct ipa_head) + 
sizeof(struct ipa_head_ext))));
+       num = osmo_load32be(msg->data);
        LOGP(DLINP, LOGL_DEBUG, "received msg number %d\n", num);

        llist_for_each_entry_safe(cur, tmp, &msg_sent_list, head) {
@@ -184,6 +184,8 @@
                exit(EXIT_FAILURE);
        }

+       osmo_stream_cli_set_segmentation_cb(conn, osmo_ipa_segmentation_cb);
+
        LOGP(DIPATEST, LOGL_NOTICE, "Entering main loop\n");

        while(1) {
diff --git a/examples/ipa-stream-server.c b/examples/ipa-stream-server.c
index 1caef96..d31b752 100644
--- a/examples/ipa-stream-server.c
+++ b/examples/ipa-stream-server.c
@@ -49,7 +49,10 @@

 int read_cb(struct osmo_stream_srv *conn, struct msgb *msg)
 {
-       LOGP(DSTREAMTEST, LOGL_DEBUG, "received message from stream 
(len=%d)\n", msgb_length(msg));
+       LOGP(DSTREAMTEST, LOGL_DEBUG, "received message from stream (payload 
len=%d)\n", msgb_length(msg));
+
+       ipa_prepend_header_ext(msg, IPAC_PROTO_EXT_MGCP);
+       osmo_ipa_msg_push_header(msg, IPAC_PROTO_OSMO);

        osmo_stream_srv_send(conn, msg);
        return 0;
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 6ee5820..a24244c 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -100,6 +100,7 @@
 void osmo_stream_cli_set_disconnect_cb(struct osmo_stream_cli *cli, int 
(*disconnect_cb)(struct osmo_stream_cli *cli));
 void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int 
(*read_cb)(struct osmo_stream_cli *cli));
 void osmo_stream_cli_set_read_cb2(struct osmo_stream_cli *cli, int 
(*read_cb)(struct osmo_stream_cli *cli, struct msgb *msg));
+void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, int 
(*segmentation_cb)(struct msgb *msg));
 void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli);
 bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli);

diff --git a/src/stream_cli.c b/src/stream_cli.c
index 23e1900..ef571cc 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -119,6 +119,7 @@
        int (*read_cb)(struct osmo_stream_cli *cli);
        int (*iofd_read_cb)(struct osmo_stream_cli *cli, struct msgb *msg);
        int (*write_cb)(struct osmo_stream_cli *cli);
+       int (*segmentation_cb)(struct msgb *msg);
        void                            *data;
        int                             flags;
        int                             reconnect_timeout;
@@ -419,6 +420,7 @@
        cli->state = STREAM_CLI_STATE_CLOSED;
        osmo_timer_setup(&cli->timer, cli_timer_cb, cli);
        cli->reconnect_timeout = 5;     /* default is 5 seconds. */
+       cli->segmentation_cb = NULL;
        INIT_LLIST_HEAD(&cli->tx_queue);

        cli->ma_pars.sctp.version = 0;
@@ -585,6 +587,29 @@
        cli->flags |= OSMO_STREAM_CLI_F_RECONF;
 }

+/* Configure client side segmentation for the iofd */
+static void configure_cli_segmentation_cb(struct osmo_io_fd *iofd,
+                                              int (*segmentation_cb)(struct 
msgb *msg))
+{
+       /* Copy default settings */
+       struct osmo_io_ops client_ops = osmo_stream_cli_ioops;
+       /* Set segmentation cb for this client */
+       client_ops.segmentation_cb = segmentation_cb;
+       osmo_iofd_set_ioops(iofd, &client_ops);
+}
+
+/*! \brief Set the segmentation callback for the client
+ *  \param[in,out] cli Stream Client to modify
+ *  \param[in] segmentation_cb Target segmentation callback
+ */
+void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli,
+                                        int (*segmentation_cb)(struct msgb 
*msg))
+{
+       cli->segmentation_cb = segmentation_cb;
+       if (cli->iofd) /* Otherwise, this will be done in 
osmo_stream_cli_open() */
+               configure_cli_segmentation_cb(cli->iofd, segmentation_cb);
+}
+
 /*! \brief Set the socket type for the stream server link
  *  \param[in] cli Stream Client to modify
  *  \param[in] type Socket Type (like SOCK_STREAM (default), SOCK_SEQPACKET, 
...)
@@ -869,6 +894,7 @@
                        cli->iofd = osmo_iofd_setup(cli, fd, cli->name, 
OSMO_IO_FD_MODE_READ_WRITE, &osmo_stream_cli_ioops, cli);
                if (!cli->iofd)
                        goto error_close_socket;
+               configure_cli_segmentation_cb(cli->iofd, cli->segmentation_cb);

                if (osmo_iofd_register(cli->iofd, fd) < 0)
                        goto error_close_socket;
diff --git a/tests/stream/stream_test.c b/tests/stream/stream_test.c
index be0b278..e945a1e 100644
--- a/tests/stream/stream_test.c
+++ b/tests/stream/stream_test.c
@@ -490,14 +490,14 @@
 static int test_segm_ipa_stream_srv_cli_read_cb(struct osmo_stream_cli *osc, 
struct msgb *msg)
 {
        unsigned char *data;
-       struct ipa_head *h = (struct ipa_head *) msg->data;
-       uint8_t ipac_msg_type = ((uint8_t *)h)[sizeof(struct ipa_head)];
+       struct ipa_head *h = (struct ipa_head *) msg->l1h;
+       uint8_t ipac_msg_type = *msg->data;
        struct msgb *reply = msgb_alloc_headroom(128, 0, "IPA reply");
        if (reply == NULL) {
                fprintf(stderr, "Cannot allocate message\n");
                return -ENOMEM;
        }
-       LOGCLI(osc, "Received message from stream (total len = %" PRIu16 ")\n", 
msgb_length(msg));
+       LOGCLI(osc, "Received message from stream (payload len = %" PRIu16 
")\n", msgb_length(msg));
        if (ipac_msg_type < 0 || 5 < ipac_msg_type) {
                fprintf(stderr, "Received unexpected IPAC message type 
%"PRIu8"\n", ipac_msg_type);
                return -ENOMSG;
@@ -526,7 +526,7 @@
        return 0;
 }

-static void *test_segm_ipa_stream_srv_run_client(void)
+struct osmo_stream_cli *test_segm_ipa_stream_srv_run_client(void)
 {
        struct osmo_stream_cli *osc;
        void *ctx = talloc_named_const(NULL, 0, __func__);
@@ -548,8 +548,9 @@
                fprintf(stderr, "Cannot open stream client\n");
                return NULL;
        }
+       osmo_stream_cli_set_segmentation_cb(osc, osmo_ipa_segmentation_cb);

-       return NULL;
+       return osc;
 }

 int test_segm_ipa_stream_srv_srv_read_cb(struct osmo_stream_srv *conn, struct 
msgb *msg)
@@ -568,7 +569,7 @@
        LOGSRV(conn, "\t(msg dump: %s)\n", osmo_hexdump(msg->l1h, msg->len + 
sizeof(struct ipa_head)));
        if (*msgt == IPAC_MSGT_ID_RESP) { /*  */
                LOGSRV(conn, "Send IPAC_MSGT_ID_GET to trigger client to send 
next third\n\n");
-               m = msgb_alloc_headroom(128, 0, "IPA messages");
+               m = osmo_ipa_msg_alloc(128);
                if (m == NULL) {
                        fprintf(stderr, "Cannot allocate message\n");
                        return -ENOMEM;
@@ -581,12 +582,6 @@
        return 0;
 }

-static int test_segm_ipa_stream_srv_srv_close_cb(struct osmo_stream_srv *conn)
-{
-       osmo_stream_srv_set_segmentation_cb(conn, NULL);
-       return 0;
-}
-
 static int test_segm_ipa_stream_srv_srv_accept_cb(struct osmo_stream_srv_link 
*srv, int fd)
 {
        void *ctx = talloc_named_const(NULL, 0, __func__);
@@ -598,13 +593,13 @@
        }
        osmo_stream_srv_set_segmentation_cb(oss, osmo_ipa_segmentation_cb);
        osmo_stream_srv_set_read_cb(oss, test_segm_ipa_stream_srv_srv_read_cb);
-       osmo_stream_srv_set_closed_cb(oss, 
test_segm_ipa_stream_srv_srv_close_cb);
        return 0;
 }

 static void test_segm_ipa_stream_srv_run(void *ctx, const char *host, unsigned 
port,
                                  struct osmo_stream_srv_link *srv)
 {
+       struct osmo_stream_cli *osc;
        const char *testname = "test_segm_ipa_stream_srv";
        osmo_stream_srv_link_set_accept_cb(srv,
                test_segm_ipa_stream_srv_srv_accept_cb);
@@ -612,7 +607,7 @@
                printf("Unable to open server\n");
                exit(1);
        }
-       test_segm_ipa_stream_srv_run_client();
+       osc = test_segm_ipa_stream_srv_run_client();

        printf("______________________________________Running test 
%s______________________________________\n", testname);
        alarm(2);
@@ -623,6 +618,8 @@
        }
        alarm(0);
        printf("==================================Test %s 
complete========================================\n\n", testname);
+       if (osc)
+               osmo_stream_cli_destroy(osc);
 }

 static void sigalarm_handler(int _foo)
@@ -631,6 +628,202 @@
        exit(EXIT_FAILURE);
 }

+static struct osmo_timer_list fragmented_send_tl_srv;
+
+static unsigned test_segm_ipa_stream_cli_srv_msglognum = 0;
+
+/* Like CLI_APPEND_MSG, but for server side */
+#define SRV_APPEND_MSG(OSMO_STREAM_SRV_PTR, UCHAR_PTR_DST, STRUCT_MSGB_PTR, 
SRC_IPAC_MSG_BUF) do {\
+       LOGSRV(OSMO_STREAM_SRV_PTR, "[%u-srv] Appending msg of type %s into 
buffer\n",\
+               ++test_segm_ipa_stream_cli_srv_msglognum, 
IPAC_MSG_TYPES[SRC_IPAC_MSG_BUF[IPAC_MSGT_OFFSET]]);\
+       LOGSRV(OSMO_STREAM_SRV_PTR, "\t(msg dump: %s)\n", 
osmo_hexdump(SRC_IPAC_MSG_BUF,\
+              sizeof(SRC_IPAC_MSG_BUF)));\
+       put_ipa_msg(UCHAR_PTR_DST, STRUCT_MSGB_PTR, SRC_IPAC_MSG_BUF);\
+} while (0)
+
+static void send_last_third_srv(void *osmo_stream_srv_arg)
+{
+       struct osmo_stream_srv *oss = osmo_stream_srv_arg;
+       unsigned char *data;
+       struct msgb *reply = msgb_alloc_headroom(128, 0, "IPA delayed reply");
+
+       LOGSRV(oss, "Delay for sending last third of message is over\n");
+       if (reply == NULL) {
+               fprintf(stderr, "Cannot allocate message\n");
+               return;
+       }
+       LOGSRV(oss, "[%u-srv] Appending: Last third of IPAC_MSGT_ID_GET\n",
+              ++test_segm_ipa_stream_cli_srv_msglognum);
+       data = msgb_put(reply, ipac_msg_idreq_last_third);
+       memcpy(data, ipac_msg_idreq + 2 * ipac_msg_idreq_third,
+              ipac_msg_idreq_last_third);
+       /* Append two entire messages */
+       SRV_APPEND_MSG(oss, data, reply, ipac_msg_pong);
+       SRV_APPEND_MSG(oss, data, reply, ipac_msg_pong);
+       LOGSRV(oss, "\tSending:"
+                   "[ Last third of IPAC_MSGT_ID_GET | IPAC_MSGT_PONG | 
IPAC_MSGT_PONG ]\n");
+       LOGSRV(oss, "\t(msg dump: %s)\n\n", osmo_hexdump(reply->data, 
reply->len));
+       osmo_stream_srv_send(oss, reply);
+}
+
+int test_segm_ipa_stream_cli_srv_read_cb(struct osmo_stream_srv *conn, struct 
msgb *msg)
+{
+       unsigned char *data;
+       struct ipa_head *h = (struct ipa_head *) msg->l1h;
+       uint8_t ipa_msg_type = ((uint8_t *)h)[sizeof(struct ipa_head)];
+       struct msgb *reply = msgb_alloc_headroom(128, 0, "IPA reply");
+       if (reply == NULL) {
+               fprintf(stderr, "Cannot allocate message\n");
+               return -ENOMEM;
+       }
+       LOGSRV(conn, "Received message from stream (total len including 
stripped headers = %lu)\n",
+              osmo_ntohs(h->len) + sizeof(*h));
+       if (ipa_msg_type < 0 || 5 < ipa_msg_type) {
+               fprintf(stderr, "Received unexpected IPAC message type 
%"PRIu8"\n", ipa_msg_type);
+               return -ENOMSG;
+       }
+       LOGSRV(conn, "\tType: %s\n", IPAC_MSG_TYPES[ipa_msg_type]);
+       if (ipa_msg_type == IPAC_MSGT_ID_GET) {
+               LOGSRV(conn, "Got IPAC_MSGT_ID_GET from client\n");
+               LOGSRV(conn, "[(%u + 2/3) -srv] Appending: Second third of 
IPAC_MSGT_ID_GET\n",
+                      test_segm_ipa_stream_cli_srv_msglognum);
+               data = msgb_put(reply, ipac_msg_idreq_third);
+               memcpy(data, ipac_msg_idreq + ipac_msg_idreq_third,
+                      ipac_msg_idreq_third);
+               LOGSRV(conn, "\tSending: Second third of IPAC_MSGT_ID_GET\n");
+               LOGSRV(conn, "\t(msg dump: %s)\n", osmo_hexdump(reply->data, 
reply->len));
+               osmo_stream_srv_send(conn, reply);
+               osmo_timer_setup(&fragmented_send_tl_srv, send_last_third_srv, 
conn);
+               osmo_timer_add(&fragmented_send_tl_srv);
+               osmo_timer_schedule(&fragmented_send_tl_srv, 0, 125000);
+       } else if (ipa_msg_type == IPAC_MSGT_ID_RESP) {
+               LOGSRV(conn, "\tresult=  %s\n",
+                      osmo_hexdump((const unsigned char *)h, sizeof(*h) + 
h->len));
+               LOGSRV(conn, "\texpected=%s\n",
+                      osmo_hexdump(ipac_msg_idresp, sizeof(ipac_msg_idresp)));
+       }
+       printf("\n");
+       return 0;
+}
+
+static int test_segm_ipa_stream_cli_srv_accept_cb(struct osmo_stream_srv_link 
*srv, int fd)
+{
+       void *ctx = talloc_named_const(NULL, 0, __func__);
+       struct osmo_stream_srv *oss =
+               osmo_stream_srv_create2(ctx, srv, fd, NULL);
+       unsigned char *data;
+       struct msgb *m = msgb_alloc_headroom(128, 0, "IPA messages");
+       if (oss == NULL) {
+               fprintf(stderr, "Error while creating connection\n");
+               return -1;
+       }
+       if (m == NULL) {
+               fprintf(stderr, "Cannot allocate message\n");
+               return -ENOMEM;
+       }
+       osmo_stream_srv_set_segmentation_cb(oss, osmo_ipa_segmentation_cb);
+       osmo_stream_srv_set_read_cb(oss, test_segm_ipa_stream_cli_srv_read_cb);
+
+       /* Send 4 and 1/3 messages, as done analogously in 
test_segm_ipa_stream_srv_cli_connect_cb() */
+       /* Append 4 */
+       SRV_APPEND_MSG(oss, data, m, ipac_msg_ping);
+       SRV_APPEND_MSG(oss, data, m, ipac_msg_pong);
+       SRV_APPEND_MSG(oss, data, m, ipac_msg_ping);
+       SRV_APPEND_MSG(oss, data, m, ipac_msg_idresp);
+       /* Append 1/3 */
+       LOGSRV(oss, "[(0%u + 1/3)-srv] Appending 1st third of msg of type %s 
into buffer\n",
+              test_segm_ipa_stream_cli_srv_msglognum, 
IPAC_MSG_TYPES[ipac_msg_idreq[3]]);
+       LOGSRV(oss, "\t(dump: %s)\n", osmo_hexdump(ipac_msg_idreq, 
ipac_msg_idreq_third));
+       data = msgb_put(m, ipac_msg_idreq_third);
+       memcpy(data, ipac_msg_idreq, ipac_msg_idreq_third);
+
+       LOGSRV(oss, "Sending 4 + 1/3 messages as one:\n");
+       LOGSRV(oss, "\t(msg dump: %s)\n\n", osmo_hexdump(m->data, m->len));
+       osmo_stream_srv_send(oss, m);
+       return 0;
+}
+
+static bool test_segm_ipa_stream_cli_all_msgs_processed = false;
+
+static int test_segm_ipa_stream_cli_cli_read_cb(struct osmo_stream_cli *osc, 
struct msgb *msg)
+{
+       static unsigned msgnum_cli = 0;
+       unsigned char *data;
+       struct msgb *m;
+       uint8_t *msgt = msg->data;
+       LOGCLI(osc, "[%u-cli] Received message from stream (len = %" PRIu16 
")\n",
+              ++msgnum_cli, msgb_length(msg));
+       LOGCLI(osc, "\tmsg buff data: %s\n", osmo_hexdump(msg->data, msg->len));
+       LOGCLI(osc, "\tIPA payload: %s\n", osmo_hexdump(msg->data, msg->len));
+       LOGCLI(osc, "\tType: %s\n", IPAC_MSG_TYPES[*msgt]);
+       LOGCLI(osc, "\t(msg dump (including stripped headers): %s)\n",
+              osmo_hexdump(msg->l1h, sizeof(struct ipa_head) + msg->len));
+       if (*msgt == IPAC_MSGT_ID_RESP) {
+               LOGCLI(osc, "Send IPAC_MSGT_ID_GET to trigger server to send 
next third\n\n");
+               m = msgb_alloc_headroom(128, sizeof(struct ipa_head) +
+                                            sizeof(struct ipa_head_ext), "IPA 
messages");
+               if (m == NULL) {
+                       fprintf(stderr, "Cannot allocate message\n");
+                       return -ENOMEM;
+               }
+               put_ipa_msg(data, m, ipac_msg_idreq);
+               osmo_stream_cli_send(osc, m);
+       } else if (msgnum_cli == 7 && *msgt == IPAC_MSGT_PONG) {
+               test_segm_ipa_stream_cli_all_msgs_processed = true;
+       }
+       return 0;
+}
+
+static void *test_segm_ipa_stream_cli_run_client(void)
+{
+       struct osmo_stream_cli *osc;
+       void *ctx = talloc_named_const(NULL, 0, __func__);
+
+       (void) msgb_talloc_ctx_init(ctx, 0);
+       osc = osmo_stream_cli_create(ctx);
+       if (osc == NULL) {
+               fprintf(stderr, "osmo_stream_cli_create_iofd()\n");
+               return NULL;
+       }
+       osmo_stream_cli_set_addr(osc, "127.0.0.11");
+       osmo_stream_cli_set_local_port(osc, 8977);
+       osmo_stream_cli_set_port(osc, 1112);
+       osmo_stream_cli_set_data(osc, ctx);
+       osmo_stream_cli_set_read_cb2(osc, test_segm_ipa_stream_cli_cli_read_cb);
+       osmo_stream_cli_set_nodelay(osc, true);
+       osmo_stream_cli_set_segmentation_cb(osc, osmo_ipa_segmentation_cb);
+       if (osmo_stream_cli_open(osc) < 0) {
+               fprintf(stderr, "Cannot open stream client\n");
+               return NULL;
+       }
+
+       return NULL;
+}
+
+static void test_segm_ipa_stream_cli_run(void *ctx, const char *host, unsigned 
port,
+                                 struct osmo_stream_srv_link *srv)
+{
+       const char *testname = "test_segm_ipa_stream_cli";
+       osmo_stream_srv_link_set_accept_cb(srv,
+               test_segm_ipa_stream_cli_srv_accept_cb);
+       osmo_stream_srv_link_set_port(srv, 1112);
+       if (osmo_stream_srv_link_open(srv) < 0) {
+               printf("Unable to open server\n");
+               exit(1);
+       }
+       test_segm_ipa_stream_cli_run_client();
+
+       printf("______________________________________Running test 
%s______________________________________\n", testname);
+       alarm(2);
+
+       while (!test_segm_ipa_stream_cli_all_msgs_processed) {
+               osmo_gettimeofday_override_add(0, 1); /* small increment to 
easily spot iterations */
+               osmo_select_main(1);
+       }
+       alarm(0);
+       printf("==================================Test %s 
complete========================================\n\n", testname);
+}
+
 int main(void)
 {

@@ -679,6 +872,7 @@
        test_recon(tall_test, host, port, 8, srv, false);

        test_segm_ipa_stream_srv_run(tall_test, host, port, srv);
+       test_segm_ipa_stream_cli_run(tall_test, host, port, srv);

        printf("Stream tests completed\n");

diff --git a/tests/stream/stream_test.err b/tests/stream/stream_test.err
index 03ce0cf..6c85c43 100644
--- a/tests/stream/stream_test.err
+++ b/tests/stream/stream_test.err
@@ -49,3 +49,5 @@
 {20.000019} non-reconnecting test step 0 [client OK, server OK], FD reg 0
 SRV(srv_link_test,127.0.0.11:1111) accept()ed new link from 127.0.0.1:8977
 CLICONN(,r=127.0.0.11:1111<->l=127.0.0.1:8977){CONNECTING} connection 
established
+SRV(srv_link_test,127.0.0.11:1112) accept()ed new link from 127.0.0.1:8977
+CLICONN(,r=127.0.0.11:1112<->l=127.0.0.1:8977){CONNECTING} connection 
established
diff --git a/tests/stream/stream_test.ok b/tests/stream/stream_test.ok
index f21b486..fb65aa7 100644
--- a/tests/stream/stream_test.ok
+++ b/tests/stream/stream_test.ok
@@ -84,7 +84,7 @@
 {20.000022} [NA|OK] Server's test_segm_ipa_stream_srv_srv_read_cb():   (msg 
dump: 00 07 fe 05 01 01 de ad be ef )
 {20.000022} [NA|OK] Server's test_segm_ipa_stream_srv_srv_read_cb(): Send 
IPAC_MSGT_ID_GET to trigger client to send next third

-{20.000024} [OK] Client's test_segm_ipa_stream_srv_cli_read_cb(): Received 
message from stream (total len = 6)
+{20.000024} [OK] Client's test_segm_ipa_stream_srv_cli_read_cb(): Received 
message from stream (payload len = 3)
 {20.000024} [OK] Client's test_segm_ipa_stream_srv_cli_read_cb():      Type: 
IPAC_MSGT_ID_GET
 {20.000024} [OK] Client's test_segm_ipa_stream_srv_cli_read_cb(): Got 
IPAC_MSGT_ID_GET from server
 {20.000024} [OK] Client's test_segm_ipa_stream_srv_cli_read_cb(): [(4 + 2/3) 
-cli] Appending: Second third of IPAC_MSGT_ID_GET
@@ -117,4 +117,73 @@
 {20.500026} [NA|OK] Server's test_segm_ipa_stream_srv_srv_read_cb():   (msg 
dump: 00 01 fe 01 )
 ==================================Test test_segm_ipa_stream_srv 
complete========================================

+______________________________________Running test 
test_segm_ipa_stream_cli______________________________________
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb(): [1-srv] 
Appending msg of type IPAC_MSGT_PING into buffer
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb():         
(msg dump: 00 01 fe 00 )
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb(): [2-srv] 
Appending msg of type IPAC_MSGT_PONG into buffer
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb():         
(msg dump: 00 01 fe 01 )
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb(): [3-srv] 
Appending msg of type IPAC_MSGT_PING into buffer
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb():         
(msg dump: 00 01 fe 00 )
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb(): [4-srv] 
Appending msg of type IPAC_MSGT_ID_RESP into buffer
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb():         
(msg dump: 00 07 fe 05 01 01 de ad be ef )
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb(): [(04 + 
1/3)-srv] Appending 1st third of msg of type IPAC_MSGT_ID_GET into buffer
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb():         
(dump: 00 03 )
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb(): Sending 
4 + 1/3 messages as one:
+{20.500027} [NA|OK] Server's test_segm_ipa_stream_cli_srv_accept_cb():         
(msg dump: 00 01 fe 00 00 01 fe 01 00 01 fe 00 00 07 fe 05 01 01 de ad be ef 00 
03 )
+
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [1-cli] 
Received message from stream (len = 1)
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      msg 
buff data: 00
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      IPA 
payload: 00
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      Type: 
IPAC_MSGT_PING
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      (msg 
dump (including stripped headers): 00 01 fe 00 )
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [2-cli] 
Received message from stream (len = 1)
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      msg 
buff data: 01
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      IPA 
payload: 01
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      Type: 
IPAC_MSGT_PONG
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      (msg 
dump (including stripped headers): 00 01 fe 01 )
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [3-cli] 
Received message from stream (len = 1)
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      msg 
buff data: 00
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      IPA 
payload: 00
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      Type: 
IPAC_MSGT_PING
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      (msg 
dump (including stripped headers): 00 01 fe 00 )
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [4-cli] 
Received message from stream (len = 7)
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      msg 
buff data: 05 01 01 de ad be ef
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      IPA 
payload: 05 01 01 de ad be ef
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      Type: 
IPAC_MSGT_ID_RESP
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      (msg 
dump (including stripped headers): 00 07 fe 05 01 01 de ad be ef )
+{20.500029} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): Send 
IPAC_MSGT_ID_GET to trigger server to send next third
+
+{20.500031} [NA|OK] Server's test_segm_ipa_stream_cli_srv_read_cb(): Received 
message from stream (total len including stripped headers = 6)
+{20.500031} [NA|OK] Server's test_segm_ipa_stream_cli_srv_read_cb():   Type: 
IPAC_MSGT_ID_GET
+{20.500031} [NA|OK] Server's test_segm_ipa_stream_cli_srv_read_cb(): Got 
IPAC_MSGT_ID_GET from client
+{20.500031} [NA|OK] Server's test_segm_ipa_stream_cli_srv_read_cb(): [(4 + 
2/3) -srv] Appending: Second third of IPAC_MSGT_ID_GET
+{20.500031} [NA|OK] Server's test_segm_ipa_stream_cli_srv_read_cb():   
Sending: Second third of IPAC_MSGT_ID_GET
+{20.500031} [NA|OK] Server's test_segm_ipa_stream_cli_srv_read_cb():   (msg 
dump: fe 04 )
+
+{20.625031} [NA|OK] Server's send_last_third_srv(): Delay for sending last 
third of message is over
+{20.625031} [NA|OK] Server's send_last_third_srv(): [5-srv] Appending: Last 
third of IPAC_MSGT_ID_GET
+{20.625031} [NA|OK] Server's send_last_third_srv(): [6-srv] Appending msg of 
type IPAC_MSGT_PONG into buffer
+{20.625031} [NA|OK] Server's send_last_third_srv():    (msg dump: 00 01 fe 01 )
+{20.625031} [NA|OK] Server's send_last_third_srv(): [7-srv] Appending msg of 
type IPAC_MSGT_PONG into buffer
+{20.625031} [NA|OK] Server's send_last_third_srv():    (msg dump: 00 01 fe 01 )
+{20.625031} [NA|OK] Server's send_last_third_srv():    Sending:[ Last third of 
IPAC_MSGT_ID_GET | IPAC_MSGT_PONG | IPAC_MSGT_PONG ]
+{20.625031} [NA|OK] Server's send_last_third_srv():    (msg dump: 01 01 00 01 
fe 01 00 01 fe 01 )
+
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [5-cli] 
Received message from stream (len = 3)
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      msg 
buff data: 04 01 01
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      IPA 
payload: 04 01 01
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      Type: 
IPAC_MSGT_ID_GET
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      (msg 
dump (including stripped headers): 00 03 fe 04 01 01 )
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [6-cli] 
Received message from stream (len = 1)
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      msg 
buff data: 01
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      IPA 
payload: 01
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      Type: 
IPAC_MSGT_PONG
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      (msg 
dump (including stripped headers): 00 01 fe 01 )
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [7-cli] 
Received message from stream (len = 1)
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      msg 
buff data: 01
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      IPA 
payload: 01
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      Type: 
IPAC_MSGT_PONG
+{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb():      (msg 
dump (including stripped headers): 00 01 fe 01 )
+==================================Test test_segm_ipa_stream_cli 
complete========================================
+
 Stream tests completed

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33198?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I822abf52c6ae396c90b5c50228a0a39c848d3de6
Gerrit-Change-Number: 33198
Gerrit-PatchSet: 24
Gerrit-Owner: arehbein <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-CC: osmith <[email protected]>
Gerrit-MessageType: merged

Reply via email to