Change in osmocom-bb[master]: virtphy: Add command line arguments to set multicast netdev + TTL

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/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Mar 10 17:59:05 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/17446 )


Change subject: virtphy: Add command line arguments to set multicast netdev + TTL
......................................................................

virtphy: Add command line arguments to set multicast netdev + TTL

This allows us to bind the multicast sockets to a given network device
and/or to set the TTL of the multicast frames and hence control their
reach in terms of number of network hops.

Change-Id: Ia74aa381a4c1921cb8c7e263842a864ea8028139
Related: OS#2966
---
M src/host/virt_phy/src/virtphy.c
1 file changed, 15 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/46/17446/1

diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c
index 3290dd8..412da9c 100644
--- a/src/host/virt_phy/src/virtphy.c
+++ b/src/host/virt_phy/src/virtphy.c
@@ -59,6 +59,8 @@
 static char *l1ctl_sock_path = L1CTL_SOCK_PATH;
 static char *arfcn_sig_lev_red_mask = NULL;
 static char *pm_timeout = NULL;
+static char *mcast_netdev = NULL;
+static int mcast_ttl = -1;
 
 static void print_usage()
 {
@@ -76,6 +78,8 @@
 	printf("  -s --l1ctl-sock            	l1ctl socket path path.\n");
 	printf("  -r --arfcn-sig-lev-red        reduce signal level (e.g. 666,12:888,43:176,22).\n");
 	printf("  -t --pm-timeout		power management timeout.\n");
+	printf("  -T --mcast-ttl TTL		set TTL of Virtual Um GSMTAP multicast frames\n");
+	printf("  -D --mcast-deav NETDEV	bind to given network device for Virtual Um\n");
 }
 
 static void handle_options(int argc, char **argv)
@@ -91,9 +95,11 @@
 		        {"l1ctl-sock", required_argument, 0, 's'},
 		        {"arfcn-sig-lev-red", required_argument, 0, 'r'},
 		        {"pm-timeout", required_argument, 0, 't'},
+			{"mcast-ttl", required_argument, 0, 'T'},
+			{"mcast-dev", required_argument, 0, 'D'},
 		        {0, 0, 0, 0},
 		};
-		c = getopt_long(argc, argv, "hz:y:x:d:s:r:t:", long_options,
+		c = getopt_long(argc, argv, "hz:y:x:d:s:r:t:T:D:", long_options,
 		                &option_index);
 		if (c == -1)
 			break;
@@ -124,6 +130,12 @@
 		case 't':
 			pm_timeout = optarg;
 			break;
+		case 'T':
+			mcast_ttl = atoi(optarg);
+			break;
+		case 'D':
+			mcast_netdev = optarg;
+			break;
 		default:
 			break;
 		}
@@ -231,8 +243,8 @@
 
 	LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n");
 
-	g_vphy.virt_um = virt_um_init(tall_vphy_ctx, ul_tx_grp, port, dl_rx_grp, port, -1, NULL,
-					gsmtapl1_rx_from_virt_um_inst_cb);
+	g_vphy.virt_um = virt_um_init(tall_vphy_ctx, ul_tx_grp, port, dl_rx_grp, port, mcast_ttl,
+					mcast_netdev, gsmtapl1_rx_from_virt_um_inst_cb);
 
 	g_vphy.l1ctl_sock = l1ctl_sock_init(tall_vphy_ctx, l1ctl_sap_rx_from_l23_inst_cb,
 					    l1ctl_accept_cb, l1ctl_close_cb, l1ctl_sock_path);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ia74aa381a4c1921cb8c7e263842a864ea8028139
Gerrit-Change-Number: 17446
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200310/47bd6dab/attachment.htm>


More information about the gerrit-log mailing list