Browse code

ipops: use sip_msg_t type

- set cfg functions signatures with two parameters

Daniel-Constantin Mierla authored on 08/12/2017 22:08:25
Showing 1 changed files
... ...
@@ -82,33 +82,33 @@ int _ip_is_in_subnet_v6(struct in6_addr *ip, char *net, size_t netlen,
82 82
 int _ip_is_in_subnet_str(void *ip, enum enum_ip_type type, char *s, int slen);
83 83
 int _ip_is_in_subnet_str_trimmed(void *ip, enum enum_ip_type type, char *b,
84 84
 		char *e);
85
-static int _detailed_ip_type(unsigned int _type, struct sip_msg* _msg,
85
+static int _detailed_ip_type(unsigned int _type, sip_msg_t* _msg,
86 86
 		char* _s,  char *_dst);
87 87
 
88 88
 
89 89
 /*
90 90
  * Script functions
91 91
  */
92
-static int w_is_ip(struct sip_msg*, char*);
93
-static int w_is_pure_ip(struct sip_msg*, char*);
94
-static int w_is_ipv4(struct sip_msg*, char*);
95
-static int w_is_ipv6(struct sip_msg*, char*);
96
-static int w_is_ipv6_reference(struct sip_msg*, char*);
97
-static int w_ip_type(struct sip_msg*, char*);
98
-static int w_detailed_ipv6_type(struct sip_msg* _msg, char* _s,  char *res);
99
-static int w_detailed_ipv4_type(struct sip_msg* _msg, char* _s,  char *res);
100
-static int w_detailed_ip_type(struct sip_msg* _msg, char* _s,  char *res);
101
-static int w_compare_ips(struct sip_msg*, char*, char*);
102
-static int w_compare_pure_ips(struct sip_msg*, char*, char*);
103
-static int w_is_ip_rfc1918(struct sip_msg*, char*);
104
-static int w_ip_is_in_subnet(struct sip_msg*, char*, char*);
92
+static int w_is_ip(sip_msg_t*, char*, char*);
93
+static int w_is_pure_ip(sip_msg_t*, char*, char*);
94
+static int w_is_ipv4(sip_msg_t*, char*, char*);
95
+static int w_is_ipv6(sip_msg_t*, char*, char*);
96
+static int w_is_ipv6_reference(sip_msg_t*, char*, char*);
97
+static int w_ip_type(sip_msg_t*, char*, char*);
98
+static int w_detailed_ipv6_type(sip_msg_t* _msg, char* _s,  char *res);
99
+static int w_detailed_ipv4_type(sip_msg_t* _msg, char* _s,  char *res);
100
+static int w_detailed_ip_type(sip_msg_t* _msg, char* _s,  char *res);
101
+static int w_compare_ips(sip_msg_t*, char*, char*);
102
+static int w_compare_pure_ips(sip_msg_t*, char*, char*);
103
+static int w_is_ip_rfc1918(sip_msg_t*, char*, char*);
104
+static int w_ip_is_in_subnet(sip_msg_t*, char*, char*);
105 105
 static int w_dns_sys_match_ip(sip_msg_t*, char*, char*);
106 106
 static int w_dns_int_match_ip(sip_msg_t*, char*, char*);
107 107
 static int fixup_detailed_ip_type(void** param, int param_no);
108 108
 static int fixup_free_detailed_ip_type(void** param, int param_no);
109
-static int w_dns_query(struct sip_msg* msg, char* str1, char* str2);
110
-static int w_srv_query(struct sip_msg* msg, char* str1, char* str2);
111
-static int w_naptr_query(struct sip_msg* msg, char* str1, char* str2);
109
+static int w_dns_query(sip_msg_t* msg, char* str1, char* str2);
110
+static int w_srv_query(sip_msg_t* msg, char* str1, char* str2);
111
+static int w_naptr_query(sip_msg_t* msg, char* str1, char* str2);
112 112
 static int mod_init(void);
113 113
 
114 114
 static pv_export_t mod_pvs[] = {
... ...
@@ -507,7 +507,7 @@ int _ip_is_in_subnet_str_trimmed(void *ip, enum enum_ip_type type, char *b,
507 507
 
508 508
 /*! \brief Return true if the given argument (string or pv) is a valid IPv4,
509 509
  * IPv6 or IPv6 reference. */
510
-static int w_is_ip(struct sip_msg* _msg, char* _s)
510
+static int w_is_ip(sip_msg_t* _msg, char* _s, char *_p2)
511 511
 {
512 512
 	str string;
513 513
 
... ...
@@ -531,7 +531,7 @@ static int w_is_ip(struct sip_msg* _msg, char* _s)
531 531
 
532 532
 /*! \brief Return true if the given argument (string or pv) is a valid
533 533
  * IPv4 or IPv6. */
534
-static int w_is_pure_ip(struct sip_msg* _msg, char* _s)
534
+static int w_is_pure_ip(sip_msg_t* _msg, char* _s, char *_p2)
535 535
 {
536 536
 	str string;
537 537
 
... ...
@@ -561,7 +561,7 @@ static int w_is_pure_ip(struct sip_msg* _msg, char* _s)
561 561
 
562 562
 
563 563
 /*! \brief Return true if the given argument (string or pv) is a valid IPv4. */
564
-static int w_is_ipv4(struct sip_msg* _msg, char* _s)
564
+static int w_is_ipv4(sip_msg_t* _msg, char* _s, char *_p2)
565 565
 {
566 566
 	str string;
567 567
 
... ...
@@ -584,7 +584,7 @@ static int w_is_ipv4(struct sip_msg* _msg, char* _s)
584 584
 
585 585
 
586 586
 /*! \brief Return true if the given argument (string or pv) is a valid IPv6. */
587
-static int w_is_ipv6(struct sip_msg* _msg, char* _s)
587
+static int w_is_ipv6(sip_msg_t* _msg, char* _s, char *_p2)
588 588
 {
589 589
 	str string;
590 590
 
... ...
@@ -608,7 +608,7 @@ static int w_is_ipv6(struct sip_msg* _msg, char* _s)
608 608
 
609 609
 /*! \brief Return true if the given argument (string or pv) is a valid
610 610
  * IPv6 reference. */
611
-static int w_is_ipv6_reference(struct sip_msg* _msg, char* _s)
611
+static int w_is_ipv6_reference(sip_msg_t* _msg, char* _s, char *_p2)
612 612
 {
613 613
 	str string;
614 614
 
... ...
@@ -632,7 +632,7 @@ static int w_is_ipv6_reference(struct sip_msg* _msg, char* _s)
632 632
 
633 633
 /*! \brief Return the IP type of the given argument (string or pv):
634 634
  *  1 = IPv4, 2 = IPv6, 3 = IPv6 refenrece, -1 = invalid IP. */
635
-static int w_ip_type(struct sip_msg* _msg, char* _s)
635
+static int w_ip_type(sip_msg_t* _msg, char* _s, char *_p2)
636 636
 {
637 637
 	str string;
638 638
 
... ...
@@ -663,23 +663,23 @@ static int w_ip_type(struct sip_msg* _msg, char* _s)
663 663
 	}
664 664
 }
665 665
 
666
-static int w_detailed_ipv4_type(struct sip_msg* _msg, char* _s,  char *_dst)
666
+static int w_detailed_ipv4_type(sip_msg_t* _msg, char* _s,  char *_dst)
667 667
 {
668 668
 	return _detailed_ip_type(ip_type_ipv4, _msg, _s, _dst);
669 669
 }
670 670
 
671
-static int w_detailed_ipv6_type(struct sip_msg* _msg, char* _s,  char *_dst)
671
+static int w_detailed_ipv6_type(sip_msg_t* _msg, char* _s,  char *_dst)
672 672
 {
673 673
 	return _detailed_ip_type(ip_type_ipv6, _msg, _s, _dst);
674 674
 }
675 675
 
676
-static int w_detailed_ip_type(struct sip_msg* _msg, char* _s,  char *_dst)
676
+static int w_detailed_ip_type(sip_msg_t* _msg, char* _s,  char *_dst)
677 677
 {
678 678
 	/* `ip_type_error` should read `unknown type` */
679 679
 	return _detailed_ip_type(ip_type_error, _msg, _s, _dst);
680 680
 }
681 681
 
682
-static int _detailed_ip_type(unsigned int _type, struct sip_msg* _msg,
682
+static int _detailed_ip_type(unsigned int _type, sip_msg_t* _msg,
683 683
 		char* _s,  char *_dst)
684 684
 {
685 685
 	str string;
... ...
@@ -735,7 +735,7 @@ static int _detailed_ip_type(unsigned int _type, struct sip_msg* _msg,
735 735
 
736 736
 /*! \brief Return true if both IP's (string or pv) are equal.
737 737
  * This function also allows comparing an IPv6 with an IPv6 reference. */
738
-static int w_compare_ips(struct sip_msg* _msg, char* _s1, char* _s2)
738
+static int w_compare_ips(sip_msg_t* _msg, char* _s1, char* _s2)
739 739
 {
740 740
 	str string1, string2;
741 741
 	enum enum_ip_type ip1_type, ip2_type;
... ...
@@ -792,7 +792,7 @@ static int w_compare_ips(struct sip_msg* _msg, char* _s1, char* _s2)
792 792
 
793 793
 /*! \brief Return true if both pure IP's (string or pv) are equal.
794 794
  * IPv6 references not allowed. */
795
-static int w_compare_pure_ips(struct sip_msg* _msg, char* _s1, char* _s2)
795
+static int w_compare_pure_ips(sip_msg_t* _msg, char* _s1, char* _s2)
796 796
 {
797 797
 	str string1, string2;
798 798
 	enum enum_ip_type ip1_type, ip2_type;
... ...
@@ -846,7 +846,7 @@ static int w_compare_pure_ips(struct sip_msg* _msg, char* _s1, char* _s2)
846 846
 /*! \brief Return true if the first IP (string or pv) is within the subnet
847 847
  * defined by the second commma-separated IP list in CIDR notation.
848 848
  * IPv6 references not allowed. */
849
-static int w_ip_is_in_subnet(struct sip_msg* _msg, char* _s1, char* _s2)
849
+static int w_ip_is_in_subnet(sip_msg_t* _msg, char* _s1, char* _s2)
850 850
 {
851 851
 	struct in6_addr ip_addr6;
852 852
 	struct in_addr ip_addr;
... ...
@@ -912,7 +912,7 @@ static int w_ip_is_in_subnet(struct sip_msg* _msg, char* _s1, char* _s2)
912 912
 
913 913
 /*! \brief Return true if the given argument (string or pv) is a valid
914 914
  * RFC 1918 IPv4 (private address). */
915
-static int w_is_ip_rfc1918(struct sip_msg* _msg, char* _s)
915
+static int w_is_ip_rfc1918(sip_msg_t* _msg, char* _s, char *_p2)
916 916
 {
917 917
 	str string;
918 918
 
... ...
@@ -1063,7 +1063,7 @@ static int w_dns_int_match_ip(sip_msg_t *msg, char *hnp, char *ipp)
1063 1063
 /**
1064 1064
  *
1065 1065
  */
1066
-static int w_dns_query(struct sip_msg* msg, char* str1, char* str2)
1066
+static int w_dns_query(sip_msg_t* msg, char* str1, char* str2)
1067 1067
 {
1068 1068
 	str hostname;
1069 1069
 	str name;
... ...
@@ -1091,7 +1091,7 @@ static int w_dns_query(struct sip_msg* msg, char* str1, char* str2)
1091 1091
 /**
1092 1092
  *
1093 1093
  */
1094
-static int w_srv_query(struct sip_msg* msg, char* str1, char* str2)
1094
+static int w_srv_query(sip_msg_t* msg, char* str1, char* str2)
1095 1095
 {
1096 1096
 	str srvcname;
1097 1097
 	str name;
... ...
@@ -1119,7 +1119,7 @@ static int w_srv_query(struct sip_msg* msg, char* str1, char* str2)
1119 1119
 /**
1120 1120
  *
1121 1121
  */
1122
-static int w_naptr_query(struct sip_msg* msg, char* str1, char* str2)
1122
+static int w_naptr_query(sip_msg_t* msg, char* str1, char* str2)
1123 1123
 {
1124 1124
 	str naptrname;
1125 1125
 	str name;