diff options
-rw-r--r-- | include/osmocom/vty/command.h | 43 | ||||
-rw-r--r-- | include/osmocore/gsm_utils.h | 4 | ||||
-rw-r--r-- | src/gsm_utils.c | 17 |
3 files changed, 22 insertions, 42 deletions
diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0136f576..69e9e772 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -70,49 +70,10 @@ enum node_type { CONFIG_NODE, /* Config node. Default mode of config file. */ SERVICE_NODE, /* Service node. */ DEBUG_NODE, /* Debug node. */ -#if 0 - AAA_NODE, /* AAA node. */ - KEYCHAIN_NODE, /* Key-chain node. */ - KEYCHAIN_KEY_NODE, /* Key-chain key node. */ - INTERFACE_NODE, /* Interface mode node. */ - ZEBRA_NODE, /* zebra connection node. */ - TABLE_NODE, /* rtm_table selection node. */ - RIP_NODE, /* RIP protocol mode node. */ - RIPNG_NODE, /* RIPng protocol mode node. */ - BGP_NODE, /* BGP protocol mode which includes BGP4+ */ - BGP_VPNV4_NODE, /* BGP MPLS-VPN PE exchange. */ - BGP_IPV4_NODE, /* BGP IPv4 unicast address family. */ - BGP_IPV4M_NODE, /* BGP IPv4 multicast address family. */ - BGP_IPV6_NODE, /* BGP IPv6 address family */ - OSPF_NODE, /* OSPF protocol mode */ - OSPF6_NODE, /* OSPF protocol for IPv6 mode */ - ISIS_NODE, /* ISIS protocol mode */ - MASC_NODE, /* MASC for multicast. */ - IRDP_NODE, /* ICMP Router Discovery Protocol mode. */ - IP_NODE, /* Static ip route node. */ - ACCESS_NODE, /* Access list node. */ - PREFIX_NODE, /* Prefix list node. */ - ACCESS_IPV6_NODE, /* Access list node. */ - PREFIX_IPV6_NODE, /* Prefix list node. */ - AS_LIST_NODE, /* AS list node. */ - COMMUNITY_LIST_NODE, /* Community list node. */ - RMAP_NODE, /* Route map node. */ - SMUX_NODE, /* SNMP configuration node. */ - DUMP_NODE, /* Packet dump node. */ - FORWARDING_NODE, /* IP forwarding node. */ -#endif + VTY_NODE, /* Vty node. */ - GSMNET_NODE, - BTS_NODE, - TRX_NODE, - TS_NODE, - SUBSCR_NODE, - MGCP_NODE, - GBPROXY_NODE, - SGSN_NODE, - NS_NODE, - BSSGP_NODE, + _LAST_OSMOVTY_NODE }; /* Node which has some commands and prompt string and configuration diff --git a/include/osmocore/gsm_utils.h b/include/osmocore/gsm_utils.h index 51e9f2e6..685bc901 100644 --- a/include/osmocore/gsm_utils.h +++ b/include/osmocore/gsm_utils.h @@ -88,7 +88,7 @@ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); uint32_t gsm_gsmtime2fn(struct gsm_time *time); /* GSM TS 03.03 Chapter 2.6 */ -enum gprs_tlli_tyoe { +enum gprs_tlli_type { TLLI_LOCAL, TLLI_FOREIGN, TLLI_RANDOM, @@ -99,5 +99,7 @@ enum gprs_tlli_tyoe { /* TS 03.03 Chapter 2.6 */ int gprs_tlli_type(uint32_t tlli); +uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type); + void generate_backtrace(); #endif diff --git a/src/gsm_utils.c b/src/gsm_utils.c index b392fd37..913946ed 100644 --- a/src/gsm_utils.c +++ b/src/gsm_utils.c @@ -374,3 +374,20 @@ int gprs_tlli_type(uint32_t tlli) return TLLI_RESERVED; } + +uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type) +{ + uint32_t tlli; + switch (type) { + case TLLI_LOCAL: + tlli = p_tmsi | 0xc0000000; + break; + case TLLI_FOREIGN: + tlli = (p_tmsi & 0x3fffffff) | 0x80000000; + break; + default: + tlli = 0; + break; + } + return tlli; +} |