Browse code

core: kemi - added to_TCP/TLS/SCTP/WS/WSS/WSX()

Daniel-Constantin Mierla authored on 15/06/2021 07:16:58
Showing 1 changed files
... ...
@@ -1586,6 +1586,72 @@ static int sr_kemi_core_to_proto_udp(sip_msg_t *msg)
1586 1586
 	return (proto == PROTO_UDP)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1587 1587
 }
1588 1588
 
1589
+/**
1590
+ *
1591
+ */
1592
+static int sr_kemi_core_to_proto_tcp(sip_msg_t *msg)
1593
+{
1594
+	int proto;
1595
+
1596
+	proto = sr_kemi_core_to_proto_helper(msg);
1597
+	return (proto == PROTO_TCP)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1598
+}
1599
+
1600
+/**
1601
+ *
1602
+ */
1603
+static int sr_kemi_core_to_proto_tls(sip_msg_t *msg)
1604
+{
1605
+	int proto;
1606
+
1607
+	proto = sr_kemi_core_to_proto_helper(msg);
1608
+	return (proto == PROTO_TLS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1609
+}
1610
+
1611
+/**
1612
+ *
1613
+ */
1614
+static int sr_kemi_core_to_proto_sctp(sip_msg_t *msg)
1615
+{
1616
+	int proto;
1617
+
1618
+	proto = sr_kemi_core_to_proto_helper(msg);
1619
+	return (proto == PROTO_SCTP)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1620
+}
1621
+
1622
+/**
1623
+ *
1624
+ */
1625
+static int sr_kemi_core_to_proto_ws(sip_msg_t *msg)
1626
+{
1627
+	int proto;
1628
+
1629
+	proto = sr_kemi_core_to_proto_helper(msg);
1630
+	return (proto == PROTO_WS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1631
+}
1632
+
1633
+/**
1634
+ *
1635
+ */
1636
+static int sr_kemi_core_to_proto_wss(sip_msg_t *msg)
1637
+{
1638
+	int proto;
1639
+
1640
+	proto = sr_kemi_core_to_proto_helper(msg);
1641
+	return (proto == PROTO_WSS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1642
+}
1643
+
1644
+/**
1645
+ *
1646
+ */
1647
+static int sr_kemi_core_to_proto_wsx(sip_msg_t *msg)
1648
+{
1649
+	int proto;
1650
+
1651
+	proto = sr_kemi_core_to_proto_helper(msg);
1652
+	if (proto == PROTO_WSS) { return SR_KEMI_TRUE; }
1653
+	return (proto == PROTO_WS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1654
+}
1589 1655
 
1590 1656
 /**
1591 1657
  *
... ...
@@ -1976,8 +2042,33 @@ static sr_kemi_t _sr_kemi_core[] = {
1976 2042
 		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
1977 2043
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
1978 2044
 	},
1979
-	{ str_init(""), str_init("to_UDP"),
1980
-		SR_KEMIP_BOOL, sr_kemi_core_to_proto_udp,
2045
+	{ str_init(""), str_init("to_TCP"),
2046
+		SR_KEMIP_BOOL, sr_kemi_core_to_proto_tcp,
2047
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
2048
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
2049
+	},
2050
+	{ str_init(""), str_init("to_TLS"),
2051
+		SR_KEMIP_BOOL, sr_kemi_core_to_proto_tls,
2052
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
2053
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
2054
+	},
2055
+	{ str_init(""), str_init("to_SCTP"),
2056
+		SR_KEMIP_BOOL, sr_kemi_core_to_proto_sctp,
2057
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
2058
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
2059
+	},
2060
+	{ str_init(""), str_init("to_WS"),
2061
+		SR_KEMIP_BOOL, sr_kemi_core_to_proto_ws,
2062
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
2063
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
2064
+	},
2065
+	{ str_init(""), str_init("to_WSS"),
2066
+		SR_KEMIP_BOOL, sr_kemi_core_to_proto_wss,
2067
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
2068
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
2069
+	},
2070
+	{ str_init(""), str_init("to_WSX"),
2071
+		SR_KEMIP_BOOL, sr_kemi_core_to_proto_wsx,
1981 2072
 		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
1982 2073
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
1983 2074
 	},