Change in osmo-mgw[master]: endp: add typeset for e1-endpoints

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Jun 10 13:36:38 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/18755 )


Change subject: endp: add typeset for e1-endpoints
......................................................................

endp: add typeset for e1-endpoints

Add an endpoint typeset for E1 support, also lets add dummy callbacks
for the cleanup and rtp dispatch functionality.

Related: OS#2547
Change-Id: I68b719a906e8f7251f0ca8c74ceec73bc40376f7
---
M include/osmocom/mgcp/mgcp_endp.h
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_endp.c
M src/libosmo-mgcp/mgcp_network.c
4 files changed, 34 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/55/18755/1

diff --git a/include/osmocom/mgcp/mgcp_endp.h b/include/osmocom/mgcp/mgcp_endp.h
index b3627b0..7a39c0d 100644
--- a/include/osmocom/mgcp/mgcp_endp.h
+++ b/include/osmocom/mgcp/mgcp_endp.h
@@ -60,6 +60,7 @@
 /*! MGCP endpoint typeset */
 struct mgcp_endpoint_typeset {
 	struct mgcp_endpoint_type rtp;
+	struct mgcp_endpoint_type e1;
 };
 
 /*! static MGCP endpoint typeset (pre-initalized, read-only) */
diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h
index 174bfd9..2d4857b 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -271,7 +271,10 @@
 int mgcp_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn);
 int mgcp_dispatch_rtp_bridge_cb(int proto, struct sockaddr_in *addr, char *buf,
 				unsigned int buf_size, struct mgcp_conn *conn);
+int mgcp_dispatch_e1_bridge_cb(int proto, struct sockaddr_in *addr, char *buf,
+				unsigned int buf_size, struct mgcp_conn *conn);
 void mgcp_cleanup_rtp_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *conn);
+void mgcp_cleanup_e1_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *conn);
 int mgcp_bind_net_rtp_port(struct mgcp_endpoint *endp, int rtp_port,
 			   struct mgcp_conn_rtp *conn);
 void mgcp_free_rtp_port(struct mgcp_rtp_end *end);
diff --git a/src/libosmo-mgcp/mgcp_endp.c b/src/libosmo-mgcp/mgcp_endp.c
index 2211044..88dcb63 100644
--- a/src/libosmo-mgcp/mgcp_endp.c
+++ b/src/libosmo-mgcp/mgcp_endp.c
@@ -30,7 +30,11 @@
 	/* Specify endpoint properties for RTP endpoint */
 	.rtp.max_conns = 2,
 	.rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb,
-	.rtp.cleanup_cb = mgcp_cleanup_rtp_bridge_cb
+	.rtp.cleanup_cb = mgcp_cleanup_rtp_bridge_cb,
+	/* Specify endpoint properties for E1 endpoint */
+	.e1.max_conns = 1,
+	.e1.dispatch_rtp_cb = mgcp_dispatch_e1_bridge_cb,
+	.e1.cleanup_cb = mgcp_cleanup_e1_bridge_cb,
 };
 
 /* Generate virtual endpoint name from given parameters */
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 7651486..565151a 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1328,6 +1328,21 @@
 
 }
 
+/*! dispatch incoming RTP packet to E1 subslot
+ *  \param[in] proto protocol (MGCP_CONN_TYPE_RTP or MGCP_CONN_TYPE_RTCP)
+ *  \param[in] addr socket address where the RTP packet has been received from
+ *  \param[in] buf buffer that hold the RTP payload
+ *  \param[in] buf_size size data length of buf
+ *  \param[in] conn originating connection
+ *  \returns 0 on success, -1 on ERROR */
+int mgcp_dispatch_e1_bridge_cb(int proto, struct sockaddr_in *addr, char *buf,
+				unsigned int buf_size, struct mgcp_conn *conn)
+{
+	LOGPCONN(conn, DRTP, LOGL_FATAL,
+		 "cannot dispatch! E1 support is not implemented yet!\n");
+	return -1;
+}
+
 /*! cleanup an endpoint when a connection on an RTP bridge endpoint is removed.
  *  \param[in] endp Endpoint on which the connection resides.
  *  \param[in] conn Connection that is about to be removed (ignored).
@@ -1347,6 +1362,16 @@
 	}
 }
 
+/*! cleanup an endpoint when a connection on an E1 endpoint is removed.
+ *  \param[in] endp Endpoint on which the connection resides.
+ *  \param[in] conn Connection that is about to be removed (ignored).
+ *  \returns 0 on success, -1 on ERROR. */
+void mgcp_cleanup_e1_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *conn)
+{
+	LOGPCONN(conn, DRTP, LOGL_FATAL,
+		 "cannot dispatch! E1 support is not implemented yet!\n");
+}
+
 /* Handle incoming RTP data from NET */
 static int rtp_data_net(struct osmo_fd *fd, unsigned int what)
 {

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I68b719a906e8f7251f0ca8c74ceec73bc40376f7
Gerrit-Change-Number: 18755
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200610/237a0193/attachment.htm>


More information about the gerrit-log mailing list