From 6d101a79a833249c207387d98db3a9eb34a98cc2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 9 Jan 2016 09:42:21 +0100 Subject: TRX: remove obsolete get_mac() function --- src/osmo-bts-trx/main.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'src/osmo-bts-trx') diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index 6f2dd4bc..ae85abef 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -34,7 +34,6 @@ #include #include -#include #include #include @@ -66,43 +65,9 @@ static char *gsmtap_ip = 0; static int rt_prio = -1; static int trx_num = 1; char *software_version = "0.0"; -uint8_t abis_mac[6] = { 0, 1, 2, 3, 4, 5 }; char *bsc_host = "localhost"; char *bts_id = "1801/0"; -// FIXME this is a hack -static void get_mac(void) -{ - struct if_nameindex *ifn = if_nameindex(); - struct ifreq ifr; - int sock; - int ret; - - sock = socket(AF_INET, SOCK_STREAM, 0); - if (sock < 0) - return; - - memset(&ifr, 0, sizeof(ifr)); - if (!ifn) - return; - while (ifn->if_name) { - strncpy(ifr.ifr_name, ifn->if_name, sizeof(ifr.ifr_name)-1); - ret = ioctl(sock, SIOCGIFHWADDR, &ifr); - if (ret == 0 && !!memcmp(ifr.ifr_hwaddr.sa_data, - "\0\0\0\0\0\0", 6)) { - memcpy(abis_mac, ifr.ifr_hwaddr.sa_data, 6); - printf("Using MAC address of %s: " - "'%02x:%02x:%02x:%02x:%02x:%02x'\n", - ifn->if_name, - abis_mac[0], abis_mac[1], abis_mac[2], - abis_mac[3], abis_mac[4], abis_mac[5]); - break; - } - ifn++; - } -// if_freenameindex(ifn); -} - int bts_model_init(struct gsm_bts *bts) { void *l1h; @@ -285,8 +250,6 @@ int main(int argc, char **argv) printf("((*))\n |\n / \\ OsmoBTS\n"); - get_mac(); - tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb"); msgb_set_talloc_ctx(tall_msgb_ctx); -- cgit v1.2.3