[hipl-commit] [trunk] Rev 4260: firewall: Mark all functions only used within their files as static.

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 13 Apr 2010 18:43:17 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 13/04/2010 at 18:43:17
Revision: 4260
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  firewall: Mark all functions only used within their files as static.

Modified:
  M  firewall/cache.c
  M  firewall/cache_port.c
  M  firewall/conntrack.c
  M  firewall/datapkt.c
  M  firewall/lsi.c
  M  firewall/proxy.c
  M  firewall/proxyconndb.c
  M  firewall/proxydb.c
  M  firewall/user_ipsec_sadb.c

=== modified file 'firewall/cache.c'
--- firewall/cache.c    2010-04-09 15:20:38 +0000
+++ firewall/cache.c    2010-04-13 15:42:49 +0000
@@ -244,7 +244,7 @@
  *
  * @return the value of the hash
  */
-unsigned long hip_firewall_hash_hit_peer(const void *ptr)
+static unsigned long hip_firewall_hash_hit_peer(const void *ptr)
 {
     struct in6_addr *hit_peer = &((firewall_cache_hl_t *) ptr)->hit_peer;
     uint8_t hash[HIP_AH_SHA_LEN];
@@ -261,7 +261,7 @@
  *
  * @return zero if hashes are identical, or one otherwise
  */
-int hip_firewall_match_hit_peer(const void *ptr1, const void *ptr2)
+static int hip_firewall_match_hit_peer(const void *ptr1, const void *ptr2)
 {
     return hip_firewall_hash_hit_peer(ptr1) != 
hip_firewall_hash_hit_peer(ptr2);
 }

=== modified file 'firewall/cache_port.c'
--- firewall/cache_port.c       2010-04-09 16:24:44 +0000
+++ firewall/cache_port.c       2010-04-13 15:42:49 +0000
@@ -41,7 +41,7 @@
  *
  * @note this is used only from the firewall, so move this there
  */
-int hip_get_proto_info(in_port_t port_dest, char *proto)
+static int hip_get_proto_info(in_port_t port_dest, char *proto)
 {
     FILE *fd       = NULL;
     char line[500], sub_string_addr_hex[8], path[11 + sizeof(proto)];

=== modified file 'firewall/conntrack.c'
--- firewall/conntrack.c        2010-04-13 10:57:54 +0000
+++ firewall/conntrack.c        2010-04-13 15:42:49 +0000
@@ -1700,11 +1700,11 @@
  *
  * @return one if packet was processed successfully or zero otherwise
  */
-int handle_close_ack(const struct in6_addr *ip6_src,
-                     const struct in6_addr *ip6_dst,
-                     const struct hip_common *common,
-                     struct tuple *tuple,
-                     const hip_fw_context_t *ctx)
+static int handle_close_ack(const struct in6_addr *ip6_src,
+                            const struct in6_addr *ip6_dst,
+                            const struct hip_common *common,
+                            struct tuple *tuple,
+                            const hip_fw_context_t *ctx)
 {
     int err = 1;
 

=== modified file 'firewall/datapkt.c'
--- firewall/datapkt.c  2010-04-09 15:20:38 +0000
+++ firewall/datapkt.c  2010-04-13 15:42:49 +0000
@@ -94,10 +94,10 @@
  *                same but including a signature from hipd.
  * @return        zero on success or negative on error
  */
-int hip_get_data_packet_header(const struct in6_addr *src_hit,
-                               const struct in6_addr *dst_hit,
-                               int payload,
-                               struct hip_common *msg)
+static int hip_get_data_packet_header(const struct in6_addr *src_hit,
+                                      const struct in6_addr *dst_hit,
+                                      int payload,
+                                      struct hip_common *msg)
 {
     int err = 0;
 

=== modified file 'firewall/lsi.c'
--- firewall/lsi.c      2010-04-13 10:57:54 +0000
+++ firewall/lsi.c      2010-04-13 15:42:49 +0000
@@ -179,12 +179,12 @@
  * @return             the state of the bex if the entry is found
  *                     otherwise returns -1
  */
-int hip_get_bex_state_from_LSIs(hip_lsi_t       *src_lsi,
-                                hip_lsi_t       *dst_lsi,
-                                struct in6_addr *src_ip,
-                                struct in6_addr *dst_ip,
-                                struct in6_addr *src_hit,
-                                struct in6_addr *dst_hit)
+static int hip_get_bex_state_from_LSIs(hip_lsi_t       *src_lsi,
+                                       hip_lsi_t       *dst_lsi,
+                                       struct in6_addr *src_ip,
+                                       struct in6_addr *dst_ip,
+                                       struct in6_addr *src_hit,
+                                       struct in6_addr *dst_hit)
 {
     int err = 0, res = -1;
     struct hip_tlv_common *current_param = NULL;

=== modified file 'firewall/proxy.c'
--- firewall/proxy.c    2010-04-13 10:57:54 +0000
+++ firewall/proxy.c    2010-04-13 15:42:49 +0000
@@ -65,8 +65,8 @@
  * @param local_hit the HIT of the local HIP proxy
  * @return zero on success, non-zero on error
  */
-int hip_proxy_request_peer_hit_from_hipd(const struct in6_addr *peer_ip,
-                                         const struct in6_addr *local_hit)
+static int hip_proxy_request_peer_hit_from_hipd(const struct in6_addr *peer_ip,
+                                                const struct in6_addr 
*local_hit)
 {
     struct hip_common *msg = NULL;
     int err                = 0;
@@ -264,7 +264,7 @@
  * @param hip_raw_sock_v4 the socket pointer used for TCP connection in IPv4
  * @return zero on success, non-zero on error
  */
-int hip_init_proxy_raw_sock_tcp_v4(int *hip_raw_sock_v4)
+static int hip_init_proxy_raw_sock_tcp_v4(int *hip_raw_sock_v4)
 {
     int on  = 1, err = 0;
     int off = 0;
@@ -296,7 +296,7 @@
  * @param hip_raw_sock_v6 the socket pointer used for UDP connection in IPv6
  * @return zero on success, non-zero on error
  */
-int hip_init_proxy_raw_sock_udp_v6(int *hip_raw_sock_v6)
+static int hip_init_proxy_raw_sock_udp_v6(int *hip_raw_sock_v6)
 {
     int on = 1, off = 0, err = 0;
 
@@ -324,7 +324,7 @@
  * @param hip_raw_sock_v4 the socket pointer used for UDP connection in IPv4
  * @return zero on success, non-zero on error
  */
-int hip_init_proxy_raw_sock_udp_v4(int *hip_raw_sock_v4)
+static int hip_init_proxy_raw_sock_udp_v4(int *hip_raw_sock_v4)
 {
     int on  = 1, err = 0;
     int off = 0;
@@ -356,7 +356,7 @@
  * @param hip_raw_sock_v6 the socket pointer used for ICMPv6 connection
  * @return zero on success, non-zero on error
  */
-int hip_init_proxy_raw_sock_icmp_v6(int *hip_raw_sock_v6)
+static int hip_init_proxy_raw_sock_icmp_v6(int *hip_raw_sock_v6)
 {
     int on = 1, off = 0, err = 0;
 
@@ -385,7 +385,7 @@
  * @param hip_raw_sock_v4 the socket pointer used for ICMP
  * @return zero on success, non-zero on error
  */
-int hip_init_proxy_raw_sock_icmp_v4(int *hip_raw_sock_v4)
+static int hip_init_proxy_raw_sock_icmp_v4(int *hip_raw_sock_v4)
 {
     int on  = 1, err = 0;
     int off = 0;
@@ -418,7 +418,7 @@
  * @param hip_raw_sock_v6 the socket pointer used for ICMPv6 connection in IPv6
  * @return zero on success, non-zero on error
  */
-int hip_init_proxy_raw_sock_icmp_inbound(int *hip_raw_sock_v6)
+static int hip_init_proxy_raw_sock_icmp_inbound(int *hip_raw_sock_v6)
 {
     int on = 1, off = 0, err = 0;
 
@@ -445,7 +445,7 @@
  *
  * @return zero on success, non-zero on error
  */
-int hip_proxy_init_raw_sockets(void)
+static int hip_proxy_init_raw_sockets(void)
 {
     hip_init_proxy_raw_sock_tcp_v6(&hip_proxy_raw_sock_tcp_v6);
     hip_init_proxy_raw_sock_tcp_v4(&hip_proxy_raw_sock_tcp_v4);

=== modified file 'firewall/proxyconndb.c'
--- firewall/proxyconndb.c      2010-04-13 10:36:12 +0000
+++ firewall/proxyconndb.c      2010-04-13 15:42:49 +0000
@@ -27,7 +27,7 @@
  * @param p the connection entry
  * @return a hash calculated based on the given entry
  */
-unsigned long hip_proxy_conn_db_hash(const hip_proxy_conn_t *p)
+static unsigned long hip_proxy_conn_db_hash(const hip_proxy_conn_t *p)
 {
     uint8_t hash[HIP_AH_SHA_LEN];
 
@@ -50,8 +50,8 @@
  * @param ha2 second hash key
  * @return zero if keys match or one otherwise
  */
-int hip_proxy_conn_db_cmp(const hip_proxy_conn_t *ha1,
-                          const hip_proxy_conn_t *ha2)
+static int hip_proxy_conn_db_cmp(const hip_proxy_conn_t *ha1,
+                                 const hip_proxy_conn_t *ha2)
 {
     if (ha1 == NULL
             || &(ha1->key) == NULL

=== modified file 'firewall/proxydb.c'
--- firewall/proxydb.c  2010-04-09 16:24:44 +0000
+++ firewall/proxydb.c  2010-04-13 15:42:49 +0000
@@ -19,7 +19,7 @@
  * @param p the connection entry
  * @return a hash calculated based on the given entry
  */
-unsigned long hip_proxy_db_hash(const hip_proxy_t *p)
+static unsigned long hip_proxy_db_hash(const hip_proxy_t *p)
 {
     hip_hit_t hitpair[2];
     uint8_t hash[HIP_AH_SHA_LEN];
@@ -50,7 +50,7 @@
  * @param ha2 second hash key
  * @return zero if keys match or one otherwise
  */
-int hip_proxy_db_cmp(const hip_proxy_t *ha1, const hip_proxy_t *ha2)
+static int hip_proxy_db_cmp(const hip_proxy_t *ha1, const hip_proxy_t *ha2)
 {
     if (ha1 == NULL
             || &(ha1->addr_client) == NULL
@@ -155,13 +155,13 @@
  * @param state the state of the connection entry
  * @return zero on success or non-zero on failure
  */
-int hip_proxy_update_entry_state(hip_proxy_t *entry,
-                                 struct in6_addr *client_addr,
-                                 struct in6_addr *peer_addr,
-                                 struct in6_addr *proxy_addr,
-                                 hip_hit_t *proxy_hit,
-                                 hip_hit_t *peer_hit,
-                                 int state)
+static int hip_proxy_update_entry_state(hip_proxy_t *entry,
+                                        struct in6_addr *client_addr,
+                                        struct in6_addr *peer_addr,
+                                        struct in6_addr *proxy_addr,
+                                        hip_hit_t *proxy_hit,
+                                        hip_hit_t *peer_hit,
+                                        int state)
 {
     HIP_ASSERT(entry);
 
@@ -196,12 +196,12 @@
  * @param state the state of the connection entry
  *
  */
-int hip_proxy_update_state_no_client(struct in6_addr *client_addr,
-                                     struct in6_addr *peer_addr,
-                                     struct in6_addr *proxy_addr,
-                                     hip_hit_t *proxy_hit,
-                                     hip_hit_t *peer_hit,
-                                     int state)
+static int hip_proxy_update_state_no_client(struct in6_addr *client_addr,
+                                            struct in6_addr *peer_addr,
+                                            struct in6_addr *proxy_addr,
+                                            hip_hit_t *proxy_hit,
+                                            hip_hit_t *peer_hit,
+                                            int state)
 {
     int i = 0;
     hip_proxy_t *this;

=== modified file 'firewall/user_ipsec_sadb.c'
--- firewall/user_ipsec_sadb.c  2010-04-09 16:24:44 +0000
+++ firewall/user_ipsec_sadb.c  2010-04-13 15:42:49 +0000
@@ -732,7 +732,7 @@
  *
  * @param entry     SA entry to be printed
  */
-void hip_sa_entry_print(const hip_sa_entry_t *entry)
+static void hip_sa_entry_print(const hip_sa_entry_t *entry)
 {
     if (entry) {
         HIP_DEBUG("direction: %i\n", entry->direction);

Other related posts:

  • » [hipl-commit] [trunk] Rev 4260: firewall: Mark all functions only used within their files as static. - Diego Biurrun