pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/29526 )

Change subject: Allocate struct osmux_in_handle through new libosmo-netif APIs
......................................................................

Allocate struct osmux_in_handle through new libosmo-netif APIs

Change-Id: I013c99d1f915279684ce278648e9c69e39b94266
Depends: libosmo-netif.git I752ab031f935f04731bb1a354333f1682a1aa5bd
---
M TODO-RELEASE
M src/libosmo-mgcp/mgcp_osmux.c
2 files changed, 8 insertions(+), 13 deletions(-)

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



diff --git a/TODO-RELEASE b/TODO-RELEASE
index e8029f9..3e8b2ee 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -24,4 +24,4 @@
 # If any interfaces have been removed or changed since the last public 
release, a=0.
 #
 #library               what            description / commit summary line
-libosmo-netif           >1.2.0          OSMUX_DEFAULT_PORT, 
osmux_xfrm_output_alloc, osmux_xfrm_output_set_rtp_*
+libosmo-netif           >1.2.0          OSMUX_DEFAULT_PORT, 
osmux_xfrm_output_*, osmux_xfrm_input_*
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index a4ce024..5c3ddbf 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -144,7 +144,7 @@
                                     in->stats.output_osmux_msgs,
                                     in->stats.output_osmux_bytes);
                                llist_del(&h->head);
-                               osmux_xfrm_input_fini(h->in);
+                               TALLOC_FREE(h->in);
                                talloc_free(h);
                        }
                        return;
@@ -167,22 +167,17 @@
        h->rem_addr = *rem_addr;
        h->refcnt++;

-       h->in = talloc_zero(h, struct osmux_in_handle);
+       h->in = osmux_xfrm_input_alloc(h);
        if (!h->in) {
                talloc_free(h);
                return NULL;
        }
-
        /* sequence number to start OSMUX message from */
-       h->in->osmux_seq = 0;
-
-       h->in->batch_factor = cfg->osmux_batch;
-
-       /* If batch size is zero, the library defaults to 1470 bytes. */
-       h->in->batch_size = cfg->osmux_batch_size;
-       h->in->deliver = osmux_deliver_cb;
-       osmux_xfrm_input_init(h->in);
-       h->in->data = h;
+       osmux_xfrm_input_set_initial_seqnum(h->in, 0);
+       osmux_xfrm_input_set_batch_factor(h->in, cfg->osmux_batch);
+       /* If batch size is zero, the library defaults to 1472 bytes. */
+       osmux_xfrm_input_set_batch_size(h->in, cfg->osmux_batch_size);
+       osmux_xfrm_input_set_deliver_cb(h->in, osmux_deliver_cb, h);

        llist_add(&h->head, &osmux_handle_list);


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29526
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I013c99d1f915279684ce278648e9c69e39b94266
Gerrit-Change-Number: 29526
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to