[PATCH] osmo-ggsn[master]: sgsnemu: Mark local functions 'static'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Oct 14 14:39:18 UTC 2017


Review at  https://gerrit.osmocom.org/4268

sgsnemu: Mark local functions 'static'

We don't need to export those to the global name space as they're
not called from code in other files.

Change-Id: I454249335ba46abdb3afbc669c4a06a06f39ae72
---
M sgsnemu/sgsnemu.c
1 file changed, 23 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/68/4268/1

diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index a85c9cf..7b7bb4e 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -161,13 +161,13 @@
 int pingseq = 0;		/* Ping sequence counter */
 struct timeval firstping;
 
-void signal_handler(int signo)
+static void signal_handler(int signo)
 {
 	if (state == 2)
 		state = 3;  /* Tell main loop to finish. */
 }
 
-int ipset(struct iphash_t *ipaddr, struct in46_addr *addr)
+static int ipset(struct iphash_t *ipaddr, struct in46_addr *addr)
 {
 	int hash = ippool_hash(addr) % MAXCONTEXTS;
 	struct iphash_t *h;
@@ -183,7 +183,7 @@
 	return 0;
 }
 
-int ipdel(struct iphash_t *ipaddr)
+static int ipdel(struct iphash_t *ipaddr)
 {
 	int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS;
 	struct iphash_t *h;
@@ -201,7 +201,7 @@
 	return EOF;		/* End of linked list and not found */
 }
 
-int ipget(struct iphash_t **ipaddr, struct in46_addr *addr)
+static int ipget(struct iphash_t **ipaddr, struct in46_addr *addr)
 {
 	int hash = ippool_hash(addr) % MAXCONTEXTS;
 	struct iphash_t *h;
@@ -215,7 +215,7 @@
 }
 
 /* Used to write process ID to file. Assume someone else will delete */
-void log_pid(char *pidfile)
+static void log_pid(char *pidfile)
 {
 	FILE *file;
 	mode_t oldmask;
@@ -229,7 +229,7 @@
 	fclose(file);
 }
 
-int process_options(int argc, char **argv)
+static int process_options(int argc, char **argv)
 {
 	/* gengeopt declarations */
 	struct gengetopt_args_info args_info;
@@ -955,7 +955,7 @@
 
 }
 
-int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len)
+static int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len)
 {
 	unsigned int i;
 	printf("The packet looks like this:\n");
@@ -1004,7 +1004,7 @@
 	return proc_read(path);
 }
 
-char *print_ipprot(int t)
+static char *print_ipprot(int t)
 {
 	switch (t) {
 	case 1:
@@ -1018,7 +1018,7 @@
 	};
 }
 
-char *print_icmptype(int t)
+static char *print_icmptype(int t)
 {
 	static char *ttab[] = {
 		"Echo Reply",
@@ -1044,7 +1044,7 @@
 	return (ttab[t]);
 }
 
-int msisdn_add(struct ul16_t *src, struct ul16_t *dst, int add)
+static int msisdn_add(struct ul16_t *src, struct ul16_t *dst, int add)
 {
 	unsigned int n;
 	uint64_t i64 = 0;
@@ -1088,7 +1088,7 @@
 
 }
 
-int imsi_add(uint64_t src, uint64_t * dst, int add)
+static int imsi_add(uint64_t src, uint64_t * dst, int add)
 {
 	/* TODO: big endian / small endian ??? */
 	uint64_t i64 = 0;
@@ -1123,7 +1123,7 @@
 }
 
 /* Calculate time left until we have to send off next ping packet */
-int ping_timeout(struct timeval *tp)
+static int ping_timeout(struct timeval *tp)
 {
 	struct timezone tz;
 	struct timeval tv;
@@ -1145,7 +1145,7 @@
 }
 
 /* Print out statistics when at the end of ping sequence */
-int ping_finish()
+static int ping_finish()
 {
 	struct timezone tz;
 	struct timeval tv;
@@ -1178,7 +1178,7 @@
 }
 
 /* Handle a received ping packet. Print out line and update statistics. */
-int encaps_ping(struct pdp_t *pdp, void *pack, unsigned len)
+static int encaps_ping(struct pdp_t *pdp, void *pack, unsigned len)
 {
 	struct timezone tz;
 	struct timeval tv;
@@ -1247,8 +1247,8 @@
 }
 
 /* Create a new ping packet and send it off to peer. */
-int create_ping(void *gsn, struct pdp_t *pdp,
-		struct in_addr *dst, int seq, unsigned int datasize)
+static int create_ping(void *gsn, struct pdp_t *pdp,
+			struct in_addr *dst, int seq, unsigned int datasize)
 {
 
 	struct ip_ping pack;
@@ -1326,7 +1326,7 @@
 	return gtp_data_req(gsn, pdp, &pack, 28 + datasize);
 }
 
-int delete_context(struct pdp_t *pdp)
+static int delete_context(struct pdp_t *pdp)
 {
 
 	if (tun && options.ipdown)
@@ -1345,7 +1345,7 @@
 static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 };
 
 /* Callback for receiving messages from tun */
-int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len)
+static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len)
 {
 	struct iphash_t *ipm;
 	struct in46_addr src;
@@ -1389,7 +1389,7 @@
 	return 0;
 }
 
-int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
+static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
 {
 	struct in46_addr addr;
 
@@ -1489,14 +1489,14 @@
 	return 0;
 }
 
-int delete_pdp_conf(struct pdp_t *pdp, int cause)
+static int delete_pdp_conf(struct pdp_t *pdp, int cause)
 {
 	printf("Received delete PDP context response. Cause value: %d\n",
 	       cause);
 	return 0;
 }
 
-int echo_conf(int recovery)
+static int echo_conf(int recovery)
 {
 
 	if (recovery < 0) {
@@ -1518,7 +1518,7 @@
 	return 0;
 }
 
-int conf(int type, int cause, struct pdp_t *pdp, void *cbp)
+static int conf(int type, int cause, struct pdp_t *pdp, void *cbp)
 {
 	/* if (cause < 0) return 0; Some error occurred. We don't care */
 	switch (type) {
@@ -1535,7 +1535,7 @@
 	}
 }
 
-int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len)
+static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len)
 {
 	/*  printf("encaps_tun. Packet received: forwarding to tun\n"); */
 	return tun_encaps((struct tun_t *)pdp->ipif, pack, len);

-- 
To view, visit https://gerrit.osmocom.org/4268
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I454249335ba46abdb3afbc669c4a06a06f39ae72
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list