arehbein has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/32908 )

Change subject: examples: Add extension header octet to example
......................................................................

examples: Add extension header octet to example

Mainly to make data/packets look (pseudo-)correct in Wireshark

Change-Id: I962b9edcba65cdc98da00d2f8753dc5acd481502
---
M examples/ipa-stream-client.c
M src/stream.c
2 files changed, 18 insertions(+), 3 deletions(-)




diff --git a/examples/ipa-stream-client.c b/examples/ipa-stream-client.c
index 48421b7..c3bb2a3 100644
--- a/examples/ipa-stream-client.c
+++ b/examples/ipa-stream-client.c
@@ -74,7 +74,7 @@
                char *ptr;
                int x;

-               msg = osmo_ipa_msg_alloc(0);
+               msg = osmo_ipa_msg_alloc(sizeof(struct ipa_head_ext));
                if (msg == NULL) {
                        LOGP(DLINP, LOGL_ERROR, "cannot alloc msg\n");
                        return -1;
@@ -93,6 +93,7 @@
                msg_sent->num = i;
                llist_add(&msg_sent->head, &msg_sent_list);

+               ipa_prepend_header_ext(msg, IPAC_PROTO_EXT_MGCP);
                osmo_ipa_msg_push_header(msg, IPAC_PROTO_OSMO);

                osmo_stream_cli_send(conn, msg);
@@ -115,7 +116,7 @@
        int num;
        struct msg_sent *cur, *tmp, *found = NULL;

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

        llist_for_each_entry_safe(cur, tmp, &msg_sent_list, head) {
diff --git a/src/stream.c b/src/stream.c
index 4e57e03..150b85f 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -688,8 +688,11 @@
        case STREAM_CLI_STATE_CONNECTED:
                if (res == 0)
                        osmo_stream_cli_reconnect(cli);
-               else if (cli->iofd_read_cb)
+               else if (cli->iofd_read_cb) {
+                       // if (cli->stream_proto == OSMO_STREAM_IPAC)
+                       //      ipa_check_pull_headers(
                        cli->iofd_read_cb(cli, msg);
+               }
                break;
        default:
                osmo_panic("osmo_stream_cli_write_cb() called with unexpected 
state %d\n", cli->state);

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

Gerrit-Project: libosmo-netif
Gerrit-Branch: arehbein/osmo_io_ipa
Gerrit-Change-Id: I962b9edcba65cdc98da00d2f8753dc5acd481502
Gerrit-Change-Number: 32908
Gerrit-PatchSet: 3
Gerrit-Owner: arehbein <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-MessageType: merged

Reply via email to