Convert all code to Linux coding style

After so many years of silence, we don't expect the original author to
return to the project.  To make things a bit simpler for us, we convert
the coding style to what we are used to (Linux style).

The conversion was made using the 'Lindent' script which is part of the
Linux kernel.
diff --git a/ggsn/cmdline.c b/ggsn/cmdline.c
index d83376f..c5da6b4 100644
--- a/ggsn/cmdline.c
+++ b/ggsn/cmdline.c
@@ -23,878 +23,939 @@
 
 const char *gengetopt_args_info_purpose = "";
 
-const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]...";
+const char *gengetopt_args_info_usage =
+    "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]...";
 
 const char *gengetopt_args_info_help[] = {
-  "  -h, --help             Print help and exit",
-  "  -V, --version          Print version and exit",
-  "  -f, --fg               Run in foreground  (default=off)",
-  "  -d, --debug            Run in debug mode  (default=off)",
-  "  -c, --conf=STRING      Read configuration file  (default=`/etc/ggsn.conf')",
-  "      --pidfile=STRING   Filename of process id file  \n                           (default=`/var/run/ggsn.pid')",
-  "      --statedir=STRING  Directory of nonvolatile data  \n                           (default=`/var/lib/ggsn/')",
-  "  -l, --listen=STRING    Local interface",
-  "  -n, --net=STRING       Network  (default=`192.168.0.0/24')",
-  "      --ipup=STRING      Script to run after link-up",
-  "      --ipdown=STRING    Script to run after link-down",
-  "      --dynip=STRING     Dynamic IP address pool",
-  "      --statip=STRING    Static IP address pool",
-  "      --pcodns1=STRING   PCO DNS Server 1  (default=`0.0.0.0')",
-  "      --pcodns2=STRING   PCO DNS Server 2  (default=`0.0.0.0')",
-  "      --timelimit=INT    Exit after timelimit seconds  (default=`0')",
-  "  -a, --apn=STRING       Access point name  (default=`internet')",
-  "  -q, --qos=INT          Requested quality of service  (default=`0x0b921f')",
-    0
+	"  -h, --help             Print help and exit",
+	"  -V, --version          Print version and exit",
+	"  -f, --fg               Run in foreground  (default=off)",
+	"  -d, --debug            Run in debug mode  (default=off)",
+	"  -c, --conf=STRING      Read configuration file  (default=`/etc/ggsn.conf')",
+	"      --pidfile=STRING   Filename of process id file  \n                           (default=`/var/run/ggsn.pid')",
+	"      --statedir=STRING  Directory of nonvolatile data  \n                           (default=`/var/lib/ggsn/')",
+	"  -l, --listen=STRING    Local interface",
+	"  -n, --net=STRING       Network  (default=`192.168.0.0/24')",
+	"      --ipup=STRING      Script to run after link-up",
+	"      --ipdown=STRING    Script to run after link-down",
+	"      --dynip=STRING     Dynamic IP address pool",
+	"      --statip=STRING    Static IP address pool",
+	"      --pcodns1=STRING   PCO DNS Server 1  (default=`0.0.0.0')",
+	"      --pcodns2=STRING   PCO DNS Server 2  (default=`0.0.0.0')",
+	"      --timelimit=INT    Exit after timelimit seconds  (default=`0')",
+	"  -a, --apn=STRING       Access point name  (default=`internet')",
+	"  -q, --qos=INT          Requested quality of service  (default=`0x0b921f')",
+	0
 };
 
 static
-void clear_given (struct gengetopt_args_info *args_info);
+void clear_given(struct gengetopt_args_info *args_info);
 static
-void clear_args (struct gengetopt_args_info *args_info);
+void clear_args(struct gengetopt_args_info *args_info);
 
 static int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error);
+cmdline_parser_internal(int argc, char *const *argv,
+			struct gengetopt_args_info *args_info, int override,
+			int initialize, int check_required,
+			const char *additional_error);
 
-struct line_list
-{
-  char * string_arg;
-  struct line_list * next;
+struct line_list {
+	char *string_arg;
+	struct line_list *next;
 };
 
 static struct line_list *cmd_line_list = 0;
 static struct line_list *cmd_line_list_tmp = 0;
 
-static void
-free_cmd_list(void)
+static void free_cmd_list(void)
 {
-  /* free the list of a previous call */
-  if (cmd_line_list)
-    {
-      while (cmd_line_list) {
-        cmd_line_list_tmp = cmd_line_list;
-        cmd_line_list = cmd_line_list->next;
-        free (cmd_line_list_tmp->string_arg);
-        free (cmd_line_list_tmp);
-      }
-    }
+	/* free the list of a previous call */
+	if (cmd_line_list) {
+		while (cmd_line_list) {
+			cmd_line_list_tmp = cmd_line_list;
+			cmd_line_list = cmd_line_list->next;
+			free(cmd_line_list_tmp->string_arg);
+			free(cmd_line_list_tmp);
+		}
+	}
 }
 
-
-static char *
-gengetopt_strdup (const char *s);
+static char *gengetopt_strdup(const char *s);
 
 static
-void clear_given (struct gengetopt_args_info *args_info)
+void clear_given(struct gengetopt_args_info *args_info)
 {
-  args_info->help_given = 0 ;
-  args_info->version_given = 0 ;
-  args_info->fg_given = 0 ;
-  args_info->debug_given = 0 ;
-  args_info->conf_given = 0 ;
-  args_info->pidfile_given = 0 ;
-  args_info->statedir_given = 0 ;
-  args_info->listen_given = 0 ;
-  args_info->net_given = 0 ;
-  args_info->ipup_given = 0 ;
-  args_info->ipdown_given = 0 ;
-  args_info->dynip_given = 0 ;
-  args_info->statip_given = 0 ;
-  args_info->pcodns1_given = 0 ;
-  args_info->pcodns2_given = 0 ;
-  args_info->timelimit_given = 0 ;
-  args_info->apn_given = 0 ;
-  args_info->qos_given = 0 ;
+	args_info->help_given = 0;
+	args_info->version_given = 0;
+	args_info->fg_given = 0;
+	args_info->debug_given = 0;
+	args_info->conf_given = 0;
+	args_info->pidfile_given = 0;
+	args_info->statedir_given = 0;
+	args_info->listen_given = 0;
+	args_info->net_given = 0;
+	args_info->ipup_given = 0;
+	args_info->ipdown_given = 0;
+	args_info->dynip_given = 0;
+	args_info->statip_given = 0;
+	args_info->pcodns1_given = 0;
+	args_info->pcodns2_given = 0;
+	args_info->timelimit_given = 0;
+	args_info->apn_given = 0;
+	args_info->qos_given = 0;
 }
 
 static
-void clear_args (struct gengetopt_args_info *args_info)
+void clear_args(struct gengetopt_args_info *args_info)
 {
-  args_info->fg_flag = 0;
-  args_info->debug_flag = 0;
-  args_info->conf_arg = gengetopt_strdup ("/etc/ggsn.conf");
-  args_info->conf_orig = NULL;
-  args_info->pidfile_arg = gengetopt_strdup ("/var/run/ggsn.pid");
-  args_info->pidfile_orig = NULL;
-  args_info->statedir_arg = gengetopt_strdup ("/var/lib/ggsn/");
-  args_info->statedir_orig = NULL;
-  args_info->listen_arg = NULL;
-  args_info->listen_orig = NULL;
-  args_info->net_arg = gengetopt_strdup ("192.168.0.0/24");
-  args_info->net_orig = NULL;
-  args_info->ipup_arg = NULL;
-  args_info->ipup_orig = NULL;
-  args_info->ipdown_arg = NULL;
-  args_info->ipdown_orig = NULL;
-  args_info->dynip_arg = NULL;
-  args_info->dynip_orig = NULL;
-  args_info->statip_arg = NULL;
-  args_info->statip_orig = NULL;
-  args_info->pcodns1_arg = gengetopt_strdup ("0.0.0.0");
-  args_info->pcodns1_orig = NULL;
-  args_info->pcodns2_arg = gengetopt_strdup ("0.0.0.0");
-  args_info->pcodns2_orig = NULL;
-  args_info->timelimit_arg = 0;
-  args_info->timelimit_orig = NULL;
-  args_info->apn_arg = gengetopt_strdup ("internet");
-  args_info->apn_orig = NULL;
-  args_info->qos_arg = 0x0b921f;
-  args_info->qos_orig = NULL;
-  
+	args_info->fg_flag = 0;
+	args_info->debug_flag = 0;
+	args_info->conf_arg = gengetopt_strdup("/etc/ggsn.conf");
+	args_info->conf_orig = NULL;
+	args_info->pidfile_arg = gengetopt_strdup("/var/run/ggsn.pid");
+	args_info->pidfile_orig = NULL;
+	args_info->statedir_arg = gengetopt_strdup("/var/lib/ggsn/");
+	args_info->statedir_orig = NULL;
+	args_info->listen_arg = NULL;
+	args_info->listen_orig = NULL;
+	args_info->net_arg = gengetopt_strdup("192.168.0.0/24");
+	args_info->net_orig = NULL;
+	args_info->ipup_arg = NULL;
+	args_info->ipup_orig = NULL;
+	args_info->ipdown_arg = NULL;
+	args_info->ipdown_orig = NULL;
+	args_info->dynip_arg = NULL;
+	args_info->dynip_orig = NULL;
+	args_info->statip_arg = NULL;
+	args_info->statip_orig = NULL;
+	args_info->pcodns1_arg = gengetopt_strdup("0.0.0.0");
+	args_info->pcodns1_orig = NULL;
+	args_info->pcodns2_arg = gengetopt_strdup("0.0.0.0");
+	args_info->pcodns2_orig = NULL;
+	args_info->timelimit_arg = 0;
+	args_info->timelimit_orig = NULL;
+	args_info->apn_arg = gengetopt_strdup("internet");
+	args_info->apn_orig = NULL;
+	args_info->qos_arg = 0x0b921f;
+	args_info->qos_orig = NULL;
+
 }
 
 static
 void init_args_info(struct gengetopt_args_info *args_info)
 {
-  args_info->help_help = gengetopt_args_info_help[0] ;
-  args_info->version_help = gengetopt_args_info_help[1] ;
-  args_info->fg_help = gengetopt_args_info_help[2] ;
-  args_info->debug_help = gengetopt_args_info_help[3] ;
-  args_info->conf_help = gengetopt_args_info_help[4] ;
-  args_info->pidfile_help = gengetopt_args_info_help[5] ;
-  args_info->statedir_help = gengetopt_args_info_help[6] ;
-  args_info->listen_help = gengetopt_args_info_help[7] ;
-  args_info->net_help = gengetopt_args_info_help[8] ;
-  args_info->ipup_help = gengetopt_args_info_help[9] ;
-  args_info->ipdown_help = gengetopt_args_info_help[10] ;
-  args_info->dynip_help = gengetopt_args_info_help[11] ;
-  args_info->statip_help = gengetopt_args_info_help[12] ;
-  args_info->pcodns1_help = gengetopt_args_info_help[13] ;
-  args_info->pcodns2_help = gengetopt_args_info_help[14] ;
-  args_info->timelimit_help = gengetopt_args_info_help[15] ;
-  args_info->apn_help = gengetopt_args_info_help[16] ;
-  args_info->qos_help = gengetopt_args_info_help[17] ;
-  
+	args_info->help_help = gengetopt_args_info_help[0];
+	args_info->version_help = gengetopt_args_info_help[1];
+	args_info->fg_help = gengetopt_args_info_help[2];
+	args_info->debug_help = gengetopt_args_info_help[3];
+	args_info->conf_help = gengetopt_args_info_help[4];
+	args_info->pidfile_help = gengetopt_args_info_help[5];
+	args_info->statedir_help = gengetopt_args_info_help[6];
+	args_info->listen_help = gengetopt_args_info_help[7];
+	args_info->net_help = gengetopt_args_info_help[8];
+	args_info->ipup_help = gengetopt_args_info_help[9];
+	args_info->ipdown_help = gengetopt_args_info_help[10];
+	args_info->dynip_help = gengetopt_args_info_help[11];
+	args_info->statip_help = gengetopt_args_info_help[12];
+	args_info->pcodns1_help = gengetopt_args_info_help[13];
+	args_info->pcodns2_help = gengetopt_args_info_help[14];
+	args_info->timelimit_help = gengetopt_args_info_help[15];
+	args_info->apn_help = gengetopt_args_info_help[16];
+	args_info->qos_help = gengetopt_args_info_help[17];
+
 }
 
-void
-cmdline_parser_print_version (void)
+void cmdline_parser_print_version(void)
 {
-  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
+	printf("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
 }
 
-void
-cmdline_parser_print_help (void)
+void cmdline_parser_print_help(void)
 {
-  int i = 0;
-  cmdline_parser_print_version ();
+	int i = 0;
+	cmdline_parser_print_version();
 
-  if (strlen(gengetopt_args_info_purpose) > 0)
-    printf("\n%s\n", gengetopt_args_info_purpose);
+	if (strlen(gengetopt_args_info_purpose) > 0)
+		printf("\n%s\n", gengetopt_args_info_purpose);
 
-  printf("\n%s\n\n", gengetopt_args_info_usage);
-  while (gengetopt_args_info_help[i])
-    printf("%s\n", gengetopt_args_info_help[i++]);
+	printf("\n%s\n\n", gengetopt_args_info_usage);
+	while (gengetopt_args_info_help[i])
+		printf("%s\n", gengetopt_args_info_help[i++]);
 }
 
-void
-cmdline_parser_init (struct gengetopt_args_info *args_info)
+void cmdline_parser_init(struct gengetopt_args_info *args_info)
 {
-  clear_given (args_info);
-  clear_args (args_info);
-  init_args_info (args_info);
+	clear_given(args_info);
+	clear_args(args_info);
+	init_args_info(args_info);
 }
 
-static void
-cmdline_parser_release (struct gengetopt_args_info *args_info)
+static void cmdline_parser_release(struct gengetopt_args_info *args_info)
 {
-  
-  if (args_info->conf_arg)
-    {
-      free (args_info->conf_arg); /* free previous argument */
-      args_info->conf_arg = 0;
-    }
-  if (args_info->conf_orig)
-    {
-      free (args_info->conf_orig); /* free previous argument */
-      args_info->conf_orig = 0;
-    }
-  if (args_info->pidfile_arg)
-    {
-      free (args_info->pidfile_arg); /* free previous argument */
-      args_info->pidfile_arg = 0;
-    }
-  if (args_info->pidfile_orig)
-    {
-      free (args_info->pidfile_orig); /* free previous argument */
-      args_info->pidfile_orig = 0;
-    }
-  if (args_info->statedir_arg)
-    {
-      free (args_info->statedir_arg); /* free previous argument */
-      args_info->statedir_arg = 0;
-    }
-  if (args_info->statedir_orig)
-    {
-      free (args_info->statedir_orig); /* free previous argument */
-      args_info->statedir_orig = 0;
-    }
-  if (args_info->listen_arg)
-    {
-      free (args_info->listen_arg); /* free previous argument */
-      args_info->listen_arg = 0;
-    }
-  if (args_info->listen_orig)
-    {
-      free (args_info->listen_orig); /* free previous argument */
-      args_info->listen_orig = 0;
-    }
-  if (args_info->net_arg)
-    {
-      free (args_info->net_arg); /* free previous argument */
-      args_info->net_arg = 0;
-    }
-  if (args_info->net_orig)
-    {
-      free (args_info->net_orig); /* free previous argument */
-      args_info->net_orig = 0;
-    }
-  if (args_info->ipup_arg)
-    {
-      free (args_info->ipup_arg); /* free previous argument */
-      args_info->ipup_arg = 0;
-    }
-  if (args_info->ipup_orig)
-    {
-      free (args_info->ipup_orig); /* free previous argument */
-      args_info->ipup_orig = 0;
-    }
-  if (args_info->ipdown_arg)
-    {
-      free (args_info->ipdown_arg); /* free previous argument */
-      args_info->ipdown_arg = 0;
-    }
-  if (args_info->ipdown_orig)
-    {
-      free (args_info->ipdown_orig); /* free previous argument */
-      args_info->ipdown_orig = 0;
-    }
-  if (args_info->dynip_arg)
-    {
-      free (args_info->dynip_arg); /* free previous argument */
-      args_info->dynip_arg = 0;
-    }
-  if (args_info->dynip_orig)
-    {
-      free (args_info->dynip_orig); /* free previous argument */
-      args_info->dynip_orig = 0;
-    }
-  if (args_info->statip_arg)
-    {
-      free (args_info->statip_arg); /* free previous argument */
-      args_info->statip_arg = 0;
-    }
-  if (args_info->statip_orig)
-    {
-      free (args_info->statip_orig); /* free previous argument */
-      args_info->statip_orig = 0;
-    }
-  if (args_info->pcodns1_arg)
-    {
-      free (args_info->pcodns1_arg); /* free previous argument */
-      args_info->pcodns1_arg = 0;
-    }
-  if (args_info->pcodns1_orig)
-    {
-      free (args_info->pcodns1_orig); /* free previous argument */
-      args_info->pcodns1_orig = 0;
-    }
-  if (args_info->pcodns2_arg)
-    {
-      free (args_info->pcodns2_arg); /* free previous argument */
-      args_info->pcodns2_arg = 0;
-    }
-  if (args_info->pcodns2_orig)
-    {
-      free (args_info->pcodns2_orig); /* free previous argument */
-      args_info->pcodns2_orig = 0;
-    }
-  if (args_info->timelimit_orig)
-    {
-      free (args_info->timelimit_orig); /* free previous argument */
-      args_info->timelimit_orig = 0;
-    }
-  if (args_info->apn_arg)
-    {
-      free (args_info->apn_arg); /* free previous argument */
-      args_info->apn_arg = 0;
-    }
-  if (args_info->apn_orig)
-    {
-      free (args_info->apn_orig); /* free previous argument */
-      args_info->apn_orig = 0;
-    }
-  if (args_info->qos_orig)
-    {
-      free (args_info->qos_orig); /* free previous argument */
-      args_info->qos_orig = 0;
-    }
-  
-  clear_given (args_info);
+
+	if (args_info->conf_arg) {
+		free(args_info->conf_arg);	/* free previous argument */
+		args_info->conf_arg = 0;
+	}
+	if (args_info->conf_orig) {
+		free(args_info->conf_orig);	/* free previous argument */
+		args_info->conf_orig = 0;
+	}
+	if (args_info->pidfile_arg) {
+		free(args_info->pidfile_arg);	/* free previous argument */
+		args_info->pidfile_arg = 0;
+	}
+	if (args_info->pidfile_orig) {
+		free(args_info->pidfile_orig);	/* free previous argument */
+		args_info->pidfile_orig = 0;
+	}
+	if (args_info->statedir_arg) {
+		free(args_info->statedir_arg);	/* free previous argument */
+		args_info->statedir_arg = 0;
+	}
+	if (args_info->statedir_orig) {
+		free(args_info->statedir_orig);	/* free previous argument */
+		args_info->statedir_orig = 0;
+	}
+	if (args_info->listen_arg) {
+		free(args_info->listen_arg);	/* free previous argument */
+		args_info->listen_arg = 0;
+	}
+	if (args_info->listen_orig) {
+		free(args_info->listen_orig);	/* free previous argument */
+		args_info->listen_orig = 0;
+	}
+	if (args_info->net_arg) {
+		free(args_info->net_arg);	/* free previous argument */
+		args_info->net_arg = 0;
+	}
+	if (args_info->net_orig) {
+		free(args_info->net_orig);	/* free previous argument */
+		args_info->net_orig = 0;
+	}
+	if (args_info->ipup_arg) {
+		free(args_info->ipup_arg);	/* free previous argument */
+		args_info->ipup_arg = 0;
+	}
+	if (args_info->ipup_orig) {
+		free(args_info->ipup_orig);	/* free previous argument */
+		args_info->ipup_orig = 0;
+	}
+	if (args_info->ipdown_arg) {
+		free(args_info->ipdown_arg);	/* free previous argument */
+		args_info->ipdown_arg = 0;
+	}
+	if (args_info->ipdown_orig) {
+		free(args_info->ipdown_orig);	/* free previous argument */
+		args_info->ipdown_orig = 0;
+	}
+	if (args_info->dynip_arg) {
+		free(args_info->dynip_arg);	/* free previous argument */
+		args_info->dynip_arg = 0;
+	}
+	if (args_info->dynip_orig) {
+		free(args_info->dynip_orig);	/* free previous argument */
+		args_info->dynip_orig = 0;
+	}
+	if (args_info->statip_arg) {
+		free(args_info->statip_arg);	/* free previous argument */
+		args_info->statip_arg = 0;
+	}
+	if (args_info->statip_orig) {
+		free(args_info->statip_orig);	/* free previous argument */
+		args_info->statip_orig = 0;
+	}
+	if (args_info->pcodns1_arg) {
+		free(args_info->pcodns1_arg);	/* free previous argument */
+		args_info->pcodns1_arg = 0;
+	}
+	if (args_info->pcodns1_orig) {
+		free(args_info->pcodns1_orig);	/* free previous argument */
+		args_info->pcodns1_orig = 0;
+	}
+	if (args_info->pcodns2_arg) {
+		free(args_info->pcodns2_arg);	/* free previous argument */
+		args_info->pcodns2_arg = 0;
+	}
+	if (args_info->pcodns2_orig) {
+		free(args_info->pcodns2_orig);	/* free previous argument */
+		args_info->pcodns2_orig = 0;
+	}
+	if (args_info->timelimit_orig) {
+		free(args_info->timelimit_orig);	/* free previous argument */
+		args_info->timelimit_orig = 0;
+	}
+	if (args_info->apn_arg) {
+		free(args_info->apn_arg);	/* free previous argument */
+		args_info->apn_arg = 0;
+	}
+	if (args_info->apn_orig) {
+		free(args_info->apn_orig);	/* free previous argument */
+		args_info->apn_orig = 0;
+	}
+	if (args_info->qos_orig) {
+		free(args_info->qos_orig);	/* free previous argument */
+		args_info->qos_orig = 0;
+	}
+
+	clear_given(args_info);
 }
 
 int
-cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
+cmdline_parser_file_save(const char *filename,
+			 struct gengetopt_args_info *args_info)
 {
-  FILE *outfile;
-  int i = 0;
+	FILE *outfile;
+	int i = 0;
 
-  outfile = fopen(filename, "w");
+	outfile = fopen(filename, "w");
 
-  if (!outfile)
-    {
-      fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
-      return EXIT_FAILURE;
-    }
+	if (!outfile) {
+		fprintf(stderr, "%s: cannot open file for writing: %s\n",
+			CMDLINE_PARSER_PACKAGE, filename);
+		return EXIT_FAILURE;
+	}
 
-  if (args_info->help_given) {
-    fprintf(outfile, "%s\n", "help");
-  }
-  if (args_info->version_given) {
-    fprintf(outfile, "%s\n", "version");
-  }
-  if (args_info->fg_given) {
-    fprintf(outfile, "%s\n", "fg");
-  }
-  if (args_info->debug_given) {
-    fprintf(outfile, "%s\n", "debug");
-  }
-  if (args_info->conf_given) {
-    if (args_info->conf_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "conf", args_info->conf_orig);
-    } else {
-      fprintf(outfile, "%s\n", "conf");
-    }
-  }
-  if (args_info->pidfile_given) {
-    if (args_info->pidfile_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "pidfile", args_info->pidfile_orig);
-    } else {
-      fprintf(outfile, "%s\n", "pidfile");
-    }
-  }
-  if (args_info->statedir_given) {
-    if (args_info->statedir_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "statedir", args_info->statedir_orig);
-    } else {
-      fprintf(outfile, "%s\n", "statedir");
-    }
-  }
-  if (args_info->listen_given) {
-    if (args_info->listen_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "listen", args_info->listen_orig);
-    } else {
-      fprintf(outfile, "%s\n", "listen");
-    }
-  }
-  if (args_info->net_given) {
-    if (args_info->net_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "net", args_info->net_orig);
-    } else {
-      fprintf(outfile, "%s\n", "net");
-    }
-  }
-  if (args_info->ipup_given) {
-    if (args_info->ipup_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "ipup", args_info->ipup_orig);
-    } else {
-      fprintf(outfile, "%s\n", "ipup");
-    }
-  }
-  if (args_info->ipdown_given) {
-    if (args_info->ipdown_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "ipdown", args_info->ipdown_orig);
-    } else {
-      fprintf(outfile, "%s\n", "ipdown");
-    }
-  }
-  if (args_info->dynip_given) {
-    if (args_info->dynip_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "dynip", args_info->dynip_orig);
-    } else {
-      fprintf(outfile, "%s\n", "dynip");
-    }
-  }
-  if (args_info->statip_given) {
-    if (args_info->statip_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "statip", args_info->statip_orig);
-    } else {
-      fprintf(outfile, "%s\n", "statip");
-    }
-  }
-  if (args_info->pcodns1_given) {
-    if (args_info->pcodns1_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "pcodns1", args_info->pcodns1_orig);
-    } else {
-      fprintf(outfile, "%s\n", "pcodns1");
-    }
-  }
-  if (args_info->pcodns2_given) {
-    if (args_info->pcodns2_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "pcodns2", args_info->pcodns2_orig);
-    } else {
-      fprintf(outfile, "%s\n", "pcodns2");
-    }
-  }
-  if (args_info->timelimit_given) {
-    if (args_info->timelimit_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "timelimit", args_info->timelimit_orig);
-    } else {
-      fprintf(outfile, "%s\n", "timelimit");
-    }
-  }
-  if (args_info->apn_given) {
-    if (args_info->apn_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "apn", args_info->apn_orig);
-    } else {
-      fprintf(outfile, "%s\n", "apn");
-    }
-  }
-  if (args_info->qos_given) {
-    if (args_info->qos_orig) {
-      fprintf(outfile, "%s=\"%s\"\n", "qos", args_info->qos_orig);
-    } else {
-      fprintf(outfile, "%s\n", "qos");
-    }
-  }
-  
-  fclose (outfile);
+	if (args_info->help_given) {
+		fprintf(outfile, "%s\n", "help");
+	}
+	if (args_info->version_given) {
+		fprintf(outfile, "%s\n", "version");
+	}
+	if (args_info->fg_given) {
+		fprintf(outfile, "%s\n", "fg");
+	}
+	if (args_info->debug_given) {
+		fprintf(outfile, "%s\n", "debug");
+	}
+	if (args_info->conf_given) {
+		if (args_info->conf_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "conf",
+				args_info->conf_orig);
+		} else {
+			fprintf(outfile, "%s\n", "conf");
+		}
+	}
+	if (args_info->pidfile_given) {
+		if (args_info->pidfile_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "pidfile",
+				args_info->pidfile_orig);
+		} else {
+			fprintf(outfile, "%s\n", "pidfile");
+		}
+	}
+	if (args_info->statedir_given) {
+		if (args_info->statedir_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "statedir",
+				args_info->statedir_orig);
+		} else {
+			fprintf(outfile, "%s\n", "statedir");
+		}
+	}
+	if (args_info->listen_given) {
+		if (args_info->listen_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "listen",
+				args_info->listen_orig);
+		} else {
+			fprintf(outfile, "%s\n", "listen");
+		}
+	}
+	if (args_info->net_given) {
+		if (args_info->net_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "net",
+				args_info->net_orig);
+		} else {
+			fprintf(outfile, "%s\n", "net");
+		}
+	}
+	if (args_info->ipup_given) {
+		if (args_info->ipup_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "ipup",
+				args_info->ipup_orig);
+		} else {
+			fprintf(outfile, "%s\n", "ipup");
+		}
+	}
+	if (args_info->ipdown_given) {
+		if (args_info->ipdown_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "ipdown",
+				args_info->ipdown_orig);
+		} else {
+			fprintf(outfile, "%s\n", "ipdown");
+		}
+	}
+	if (args_info->dynip_given) {
+		if (args_info->dynip_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "dynip",
+				args_info->dynip_orig);
+		} else {
+			fprintf(outfile, "%s\n", "dynip");
+		}
+	}
+	if (args_info->statip_given) {
+		if (args_info->statip_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "statip",
+				args_info->statip_orig);
+		} else {
+			fprintf(outfile, "%s\n", "statip");
+		}
+	}
+	if (args_info->pcodns1_given) {
+		if (args_info->pcodns1_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "pcodns1",
+				args_info->pcodns1_orig);
+		} else {
+			fprintf(outfile, "%s\n", "pcodns1");
+		}
+	}
+	if (args_info->pcodns2_given) {
+		if (args_info->pcodns2_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "pcodns2",
+				args_info->pcodns2_orig);
+		} else {
+			fprintf(outfile, "%s\n", "pcodns2");
+		}
+	}
+	if (args_info->timelimit_given) {
+		if (args_info->timelimit_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "timelimit",
+				args_info->timelimit_orig);
+		} else {
+			fprintf(outfile, "%s\n", "timelimit");
+		}
+	}
+	if (args_info->apn_given) {
+		if (args_info->apn_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "apn",
+				args_info->apn_orig);
+		} else {
+			fprintf(outfile, "%s\n", "apn");
+		}
+	}
+	if (args_info->qos_given) {
+		if (args_info->qos_orig) {
+			fprintf(outfile, "%s=\"%s\"\n", "qos",
+				args_info->qos_orig);
+		} else {
+			fprintf(outfile, "%s\n", "qos");
+		}
+	}
 
-  i = EXIT_SUCCESS;
-  return i;
+	fclose(outfile);
+
+	i = EXIT_SUCCESS;
+	return i;
 }
 
-void
-cmdline_parser_free (struct gengetopt_args_info *args_info)
+void cmdline_parser_free(struct gengetopt_args_info *args_info)
 {
-  cmdline_parser_release (args_info);
+	cmdline_parser_release(args_info);
 }
 
-
 /* gengetopt_strdup() */
 /* strdup.c replacement of strdup, which is not standard */
-char *
-gengetopt_strdup (const char *s)
+char *gengetopt_strdup(const char *s)
 {
-  char *result = NULL;
-  if (!s)
-    return result;
+	char *result = NULL;
+	if (!s)
+		return result;
 
-  result = (char*)malloc(strlen(s) + 1);
-  if (result == (char*)0)
-    return (char*)0;
-  strcpy(result, s);
-  return result;
+	result = (char *)malloc(strlen(s) + 1);
+	if (result == (char *)0)
+		return (char *)0;
+	strcpy(result, s);
+	return result;
 }
 
 int
-cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
+cmdline_parser(int argc, char *const *argv,
+	       struct gengetopt_args_info *args_info)
 {
-  return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
+	return cmdline_parser2(argc, argv, args_info, 0, 1, 1);
 }
 
 int
-cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2(int argc, char *const *argv,
+		struct gengetopt_args_info *args_info, int override,
+		int initialize, int check_required)
 {
-  int result;
+	int result;
 
-  result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL);
+	result =
+	    cmdline_parser_internal(argc, argv, args_info, override, initialize,
+				    check_required, NULL);
 
-  if (result == EXIT_FAILURE)
-    {
-      cmdline_parser_free (args_info);
-      exit (EXIT_FAILURE);
-    }
-  
-  return result;
+	if (result == EXIT_FAILURE) {
+		cmdline_parser_free(args_info);
+		exit(EXIT_FAILURE);
+	}
+
+	return result;
 }
 
 int
-cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
+cmdline_parser_required(struct gengetopt_args_info *args_info,
+			const char *prog_name)
 {
-  return EXIT_SUCCESS;
+	return EXIT_SUCCESS;
 }
 
 int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error)
+cmdline_parser_internal(int argc, char *const *argv,
+			struct gengetopt_args_info *args_info, int override,
+			int initialize, int check_required,
+			const char *additional_error)
 {
-  int c;	/* Character of the parsed option.  */
+	int c;			/* Character of the parsed option.  */
 
-  int error = 0;
-  struct gengetopt_args_info local_args_info;
+	int error = 0;
+	struct gengetopt_args_info local_args_info;
 
-  if (initialize)
-    cmdline_parser_init (args_info);
+	if (initialize)
+		cmdline_parser_init(args_info);
 
-  cmdline_parser_init (&local_args_info);
+	cmdline_parser_init(&local_args_info);
 
-  optarg = 0;
-  optind = 0;
-  opterr = 1;
-  optopt = '?';
+	optarg = 0;
+	optind = 0;
+	opterr = 1;
+	optopt = '?';
 
-  while (1)
-    {
-      int option_index = 0;
-      char *stop_char;
+	while (1) {
+		int option_index = 0;
+		char *stop_char;
 
-      static struct option long_options[] = {
-        { "help",	0, NULL, 'h' },
-        { "version",	0, NULL, 'V' },
-        { "fg",	0, NULL, 'f' },
-        { "debug",	0, NULL, 'd' },
-        { "conf",	1, NULL, 'c' },
-        { "pidfile",	1, NULL, 0 },
-        { "statedir",	1, NULL, 0 },
-        { "listen",	1, NULL, 'l' },
-        { "net",	1, NULL, 'n' },
-        { "ipup",	1, NULL, 0 },
-        { "ipdown",	1, NULL, 0 },
-        { "dynip",	1, NULL, 0 },
-        { "statip",	1, NULL, 0 },
-        { "pcodns1",	1, NULL, 0 },
-        { "pcodns2",	1, NULL, 0 },
-        { "timelimit",	1, NULL, 0 },
-        { "apn",	1, NULL, 'a' },
-        { "qos",	1, NULL, 'q' },
-        { NULL,	0, NULL, 0 }
-      };
+		static struct option long_options[] = {
+			{"help", 0, NULL, 'h'},
+			{"version", 0, NULL, 'V'},
+			{"fg", 0, NULL, 'f'},
+			{"debug", 0, NULL, 'd'},
+			{"conf", 1, NULL, 'c'},
+			{"pidfile", 1, NULL, 0},
+			{"statedir", 1, NULL, 0},
+			{"listen", 1, NULL, 'l'},
+			{"net", 1, NULL, 'n'},
+			{"ipup", 1, NULL, 0},
+			{"ipdown", 1, NULL, 0},
+			{"dynip", 1, NULL, 0},
+			{"statip", 1, NULL, 0},
+			{"pcodns1", 1, NULL, 0},
+			{"pcodns2", 1, NULL, 0},
+			{"timelimit", 1, NULL, 0},
+			{"apn", 1, NULL, 'a'},
+			{"qos", 1, NULL, 'q'},
+			{NULL, 0, NULL, 0}
+		};
 
-      stop_char = 0;
-      c = getopt_long (argc, argv, "hVfdc:l:n:a:q:", long_options, &option_index);
+		stop_char = 0;
+		c = getopt_long(argc, argv, "hVfdc:l:n:a:q:", long_options,
+				&option_index);
 
-      if (c == -1) break;	/* Exit from `while (1)' loop.  */
+		if (c == -1)
+			break;	/* Exit from `while (1)' loop.  */
 
-      switch (c)
-        {
-        case 'h':	/* Print help and exit.  */
-          cmdline_parser_print_help ();
-          cmdline_parser_free (&local_args_info);
-          exit (EXIT_SUCCESS);
+		switch (c) {
+		case 'h':	/* Print help and exit.  */
+			cmdline_parser_print_help();
+			cmdline_parser_free(&local_args_info);
+			exit(EXIT_SUCCESS);
 
-        case 'V':	/* Print version and exit.  */
-          cmdline_parser_print_version ();
-          cmdline_parser_free (&local_args_info);
-          exit (EXIT_SUCCESS);
+		case 'V':	/* Print version and exit.  */
+			cmdline_parser_print_version();
+			cmdline_parser_free(&local_args_info);
+			exit(EXIT_SUCCESS);
 
-        case 'f':	/* Run in foreground.  */
-          if (local_args_info.fg_given)
-            {
-              fprintf (stderr, "%s: `--fg' (`-f') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-              goto failure;
-            }
-          if (args_info->fg_given && ! override)
-            continue;
-          local_args_info.fg_given = 1;
-          args_info->fg_given = 1;
-          args_info->fg_flag = !(args_info->fg_flag);
-          break;
+		case 'f':	/* Run in foreground.  */
+			if (local_args_info.fg_given) {
+				fprintf(stderr,
+					"%s: `--fg' (`-f') option given more than once%s\n",
+					argv[0],
+					(additional_error ? additional_error :
+					 ""));
+				goto failure;
+			}
+			if (args_info->fg_given && !override)
+				continue;
+			local_args_info.fg_given = 1;
+			args_info->fg_given = 1;
+			args_info->fg_flag = !(args_info->fg_flag);
+			break;
 
-        case 'd':	/* Run in debug mode.  */
-          if (local_args_info.debug_given)
-            {
-              fprintf (stderr, "%s: `--debug' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-              goto failure;
-            }
-          if (args_info->debug_given && ! override)
-            continue;
-          local_args_info.debug_given = 1;
-          args_info->debug_given = 1;
-          args_info->debug_flag = !(args_info->debug_flag);
-          break;
+		case 'd':	/* Run in debug mode.  */
+			if (local_args_info.debug_given) {
+				fprintf(stderr,
+					"%s: `--debug' (`-d') option given more than once%s\n",
+					argv[0],
+					(additional_error ? additional_error :
+					 ""));
+				goto failure;
+			}
+			if (args_info->debug_given && !override)
+				continue;
+			local_args_info.debug_given = 1;
+			args_info->debug_given = 1;
+			args_info->debug_flag = !(args_info->debug_flag);
+			break;
 
-        case 'c':	/* Read configuration file.  */
-          if (local_args_info.conf_given)
-            {
-              fprintf (stderr, "%s: `--conf' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-              goto failure;
-            }
-          if (args_info->conf_given && ! override)
-            continue;
-          local_args_info.conf_given = 1;
-          args_info->conf_given = 1;
-          if (args_info->conf_arg)
-            free (args_info->conf_arg); /* free previous string */
-          args_info->conf_arg = gengetopt_strdup (optarg);
-          if (args_info->conf_orig)
-            free (args_info->conf_orig); /* free previous string */
-          args_info->conf_orig = gengetopt_strdup (optarg);
-          break;
+		case 'c':	/* Read configuration file.  */
+			if (local_args_info.conf_given) {
+				fprintf(stderr,
+					"%s: `--conf' (`-c') option given more than once%s\n",
+					argv[0],
+					(additional_error ? additional_error :
+					 ""));
+				goto failure;
+			}
+			if (args_info->conf_given && !override)
+				continue;
+			local_args_info.conf_given = 1;
+			args_info->conf_given = 1;
+			if (args_info->conf_arg)
+				free(args_info->conf_arg);	/* free previous string */
+			args_info->conf_arg = gengetopt_strdup(optarg);
+			if (args_info->conf_orig)
+				free(args_info->conf_orig);	/* free previous string */
+			args_info->conf_orig = gengetopt_strdup(optarg);
+			break;
 
-        case 'l':	/* Local interface.  */
-          if (local_args_info.listen_given)
-            {
-              fprintf (stderr, "%s: `--listen' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-              goto failure;
-            }
-          if (args_info->listen_given && ! override)
-            continue;
-          local_args_info.listen_given = 1;
-          args_info->listen_given = 1;
-          if (args_info->listen_arg)
-            free (args_info->listen_arg); /* free previous string */
-          args_info->listen_arg = gengetopt_strdup (optarg);
-          if (args_info->listen_orig)
-            free (args_info->listen_orig); /* free previous string */
-          args_info->listen_orig = gengetopt_strdup (optarg);
-          break;
+		case 'l':	/* Local interface.  */
+			if (local_args_info.listen_given) {
+				fprintf(stderr,
+					"%s: `--listen' (`-l') option given more than once%s\n",
+					argv[0],
+					(additional_error ? additional_error :
+					 ""));
+				goto failure;
+			}
+			if (args_info->listen_given && !override)
+				continue;
+			local_args_info.listen_given = 1;
+			args_info->listen_given = 1;
+			if (args_info->listen_arg)
+				free(args_info->listen_arg);	/* free previous string */
+			args_info->listen_arg = gengetopt_strdup(optarg);
+			if (args_info->listen_orig)
+				free(args_info->listen_orig);	/* free previous string */
+			args_info->listen_orig = gengetopt_strdup(optarg);
+			break;
 
-        case 'n':	/* Network.  */
-          if (local_args_info.net_given)
-            {
-              fprintf (stderr, "%s: `--net' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-              goto failure;
-            }
-          if (args_info->net_given && ! override)
-            continue;
-          local_args_info.net_given = 1;
-          args_info->net_given = 1;
-          if (args_info->net_arg)
-            free (args_info->net_arg); /* free previous string */
-          args_info->net_arg = gengetopt_strdup (optarg);
-          if (args_info->net_orig)
-            free (args_info->net_orig); /* free previous string */
-          args_info->net_orig = gengetopt_strdup (optarg);
-          break;
+		case 'n':	/* Network.  */
+			if (local_args_info.net_given) {
+				fprintf(stderr,
+					"%s: `--net' (`-n') option given more than once%s\n",
+					argv[0],
+					(additional_error ? additional_error :
+					 ""));
+				goto failure;
+			}
+			if (args_info->net_given && !override)
+				continue;
+			local_args_info.net_given = 1;
+			args_info->net_given = 1;
+			if (args_info->net_arg)
+				free(args_info->net_arg);	/* free previous string */
+			args_info->net_arg = gengetopt_strdup(optarg);
+			if (args_info->net_orig)
+				free(args_info->net_orig);	/* free previous string */
+			args_info->net_orig = gengetopt_strdup(optarg);
+			break;
 
-        case 'a':	/* Access point name.  */
-          if (local_args_info.apn_given)
-            {
-              fprintf (stderr, "%s: `--apn' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-              goto failure;
-            }
-          if (args_info->apn_given && ! override)
-            continue;
-          local_args_info.apn_given = 1;
-          args_info->apn_given = 1;
-          if (args_info->apn_arg)
-            free (args_info->apn_arg); /* free previous string */
-          args_info->apn_arg = gengetopt_strdup (optarg);
-          if (args_info->apn_orig)
-            free (args_info->apn_orig); /* free previous string */
-          args_info->apn_orig = gengetopt_strdup (optarg);
-          break;
+		case 'a':	/* Access point name.  */
+			if (local_args_info.apn_given) {
+				fprintf(stderr,
+					"%s: `--apn' (`-a') option given more than once%s\n",
+					argv[0],
+					(additional_error ? additional_error :
+					 ""));
+				goto failure;
+			}
+			if (args_info->apn_given && !override)
+				continue;
+			local_args_info.apn_given = 1;
+			args_info->apn_given = 1;
+			if (args_info->apn_arg)
+				free(args_info->apn_arg);	/* free previous string */
+			args_info->apn_arg = gengetopt_strdup(optarg);
+			if (args_info->apn_orig)
+				free(args_info->apn_orig);	/* free previous string */
+			args_info->apn_orig = gengetopt_strdup(optarg);
+			break;
 
-        case 'q':	/* Requested quality of service.  */
-          if (local_args_info.qos_given)
-            {
-              fprintf (stderr, "%s: `--qos' (`-q') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-              goto failure;
-            }
-          if (args_info->qos_given && ! override)
-            continue;
-          local_args_info.qos_given = 1;
-          args_info->qos_given = 1;
-          args_info->qos_arg = strtol (optarg, &stop_char, 0);
-          if (!(stop_char && *stop_char == '\0')) {
-            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
-            goto failure;
-          }
-          if (args_info->qos_orig)
-            free (args_info->qos_orig); /* free previous string */
-          args_info->qos_orig = gengetopt_strdup (optarg);
-          break;
+		case 'q':	/* Requested quality of service.  */
+			if (local_args_info.qos_given) {
+				fprintf(stderr,
+					"%s: `--qos' (`-q') option given more than once%s\n",
+					argv[0],
+					(additional_error ? additional_error :
+					 ""));
+				goto failure;
+			}
+			if (args_info->qos_given && !override)
+				continue;
+			local_args_info.qos_given = 1;
+			args_info->qos_given = 1;
+			args_info->qos_arg = strtol(optarg, &stop_char, 0);
+			if (!(stop_char && *stop_char == '\0')) {
+				fprintf(stderr,
+					"%s: invalid numeric value: %s\n",
+					argv[0], optarg);
+				goto failure;
+			}
+			if (args_info->qos_orig)
+				free(args_info->qos_orig);	/* free previous string */
+			args_info->qos_orig = gengetopt_strdup(optarg);
+			break;
 
+		case 0:	/* Long option with no short option */
+			/* Filename of process id file.  */
+			if (strcmp(long_options[option_index].name, "pidfile")
+			    == 0) {
+				if (local_args_info.pidfile_given) {
+					fprintf(stderr,
+						"%s: `--pidfile' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->pidfile_given && !override)
+					continue;
+				local_args_info.pidfile_given = 1;
+				args_info->pidfile_given = 1;
+				if (args_info->pidfile_arg)
+					free(args_info->pidfile_arg);	/* free previous string */
+				args_info->pidfile_arg =
+				    gengetopt_strdup(optarg);
+				if (args_info->pidfile_orig)
+					free(args_info->pidfile_orig);	/* free previous string */
+				args_info->pidfile_orig =
+				    gengetopt_strdup(optarg);
+			}
+			/* Directory of nonvolatile data.  */
+			else if (strcmp
+				 (long_options[option_index].name,
+				  "statedir") == 0) {
+				if (local_args_info.statedir_given) {
+					fprintf(stderr,
+						"%s: `--statedir' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->statedir_given && !override)
+					continue;
+				local_args_info.statedir_given = 1;
+				args_info->statedir_given = 1;
+				if (args_info->statedir_arg)
+					free(args_info->statedir_arg);	/* free previous string */
+				args_info->statedir_arg =
+				    gengetopt_strdup(optarg);
+				if (args_info->statedir_orig)
+					free(args_info->statedir_orig);	/* free previous string */
+				args_info->statedir_orig =
+				    gengetopt_strdup(optarg);
+			}
+			/* Script to run after link-up.  */
+			else if (strcmp(long_options[option_index].name, "ipup")
+				 == 0) {
+				if (local_args_info.ipup_given) {
+					fprintf(stderr,
+						"%s: `--ipup' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->ipup_given && !override)
+					continue;
+				local_args_info.ipup_given = 1;
+				args_info->ipup_given = 1;
+				if (args_info->ipup_arg)
+					free(args_info->ipup_arg);	/* free previous string */
+				args_info->ipup_arg = gengetopt_strdup(optarg);
+				if (args_info->ipup_orig)
+					free(args_info->ipup_orig);	/* free previous string */
+				args_info->ipup_orig = gengetopt_strdup(optarg);
+			}
+			/* Script to run after link-down.  */
+			else if (strcmp
+				 (long_options[option_index].name,
+				  "ipdown") == 0) {
+				if (local_args_info.ipdown_given) {
+					fprintf(stderr,
+						"%s: `--ipdown' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->ipdown_given && !override)
+					continue;
+				local_args_info.ipdown_given = 1;
+				args_info->ipdown_given = 1;
+				if (args_info->ipdown_arg)
+					free(args_info->ipdown_arg);	/* free previous string */
+				args_info->ipdown_arg =
+				    gengetopt_strdup(optarg);
+				if (args_info->ipdown_orig)
+					free(args_info->ipdown_orig);	/* free previous string */
+				args_info->ipdown_orig =
+				    gengetopt_strdup(optarg);
+			}
+			/* Dynamic IP address pool.  */
+			else if (strcmp
+				 (long_options[option_index].name,
+				  "dynip") == 0) {
+				if (local_args_info.dynip_given) {
+					fprintf(stderr,
+						"%s: `--dynip' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->dynip_given && !override)
+					continue;
+				local_args_info.dynip_given = 1;
+				args_info->dynip_given = 1;
+				if (args_info->dynip_arg)
+					free(args_info->dynip_arg);	/* free previous string */
+				args_info->dynip_arg = gengetopt_strdup(optarg);
+				if (args_info->dynip_orig)
+					free(args_info->dynip_orig);	/* free previous string */
+				args_info->dynip_orig =
+				    gengetopt_strdup(optarg);
+			}
+			/* Static IP address pool.  */
+			else if (strcmp
+				 (long_options[option_index].name,
+				  "statip") == 0) {
+				if (local_args_info.statip_given) {
+					fprintf(stderr,
+						"%s: `--statip' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->statip_given && !override)
+					continue;
+				local_args_info.statip_given = 1;
+				args_info->statip_given = 1;
+				if (args_info->statip_arg)
+					free(args_info->statip_arg);	/* free previous string */
+				args_info->statip_arg =
+				    gengetopt_strdup(optarg);
+				if (args_info->statip_orig)
+					free(args_info->statip_orig);	/* free previous string */
+				args_info->statip_orig =
+				    gengetopt_strdup(optarg);
+			}
+			/* PCO DNS Server 1.  */
+			else if (strcmp
+				 (long_options[option_index].name,
+				  "pcodns1") == 0) {
+				if (local_args_info.pcodns1_given) {
+					fprintf(stderr,
+						"%s: `--pcodns1' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->pcodns1_given && !override)
+					continue;
+				local_args_info.pcodns1_given = 1;
+				args_info->pcodns1_given = 1;
+				if (args_info->pcodns1_arg)
+					free(args_info->pcodns1_arg);	/* free previous string */
+				args_info->pcodns1_arg =
+				    gengetopt_strdup(optarg);
+				if (args_info->pcodns1_orig)
+					free(args_info->pcodns1_orig);	/* free previous string */
+				args_info->pcodns1_orig =
+				    gengetopt_strdup(optarg);
+			}
+			/* PCO DNS Server 2.  */
+			else if (strcmp
+				 (long_options[option_index].name,
+				  "pcodns2") == 0) {
+				if (local_args_info.pcodns2_given) {
+					fprintf(stderr,
+						"%s: `--pcodns2' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->pcodns2_given && !override)
+					continue;
+				local_args_info.pcodns2_given = 1;
+				args_info->pcodns2_given = 1;
+				if (args_info->pcodns2_arg)
+					free(args_info->pcodns2_arg);	/* free previous string */
+				args_info->pcodns2_arg =
+				    gengetopt_strdup(optarg);
+				if (args_info->pcodns2_orig)
+					free(args_info->pcodns2_orig);	/* free previous string */
+				args_info->pcodns2_orig =
+				    gengetopt_strdup(optarg);
+			}
+			/* Exit after timelimit seconds.  */
+			else if (strcmp
+				 (long_options[option_index].name,
+				  "timelimit") == 0) {
+				if (local_args_info.timelimit_given) {
+					fprintf(stderr,
+						"%s: `--timelimit' option given more than once%s\n",
+						argv[0],
+						(additional_error ?
+						 additional_error : ""));
+					goto failure;
+				}
+				if (args_info->timelimit_given && !override)
+					continue;
+				local_args_info.timelimit_given = 1;
+				args_info->timelimit_given = 1;
+				args_info->timelimit_arg =
+				    strtol(optarg, &stop_char, 0);
+				if (!(stop_char && *stop_char == '\0')) {
+					fprintf(stderr,
+						"%s: invalid numeric value: %s\n",
+						argv[0], optarg);
+					goto failure;
+				}
+				if (args_info->timelimit_orig)
+					free(args_info->timelimit_orig);	/* free previous string */
+				args_info->timelimit_orig =
+				    gengetopt_strdup(optarg);
+			}
 
-        case 0:	/* Long option with no short option */
-          /* Filename of process id file.  */
-          if (strcmp (long_options[option_index].name, "pidfile") == 0)
-          {
-            if (local_args_info.pidfile_given)
-              {
-                fprintf (stderr, "%s: `--pidfile' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->pidfile_given && ! override)
-              continue;
-            local_args_info.pidfile_given = 1;
-            args_info->pidfile_given = 1;
-            if (args_info->pidfile_arg)
-              free (args_info->pidfile_arg); /* free previous string */
-            args_info->pidfile_arg = gengetopt_strdup (optarg);
-            if (args_info->pidfile_orig)
-              free (args_info->pidfile_orig); /* free previous string */
-            args_info->pidfile_orig = gengetopt_strdup (optarg);
-          }
-          /* Directory of nonvolatile data.  */
-          else if (strcmp (long_options[option_index].name, "statedir") == 0)
-          {
-            if (local_args_info.statedir_given)
-              {
-                fprintf (stderr, "%s: `--statedir' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->statedir_given && ! override)
-              continue;
-            local_args_info.statedir_given = 1;
-            args_info->statedir_given = 1;
-            if (args_info->statedir_arg)
-              free (args_info->statedir_arg); /* free previous string */
-            args_info->statedir_arg = gengetopt_strdup (optarg);
-            if (args_info->statedir_orig)
-              free (args_info->statedir_orig); /* free previous string */
-            args_info->statedir_orig = gengetopt_strdup (optarg);
-          }
-          /* Script to run after link-up.  */
-          else if (strcmp (long_options[option_index].name, "ipup") == 0)
-          {
-            if (local_args_info.ipup_given)
-              {
-                fprintf (stderr, "%s: `--ipup' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->ipup_given && ! override)
-              continue;
-            local_args_info.ipup_given = 1;
-            args_info->ipup_given = 1;
-            if (args_info->ipup_arg)
-              free (args_info->ipup_arg); /* free previous string */
-            args_info->ipup_arg = gengetopt_strdup (optarg);
-            if (args_info->ipup_orig)
-              free (args_info->ipup_orig); /* free previous string */
-            args_info->ipup_orig = gengetopt_strdup (optarg);
-          }
-          /* Script to run after link-down.  */
-          else if (strcmp (long_options[option_index].name, "ipdown") == 0)
-          {
-            if (local_args_info.ipdown_given)
-              {
-                fprintf (stderr, "%s: `--ipdown' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->ipdown_given && ! override)
-              continue;
-            local_args_info.ipdown_given = 1;
-            args_info->ipdown_given = 1;
-            if (args_info->ipdown_arg)
-              free (args_info->ipdown_arg); /* free previous string */
-            args_info->ipdown_arg = gengetopt_strdup (optarg);
-            if (args_info->ipdown_orig)
-              free (args_info->ipdown_orig); /* free previous string */
-            args_info->ipdown_orig = gengetopt_strdup (optarg);
-          }
-          /* Dynamic IP address pool.  */
-          else if (strcmp (long_options[option_index].name, "dynip") == 0)
-          {
-            if (local_args_info.dynip_given)
-              {
-                fprintf (stderr, "%s: `--dynip' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->dynip_given && ! override)
-              continue;
-            local_args_info.dynip_given = 1;
-            args_info->dynip_given = 1;
-            if (args_info->dynip_arg)
-              free (args_info->dynip_arg); /* free previous string */
-            args_info->dynip_arg = gengetopt_strdup (optarg);
-            if (args_info->dynip_orig)
-              free (args_info->dynip_orig); /* free previous string */
-            args_info->dynip_orig = gengetopt_strdup (optarg);
-          }
-          /* Static IP address pool.  */
-          else if (strcmp (long_options[option_index].name, "statip") == 0)
-          {
-            if (local_args_info.statip_given)
-              {
-                fprintf (stderr, "%s: `--statip' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->statip_given && ! override)
-              continue;
-            local_args_info.statip_given = 1;
-            args_info->statip_given = 1;
-            if (args_info->statip_arg)
-              free (args_info->statip_arg); /* free previous string */
-            args_info->statip_arg = gengetopt_strdup (optarg);
-            if (args_info->statip_orig)
-              free (args_info->statip_orig); /* free previous string */
-            args_info->statip_orig = gengetopt_strdup (optarg);
-          }
-          /* PCO DNS Server 1.  */
-          else if (strcmp (long_options[option_index].name, "pcodns1") == 0)
-          {
-            if (local_args_info.pcodns1_given)
-              {
-                fprintf (stderr, "%s: `--pcodns1' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->pcodns1_given && ! override)
-              continue;
-            local_args_info.pcodns1_given = 1;
-            args_info->pcodns1_given = 1;
-            if (args_info->pcodns1_arg)
-              free (args_info->pcodns1_arg); /* free previous string */
-            args_info->pcodns1_arg = gengetopt_strdup (optarg);
-            if (args_info->pcodns1_orig)
-              free (args_info->pcodns1_orig); /* free previous string */
-            args_info->pcodns1_orig = gengetopt_strdup (optarg);
-          }
-          /* PCO DNS Server 2.  */
-          else if (strcmp (long_options[option_index].name, "pcodns2") == 0)
-          {
-            if (local_args_info.pcodns2_given)
-              {
-                fprintf (stderr, "%s: `--pcodns2' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->pcodns2_given && ! override)
-              continue;
-            local_args_info.pcodns2_given = 1;
-            args_info->pcodns2_given = 1;
-            if (args_info->pcodns2_arg)
-              free (args_info->pcodns2_arg); /* free previous string */
-            args_info->pcodns2_arg = gengetopt_strdup (optarg);
-            if (args_info->pcodns2_orig)
-              free (args_info->pcodns2_orig); /* free previous string */
-            args_info->pcodns2_orig = gengetopt_strdup (optarg);
-          }
-          /* Exit after timelimit seconds.  */
-          else if (strcmp (long_options[option_index].name, "timelimit") == 0)
-          {
-            if (local_args_info.timelimit_given)
-              {
-                fprintf (stderr, "%s: `--timelimit' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
-                goto failure;
-              }
-            if (args_info->timelimit_given && ! override)
-              continue;
-            local_args_info.timelimit_given = 1;
-            args_info->timelimit_given = 1;
-            args_info->timelimit_arg = strtol (optarg, &stop_char, 0);
-            if (!(stop_char && *stop_char == '\0')) {
-              fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
-              goto failure;
-            }
-            if (args_info->timelimit_orig)
-              free (args_info->timelimit_orig); /* free previous string */
-            args_info->timelimit_orig = gengetopt_strdup (optarg);
-          }
-          
-          break;
-        case '?':	/* Invalid option.  */
-          /* `getopt_long' already printed an error message.  */
-          goto failure;
+			break;
+		case '?':	/* Invalid option.  */
+			/* `getopt_long' already printed an error message.  */
+			goto failure;
 
-        default:	/* bug: option not considered.  */
-          fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
-          abort ();
-        } /* switch */
-    } /* while */
+		default:	/* bug: option not considered.  */
+			fprintf(stderr, "%s: option unknown: %c%s\n",
+				CMDLINE_PARSER_PACKAGE, c,
+				(additional_error ? additional_error : ""));
+			abort();
+		}		/* switch */
+	}			/* while */
 
+	cmdline_parser_release(&local_args_info);
 
+	if (error)
+		return (EXIT_FAILURE);
 
-
-  cmdline_parser_release (&local_args_info);
-
-  if ( error )
-    return (EXIT_FAILURE);
-
-  return 0;
+	return 0;
 
 failure:
-  
-  cmdline_parser_release (&local_args_info);
-  return (EXIT_FAILURE);
+
+	cmdline_parser_release(&local_args_info);
+	return (EXIT_FAILURE);
 }
 
 #ifndef CONFIG_FILE_LINE_SIZE
@@ -905,168 +966,167 @@
 #define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3)
 /* 3 is for "--" and "=" */
 
-char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE+1];
+char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1];
 
 int
-cmdline_parser_configfile (char * const filename, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser_configfile(char *const filename,
+			  struct gengetopt_args_info *args_info, int override,
+			  int initialize, int check_required)
 {
-  FILE* file;
-  char linebuf[CONFIG_FILE_LINE_SIZE];
-  int line_num = 0;
-  int i, result, equal;
-  char *fopt, *farg;
-  char *str_index;
-  size_t len, next_token;
-  char delimiter;
-  int my_argc = 0;
-  char **my_argv_arg;
-  char *additional_error;
+	FILE *file;
+	char linebuf[CONFIG_FILE_LINE_SIZE];
+	int line_num = 0;
+	int i, result, equal;
+	char *fopt, *farg;
+	char *str_index;
+	size_t len, next_token;
+	char delimiter;
+	int my_argc = 0;
+	char **my_argv_arg;
+	char *additional_error;
 
-  /* store the program name */
-  cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list));
-  cmd_line_list_tmp->next = cmd_line_list;
-  cmd_line_list = cmd_line_list_tmp;
-  cmd_line_list->string_arg = gengetopt_strdup (CMDLINE_PARSER_PACKAGE);
+	/* store the program name */
+	cmd_line_list_tmp =
+	    (struct line_list *)malloc(sizeof(struct line_list));
+	cmd_line_list_tmp->next = cmd_line_list;
+	cmd_line_list = cmd_line_list_tmp;
+	cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE);
 
-  if ((file = fopen(filename, "r")) == NULL)
-    {
-      fprintf (stderr, "%s: Error opening configuration file '%s'\n",
-               CMDLINE_PARSER_PACKAGE, filename);
-      result = EXIT_FAILURE;
-      goto conf_failure;
-    }
+	if ((file = fopen(filename, "r")) == NULL) {
+		fprintf(stderr, "%s: Error opening configuration file '%s'\n",
+			CMDLINE_PARSER_PACKAGE, filename);
+		result = EXIT_FAILURE;
+		goto conf_failure;
+	}
 
-  while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != NULL)
-    {
-      ++line_num;
-      my_argv[0] = '\0';
-      len = strlen(linebuf);
-      if (len > (CONFIG_FILE_LINE_BUFFER_SIZE-1))
-        {
-          fprintf (stderr, "%s:%s:%d: Line too long in configuration file\n",
-                   CMDLINE_PARSER_PACKAGE, filename, line_num);
-          result = EXIT_FAILURE;
-          goto conf_failure;
-        }
+	while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != NULL) {
+		++line_num;
+		my_argv[0] = '\0';
+		len = strlen(linebuf);
+		if (len > (CONFIG_FILE_LINE_BUFFER_SIZE - 1)) {
+			fprintf(stderr,
+				"%s:%s:%d: Line too long in configuration file\n",
+				CMDLINE_PARSER_PACKAGE, filename, line_num);
+			result = EXIT_FAILURE;
+			goto conf_failure;
+		}
 
-      /* find first non-whitespace character in the line */
-      next_token = strspn ( linebuf, " \t\r\n");
-      str_index  = linebuf + next_token;
+		/* find first non-whitespace character in the line */
+		next_token = strspn(linebuf, " \t\r\n");
+		str_index = linebuf + next_token;
 
-      if ( str_index[0] == '\0' || str_index[0] == '#')
-        continue; /* empty line or comment line is skipped */
+		if (str_index[0] == '\0' || str_index[0] == '#')
+			continue;	/* empty line or comment line is skipped */
 
-      fopt = str_index;
+		fopt = str_index;
 
-      /* truncate fopt at the end of the first non-valid character */
-      next_token = strcspn (fopt, " \t\r\n=");
+		/* truncate fopt at the end of the first non-valid character */
+		next_token = strcspn(fopt, " \t\r\n=");
 
-      if (fopt[next_token] == '\0') /* the line is over */
-        {
-          farg  = NULL;
-          equal = 0;
-          goto noarg;
-        }
+		if (fopt[next_token] == '\0') {	/* the line is over */
+			farg = NULL;
+			equal = 0;
+			goto noarg;
+		}
 
-      /* remember if equal sign is present */
-      equal = (fopt[next_token] == '=');
-      fopt[next_token++] = '\0';
+		/* remember if equal sign is present */
+		equal = (fopt[next_token] == '=');
+		fopt[next_token++] = '\0';
 
-      /* advance pointers to the next token after the end of fopt */
-      next_token += strspn (fopt + next_token, " \t\r\n");
-      /* check for the presence of equal sign, and if so, skip it */
-      if ( !equal )
-        if ((equal = (fopt[next_token] == '=')))
-          {
-            next_token++;
-            next_token += strspn (fopt + next_token, " \t\r\n");
-          }
-      str_index  += next_token;
+		/* advance pointers to the next token after the end of fopt */
+		next_token += strspn(fopt + next_token, " \t\r\n");
+		/* check for the presence of equal sign, and if so, skip it */
+		if (!equal)
+			if ((equal = (fopt[next_token] == '='))) {
+				next_token++;
+				next_token +=
+				    strspn(fopt + next_token, " \t\r\n");
+			}
+		str_index += next_token;
 
-      /* find argument */
-      farg = str_index;
-      if ( farg[0] == '\"' || farg[0] == '\'' )
-        { /* quoted argument */
-          str_index = strchr (++farg, str_index[0] ); /* skip opening quote */
-          if (! str_index)
-            {
-              fprintf
-                (stderr,
-                 "%s:%s:%d: unterminated string in configuration file\n",
-                 CMDLINE_PARSER_PACKAGE, filename, line_num);
-              result = EXIT_FAILURE;
-              goto conf_failure;
-            }
-        }
-      else
-        { /* read up the remaining part up to a delimiter */
-          next_token = strcspn (farg, " \t\r\n#\'\"");
-          str_index += next_token;
-        }
+		/* find argument */
+		farg = str_index;
+		if (farg[0] == '\"' || farg[0] == '\'') {	/* quoted argument */
+			str_index = strchr(++farg, str_index[0]);	/* skip opening quote */
+			if (!str_index) {
+				fprintf
+				    (stderr,
+				     "%s:%s:%d: unterminated string in configuration file\n",
+				     CMDLINE_PARSER_PACKAGE, filename,
+				     line_num);
+				result = EXIT_FAILURE;
+				goto conf_failure;
+			}
+		} else {	/* read up the remaining part up to a delimiter */
+			next_token = strcspn(farg, " \t\r\n#\'\"");
+			str_index += next_token;
+		}
 
-      /* truncate farg at the delimiter and store it for further check */
-      delimiter = *str_index, *str_index++ = '\0';
+		/* truncate farg at the delimiter and store it for further check */
+		delimiter = *str_index, *str_index++ = '\0';
 
-      /* everything but comment is illegal at the end of line */
-      if (delimiter != '\0' && delimiter != '#')
-        {
-          str_index += strspn(str_index, " \t\r\n");
-          if (*str_index != '\0' && *str_index != '#')
-            {
-              fprintf
-                (stderr,
-                 "%s:%s:%d: malformed string in configuration file\n",
-                 CMDLINE_PARSER_PACKAGE, filename, line_num);
-              result = EXIT_FAILURE;
-              goto conf_failure;
-            }
-        }
+		/* everything but comment is illegal at the end of line */
+		if (delimiter != '\0' && delimiter != '#') {
+			str_index += strspn(str_index, " \t\r\n");
+			if (*str_index != '\0' && *str_index != '#') {
+				fprintf
+				    (stderr,
+				     "%s:%s:%d: malformed string in configuration file\n",
+				     CMDLINE_PARSER_PACKAGE, filename,
+				     line_num);
+				result = EXIT_FAILURE;
+				goto conf_failure;
+			}
+		}
 
-    noarg:
-      ++my_argc;
-      len = strlen(fopt);
+noarg:
+		++my_argc;
+		len = strlen(fopt);
 
-      strcat (my_argv, len > 1 ? "--" : "-");
-      strcat (my_argv, fopt);
-      if (len > 1 && ((farg &&*farg) || equal))
-          strcat (my_argv, "=");
-      if (farg && *farg)
-          strcat (my_argv, farg);
+		strcat(my_argv, len > 1 ? "--" : "-");
+		strcat(my_argv, fopt);
+		if (len > 1 && ((farg && *farg) || equal))
+			strcat(my_argv, "=");
+		if (farg && *farg)
+			strcat(my_argv, farg);
 
-      cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list));
-      cmd_line_list_tmp->next = cmd_line_list;
-      cmd_line_list = cmd_line_list_tmp;
-      cmd_line_list->string_arg = gengetopt_strdup(my_argv);
-    } /* while */
+		cmd_line_list_tmp =
+		    (struct line_list *)malloc(sizeof(struct line_list));
+		cmd_line_list_tmp->next = cmd_line_list;
+		cmd_line_list = cmd_line_list_tmp;
+		cmd_line_list->string_arg = gengetopt_strdup(my_argv);
+	}			/* while */
 
-  ++my_argc; /* for program name */
-  my_argv_arg = (char **) malloc((my_argc+1) * sizeof(char *));
-  cmd_line_list_tmp = cmd_line_list;
-  for (i = my_argc - 1; i >= 0; --i) {
-    my_argv_arg[i] = cmd_line_list_tmp->string_arg;
-    cmd_line_list_tmp = cmd_line_list_tmp->next;
-  }
-  my_argv_arg[my_argc] = 0;
+	++my_argc;		/* for program name */
+	my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *));
+	cmd_line_list_tmp = cmd_line_list;
+	for (i = my_argc - 1; i >= 0; --i) {
+		my_argv_arg[i] = cmd_line_list_tmp->string_arg;
+		cmd_line_list_tmp = cmd_line_list_tmp->next;
+	}
+	my_argv_arg[my_argc] = 0;
 
-  additional_error = (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1);
-  strcpy (additional_error, ADDITIONAL_ERROR);
-  strcat (additional_error, filename);
-  result =
-    cmdline_parser_internal (my_argc, my_argv_arg, args_info, override, initialize, check_required, additional_error);
+	additional_error =
+	    (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1);
+	strcpy(additional_error, ADDITIONAL_ERROR);
+	strcat(additional_error, filename);
+	result =
+	    cmdline_parser_internal(my_argc, my_argv_arg, args_info, override,
+				    initialize, check_required,
+				    additional_error);
 
-  free (additional_error);
-  free (my_argv_arg);
+	free(additional_error);
+	free(my_argv_arg);
 
 conf_failure:
-  if (file)
-    fclose(file);
+	if (file)
+		fclose(file);
 
-  free_cmd_list();
-  if (result == EXIT_FAILURE)
-    {
-      cmdline_parser_free (args_info);
-      exit (EXIT_FAILURE);
-    }
-  
-  return result;
+	free_cmd_list();
+	if (result == EXIT_FAILURE) {
+		cmdline_parser_free(args_info);
+		exit(EXIT_FAILURE);
+	}
+
+	return result;
 }
diff --git a/ggsn/cmdline.h b/ggsn/cmdline.h
index d9e3086..23a6eee 100644
--- a/ggsn/cmdline.h
+++ b/ggsn/cmdline.h
@@ -12,7 +12,7 @@
 
 #ifdef __cplusplus
 extern "C" {
-#endif /* __cplusplus */
+#endif				/* __cplusplus */
 
 #ifndef CMDLINE_PARSER_PACKAGE
 #define CMDLINE_PARSER_PACKAGE PACKAGE
@@ -22,105 +22,104 @@
 #define CMDLINE_PARSER_VERSION VERSION
 #endif
 
-struct gengetopt_args_info
-{
-  const char *help_help; /* Print help and exit help description.  */
-  const char *version_help; /* Print version and exit help description.  */
-  int fg_flag;	/* Run in foreground (default=off).  */
-  const char *fg_help; /* Run in foreground help description.  */
-  int debug_flag;	/* Run in debug mode (default=off).  */
-  const char *debug_help; /* Run in debug mode help description.  */
-  char * conf_arg;	/* Read configuration file (default='/etc/ggsn.conf').  */
-  char * conf_orig;	/* Read configuration file original value given at command line.  */
-  const char *conf_help; /* Read configuration file help description.  */
-  char * pidfile_arg;	/* Filename of process id file (default='/var/run/ggsn.pid').  */
-  char * pidfile_orig;	/* Filename of process id file original value given at command line.  */
-  const char *pidfile_help; /* Filename of process id file help description.  */
-  char * statedir_arg;	/* Directory of nonvolatile data (default='/var/lib/ggsn/').  */
-  char * statedir_orig;	/* Directory of nonvolatile data original value given at command line.  */
-  const char *statedir_help; /* Directory of nonvolatile data help description.  */
-  char * listen_arg;	/* Local interface.  */
-  char * listen_orig;	/* Local interface original value given at command line.  */
-  const char *listen_help; /* Local interface help description.  */
-  char * net_arg;	/* Network (default='192.168.0.0/24').  */
-  char * net_orig;	/* Network original value given at command line.  */
-  const char *net_help; /* Network help description.  */
-  char * ipup_arg;	/* Script to run after link-up.  */
-  char * ipup_orig;	/* Script to run after link-up original value given at command line.  */
-  const char *ipup_help; /* Script to run after link-up help description.  */
-  char * ipdown_arg;	/* Script to run after link-down.  */
-  char * ipdown_orig;	/* Script to run after link-down original value given at command line.  */
-  const char *ipdown_help; /* Script to run after link-down help description.  */
-  char * dynip_arg;	/* Dynamic IP address pool.  */
-  char * dynip_orig;	/* Dynamic IP address pool original value given at command line.  */
-  const char *dynip_help; /* Dynamic IP address pool help description.  */
-  char * statip_arg;	/* Static IP address pool.  */
-  char * statip_orig;	/* Static IP address pool original value given at command line.  */
-  const char *statip_help; /* Static IP address pool help description.  */
-  char * pcodns1_arg;	/* PCO DNS Server 1 (default='0.0.0.0').  */
-  char * pcodns1_orig;	/* PCO DNS Server 1 original value given at command line.  */
-  const char *pcodns1_help; /* PCO DNS Server 1 help description.  */
-  char * pcodns2_arg;	/* PCO DNS Server 2 (default='0.0.0.0').  */
-  char * pcodns2_orig;	/* PCO DNS Server 2 original value given at command line.  */
-  const char *pcodns2_help; /* PCO DNS Server 2 help description.  */
-  int timelimit_arg;	/* Exit after timelimit seconds (default='0').  */
-  char * timelimit_orig;	/* Exit after timelimit seconds original value given at command line.  */
-  const char *timelimit_help; /* Exit after timelimit seconds help description.  */
-  char * apn_arg;	/* Access point name (default='internet').  */
-  char * apn_orig;	/* Access point name original value given at command line.  */
-  const char *apn_help; /* Access point name help description.  */
-  int qos_arg;	/* Requested quality of service (default='0x0b921f').  */
-  char * qos_orig;	/* Requested quality of service original value given at command line.  */
-  const char *qos_help; /* Requested quality of service help description.  */
-  
-  int help_given ;	/* Whether help was given.  */
-  int version_given ;	/* Whether version was given.  */
-  int fg_given ;	/* Whether fg was given.  */
-  int debug_given ;	/* Whether debug was given.  */
-  int conf_given ;	/* Whether conf was given.  */
-  int pidfile_given ;	/* Whether pidfile was given.  */
-  int statedir_given ;	/* Whether statedir was given.  */
-  int listen_given ;	/* Whether listen was given.  */
-  int net_given ;	/* Whether net was given.  */
-  int ipup_given ;	/* Whether ipup was given.  */
-  int ipdown_given ;	/* Whether ipdown was given.  */
-  int dynip_given ;	/* Whether dynip was given.  */
-  int statip_given ;	/* Whether statip was given.  */
-  int pcodns1_given ;	/* Whether pcodns1 was given.  */
-  int pcodns2_given ;	/* Whether pcodns2 was given.  */
-  int timelimit_given ;	/* Whether timelimit was given.  */
-  int apn_given ;	/* Whether apn was given.  */
-  int qos_given ;	/* Whether qos was given.  */
+	struct gengetopt_args_info {
+		const char *help_help;	/* Print help and exit help description.  */
+		const char *version_help;	/* Print version and exit help description.  */
+		int fg_flag;	/* Run in foreground (default=off).  */
+		const char *fg_help;	/* Run in foreground help description.  */
+		int debug_flag;	/* Run in debug mode (default=off).  */
+		const char *debug_help;	/* Run in debug mode help description.  */
+		char *conf_arg;	/* Read configuration file (default='/etc/ggsn.conf').  */
+		char *conf_orig;	/* Read configuration file original value given at command line.  */
+		const char *conf_help;	/* Read configuration file help description.  */
+		char *pidfile_arg;	/* Filename of process id file (default='/var/run/ggsn.pid').  */
+		char *pidfile_orig;	/* Filename of process id file original value given at command line.  */
+		const char *pidfile_help;	/* Filename of process id file help description.  */
+		char *statedir_arg;	/* Directory of nonvolatile data (default='/var/lib/ggsn/').  */
+		char *statedir_orig;	/* Directory of nonvolatile data original value given at command line.  */
+		const char *statedir_help;	/* Directory of nonvolatile data help description.  */
+		char *listen_arg;	/* Local interface.  */
+		char *listen_orig;	/* Local interface original value given at command line.  */
+		const char *listen_help;	/* Local interface help description.  */
+		char *net_arg;	/* Network (default='192.168.0.0/24').  */
+		char *net_orig;	/* Network original value given at command line.  */
+		const char *net_help;	/* Network help description.  */
+		char *ipup_arg;	/* Script to run after link-up.  */
+		char *ipup_orig;	/* Script to run after link-up original value given at command line.  */
+		const char *ipup_help;	/* Script to run after link-up help description.  */
+		char *ipdown_arg;	/* Script to run after link-down.  */
+		char *ipdown_orig;	/* Script to run after link-down original value given at command line.  */
+		const char *ipdown_help;	/* Script to run after link-down help description.  */
+		char *dynip_arg;	/* Dynamic IP address pool.  */
+		char *dynip_orig;	/* Dynamic IP address pool original value given at command line.  */
+		const char *dynip_help;	/* Dynamic IP address pool help description.  */
+		char *statip_arg;	/* Static IP address pool.  */
+		char *statip_orig;	/* Static IP address pool original value given at command line.  */
+		const char *statip_help;	/* Static IP address pool help description.  */
+		char *pcodns1_arg;	/* PCO DNS Server 1 (default='0.0.0.0').  */
+		char *pcodns1_orig;	/* PCO DNS Server 1 original value given at command line.  */
+		const char *pcodns1_help;	/* PCO DNS Server 1 help description.  */
+		char *pcodns2_arg;	/* PCO DNS Server 2 (default='0.0.0.0').  */
+		char *pcodns2_orig;	/* PCO DNS Server 2 original value given at command line.  */
+		const char *pcodns2_help;	/* PCO DNS Server 2 help description.  */
+		int timelimit_arg;	/* Exit after timelimit seconds (default='0').  */
+		char *timelimit_orig;	/* Exit after timelimit seconds original value given at command line.  */
+		const char *timelimit_help;	/* Exit after timelimit seconds help description.  */
+		char *apn_arg;	/* Access point name (default='internet').  */
+		char *apn_orig;	/* Access point name original value given at command line.  */
+		const char *apn_help;	/* Access point name help description.  */
+		int qos_arg;	/* Requested quality of service (default='0x0b921f').  */
+		char *qos_orig;	/* Requested quality of service original value given at command line.  */
+		const char *qos_help;	/* Requested quality of service help description.  */
 
-} ;
+		int help_given;	/* Whether help was given.  */
+		int version_given;	/* Whether version was given.  */
+		int fg_given;	/* Whether fg was given.  */
+		int debug_given;	/* Whether debug was given.  */
+		int conf_given;	/* Whether conf was given.  */
+		int pidfile_given;	/* Whether pidfile was given.  */
+		int statedir_given;	/* Whether statedir was given.  */
+		int listen_given;	/* Whether listen was given.  */
+		int net_given;	/* Whether net was given.  */
+		int ipup_given;	/* Whether ipup was given.  */
+		int ipdown_given;	/* Whether ipdown was given.  */
+		int dynip_given;	/* Whether dynip was given.  */
+		int statip_given;	/* Whether statip was given.  */
+		int pcodns1_given;	/* Whether pcodns1 was given.  */
+		int pcodns2_given;	/* Whether pcodns2 was given.  */
+		int timelimit_given;	/* Whether timelimit was given.  */
+		int apn_given;	/* Whether apn was given.  */
+		int qos_given;	/* Whether qos was given.  */
 
-extern const char *gengetopt_args_info_purpose;
-extern const char *gengetopt_args_info_usage;
-extern const char *gengetopt_args_info_help[];
+	};
 
-int cmdline_parser (int argc, char * const *argv,
-  struct gengetopt_args_info *args_info);
-int cmdline_parser2 (int argc, char * const *argv,
-  struct gengetopt_args_info *args_info,
-  int override, int initialize, int check_required);
-int cmdline_parser_file_save(const char *filename,
-  struct gengetopt_args_info *args_info);
+	extern const char *gengetopt_args_info_purpose;
+	extern const char *gengetopt_args_info_usage;
+	extern const char *gengetopt_args_info_help[];
 
-void cmdline_parser_print_help(void);
-void cmdline_parser_print_version(void);
+	int cmdline_parser(int argc, char *const *argv,
+			   struct gengetopt_args_info *args_info);
+	int cmdline_parser2(int argc, char *const *argv,
+			    struct gengetopt_args_info *args_info,
+			    int override, int initialize, int check_required);
+	int cmdline_parser_file_save(const char *filename,
+				     struct gengetopt_args_info *args_info);
 
-void cmdline_parser_init (struct gengetopt_args_info *args_info);
-void cmdline_parser_free (struct gengetopt_args_info *args_info);
+	void cmdline_parser_print_help(void);
+	void cmdline_parser_print_version(void);
 
-int cmdline_parser_configfile (char * const filename,
-  struct gengetopt_args_info *args_info,
-  int override, int initialize, int check_required);
+	void cmdline_parser_init(struct gengetopt_args_info *args_info);
+	void cmdline_parser_free(struct gengetopt_args_info *args_info);
 
-int cmdline_parser_required (struct gengetopt_args_info *args_info,
-  const char *prog_name);
+	int cmdline_parser_configfile(char *const filename,
+				      struct gengetopt_args_info *args_info,
+				      int override, int initialize,
+				      int check_required);
 
+	int cmdline_parser_required(struct gengetopt_args_info *args_info,
+				    const char *prog_name);
 
 #ifdef __cplusplus
 }
-#endif /* __cplusplus */
-#endif /* CMDLINE_H */
+#endif				/* __cplusplus */
+#endif				/* CMDLINE_H */
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 9e0b597..1152519 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -39,7 +39,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <sys/socket.h>  
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
 
@@ -55,507 +55,539 @@
 #include "cmdline.h"
 
 int end = 0;
-int maxfd = 0;	                /* For select()            */
+int maxfd = 0;			/* For select()            */
 
 struct in_addr listen_;
-struct in_addr netaddr, destaddr, net, mask;  /* Network interface       */
-struct in_addr dns1, dns2;      /* PCO DNS address         */
-char *ipup, *ipdown;            /* Filename of scripts     */
-int debug;                      /* Print debug output      */
+struct in_addr netaddr, destaddr, net, mask;	/* Network interface       */
+struct in_addr dns1, dns2;	/* PCO DNS address         */
+char *ipup, *ipdown;		/* Filename of scripts     */
+int debug;			/* Print debug output      */
 struct ul255_t pco;
 struct ul255_t qos;
 struct ul255_t apn;
 
-struct gsn_t *gsn;              /* GSN instance            */
-struct tun_t *tun;              /* TUN instance            */
-struct ippool_t *ippool;        /* Pool of IP addresses    */
+struct gsn_t *gsn;		/* GSN instance            */
+struct tun_t *tun;		/* TUN instance            */
+struct ippool_t *ippool;	/* Pool of IP addresses    */
 
 /* To exit gracefully. Used with GCC compilation flag -pg and gprof */
-void signal_handler(int s) {
-  if (debug) printf("Received signal %d, exiting.\n", s);
-  end = 1;
+void signal_handler(int s)
+{
+	if (debug)
+		printf("Received signal %d, exiting.\n", s);
+	end = 1;
 }
 
 /* Used to write process ID to file. Assume someone else will delete */
-void log_pid(char *pidfile) {
-  FILE *file;
-  mode_t oldmask;
-  
-  oldmask = umask(022);
-  file = fopen(pidfile, "w");
-  umask(oldmask);
-  if(!file) {
-    sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	    "Failed to create process ID file: %s!", pidfile);
-    return;
-  }
-  fprintf(file, "%d\n", (int) getpid());
-  fclose(file);
+void log_pid(char *pidfile)
+{
+	FILE *file;
+	mode_t oldmask;
+
+	oldmask = umask(022);
+	file = fopen(pidfile, "w");
+	umask(oldmask);
+	if (!file) {
+		sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+			"Failed to create process ID file: %s!", pidfile);
+		return;
+	}
+	fprintf(file, "%d\n", (int)getpid());
+	fclose(file);
 }
 
 #if defined(__sun__)
-int daemon(int nochdir, int noclose) {
-  int fd;
+int daemon(int nochdir, int noclose)
+{
+	int fd;
 
-  switch (fork()) {
-  case -1:
-    return (-1);
-  case 0:
-    break;
-  default:
-    _exit(0);
-  }
+	switch (fork()) {
+	case -1:
+		return (-1);
+	case 0:
+		break;
+	default:
+		_exit(0);
+	}
 
-  if (setsid() == -1)
-    return (-1);
-  
-  if (!nochdir) chdir("/");
+	if (setsid() == -1)
+		return (-1);
 
-  if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
-    dup2(fd, STDIN_FILENO);
-    dup2(fd, STDOUT_FILENO);
-    dup2(fd, STDERR_FILENO);
-    if (fd > 2) close (fd);
-  }
-  return (0);
+	if (!nochdir)
+		chdir("/");
+
+	if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
+		dup2(fd, STDIN_FILENO);
+		dup2(fd, STDOUT_FILENO);
+		dup2(fd, STDERR_FILENO);
+		if (fd > 2)
+			close(fd);
+	}
+	return (0);
 }
 #endif
 
-
 int encaps_printf(void *p, void *packet, unsigned len)
 {
-  unsigned int i;
-  if (debug) {
-    printf("The packet looks like this:\n");
-    for( i=0; i<len; i++) {
-      printf("%02x ", (unsigned char)*(char *)(packet+i));
-      if (!((i+1)%16)) printf("\n");
-    };
-    printf("\n"); 
-  }
-  return 0;
+	unsigned int i;
+	if (debug) {
+		printf("The packet looks like this:\n");
+		for (i = 0; i < len; i++) {
+			printf("%02x ", (unsigned char)*(char *)(packet + i));
+			if (!((i + 1) % 16))
+				printf("\n");
+		};
+		printf("\n");
+	}
+	return 0;
 }
 
-int delete_context(struct pdp_t *pdp) {
-  if (debug) printf("Deleting PDP context\n");
-  if (pdp->peer)
-    ippool_freeip(ippool, (struct ippoolm_t *) pdp->peer);
-  else
-    sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Peer not defined!");
-  return 0;
+int delete_context(struct pdp_t *pdp)
+{
+	if (debug)
+		printf("Deleting PDP context\n");
+	if (pdp->peer)
+		ippool_freeip(ippool, (struct ippoolm_t *)pdp->peer);
+	else
+		sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Peer not defined!");
+	return 0;
 }
 
+int create_context_ind(struct pdp_t *pdp)
+{
+	struct in_addr addr;
+	struct ippoolm_t *member;
 
-int create_context_ind(struct pdp_t *pdp) {
-  struct in_addr addr;
-  struct ippoolm_t *member;
+	if (debug)
+		printf("Received create PDP context request\n");
 
-  if (debug) printf("Received create PDP context request\n");
+	pdp->eua.l = 0;		/* TODO: Indicates dynamic IP */
 
-  pdp->eua.l=0; /* TODO: Indicates dynamic IP */
+	/* ulcpy(&pdp->qos_neg, &pdp->qos_req, sizeof(pdp->qos_req.v)); */
+	memcpy(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0));
+	memcpy(&pdp->pco_neg, &pco, sizeof(pdp->pco_neg));
 
-  /* ulcpy(&pdp->qos_neg, &pdp->qos_req, sizeof(pdp->qos_req.v)); */
-  memcpy(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0));
-  memcpy(&pdp->pco_neg, &pco, sizeof(pdp->pco_neg));
+	memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l);	/* TODO */
+	pdp->qos_neg.l = pdp->qos_req.l;
 
-  memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */
-  pdp->qos_neg.l = pdp->qos_req.l;
-  
-  if (pdp_euaton(&pdp->eua, &addr)) {
-    addr.s_addr = 0; /* Request dynamic */
-  }
+	if (pdp_euaton(&pdp->eua, &addr)) {
+		addr.s_addr = 0;	/* Request dynamic */
+	}
 
-  if (ippool_newip(ippool, &member, &addr, 0)) {
-    gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES);
-    return 0; /* Allready in use, or no more available */
-  }
+	if (ippool_newip(ippool, &member, &addr, 0)) {
+		gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES);
+		return 0;	/* Allready in use, or no more available */
+	}
 
-  pdp_ntoeua(&member->addr, &pdp->eua);
-  pdp->peer = member;
-  pdp->ipif = tun; /* TODO */
-  member->peer = pdp;
+	pdp_ntoeua(&member->addr, &pdp->eua);
+	pdp->peer = member;
+	pdp->ipif = tun;	/* TODO */
+	member->peer = pdp;
 
-  gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ);
-  return 0; /* Success */
+	gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ);
+	return 0;		/* Success */
 }
 
-
 /* Callback for receiving messages from tun */
-int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) {
-  struct ippoolm_t *ipm;
-  struct in_addr dst;
-  struct tun_packet_t *iph = (struct tun_packet_t*) pack;
-  
-  dst.s_addr = iph->dst;
+int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len)
+{
+	struct ippoolm_t *ipm;
+	struct in_addr dst;
+	struct tun_packet_t *iph = (struct tun_packet_t *)pack;
 
-  if (debug) printf("Received packet from tun!\n");
+	dst.s_addr = iph->dst;
 
-  if (ippool_getip(ippool, &ipm, &dst)) {
-    if (debug) printf("Received packet with no destination!!!\n");
-    return 0;
-  }
-  
-  if (ipm->peer) /* Check if a peer protocol is defined */
-    gtp_data_req(gsn, (struct pdp_t*) ipm->peer, pack, len);
-  return 0;
+	if (debug)
+		printf("Received packet from tun!\n");
+
+	if (ippool_getip(ippool, &ipm, &dst)) {
+		if (debug)
+			printf("Received packet with no destination!!!\n");
+		return 0;
+	}
+
+	if (ipm->peer)		/* Check if a peer protocol is defined */
+		gtp_data_req(gsn, (struct pdp_t *)ipm->peer, pack, len);
+	return 0;
 }
 
-int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) {
-  if (debug) printf("encaps_tun. Packet received: forwarding to tun\n");
-  return tun_encaps((struct tun_t*) pdp->ipif, pack, len);
+int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len)
+{
+	if (debug)
+		printf("encaps_tun. Packet received: forwarding to tun\n");
+	return tun_encaps((struct tun_t *)pdp->ipif, pack, len);
 }
 
-
 int main(int argc, char **argv)
 {
-  /* gengeopt declarations */
-  struct gengetopt_args_info args_info;
+	/* gengeopt declarations */
+	struct gengetopt_args_info args_info;
 
-  struct hostent *host;
+	struct hostent *host;
 
-  /* Handle keyboard interrupt SIGINT */
-  struct sigaction s;
-  s.sa_handler = (void *) signal_handler;
-  if ((0 != sigemptyset( &s.sa_mask )) && debug)
-    printf("sigemptyset failed.\n");
-  s.sa_flags = SA_RESETHAND;
-  if ((sigaction(SIGINT, &s, NULL) != 0) && debug)
-    printf("Could not register SIGINT signal handler.\n");
-	
-  fd_set fds;			/* For select() */
-  struct timeval idleTime;	/* How long to select() */
+	/* Handle keyboard interrupt SIGINT */
+	struct sigaction s;
+	s.sa_handler = (void *)signal_handler;
+	if ((0 != sigemptyset(&s.sa_mask)) && debug)
+		printf("sigemptyset failed.\n");
+	s.sa_flags = SA_RESETHAND;
+	if ((sigaction(SIGINT, &s, NULL) != 0) && debug)
+		printf("Could not register SIGINT signal handler.\n");
 
+	fd_set fds;		/* For select() */
+	struct timeval idleTime;	/* How long to select() */
 
-  int timelimit; /* Number of seconds to be connected */
-  int starttime; /* Time program was started */
+	int timelimit;		/* Number of seconds to be connected */
+	int starttime;		/* Time program was started */
 
-  /* open a connection to the syslog daemon */
-  /*openlog(PACKAGE, LOG_PID, LOG_DAEMON);*/
+	/* open a connection to the syslog daemon */
+	/*openlog(PACKAGE, LOG_PID, LOG_DAEMON); */
 
-  /* TODO: Only use LOG__PERROR for linux */
+	/* TODO: Only use LOG__PERROR for linux */
 #ifdef __linux__
-  openlog(PACKAGE, (LOG_PID | LOG_PERROR), LOG_DAEMON);
+	openlog(PACKAGE, (LOG_PID | LOG_PERROR), LOG_DAEMON);
 #else
-  openlog(PACKAGE, (LOG_PID), LOG_DAEMON);
+	openlog(PACKAGE, (LOG_PID), LOG_DAEMON);
 #endif
 
+	if (cmdline_parser(argc, argv, &args_info) != 0)
+		exit(1);
+	if (args_info.debug_flag) {
+		printf("listen: %s\n", args_info.listen_arg);
+		if (args_info.conf_arg)
+			printf("conf: %s\n", args_info.conf_arg);
+		printf("fg: %d\n", args_info.fg_flag);
+		printf("debug: %d\n", args_info.debug_flag);
+		printf("qos: %#08x\n", args_info.qos_arg);
+		if (args_info.apn_arg)
+			printf("apn: %s\n", args_info.apn_arg);
+		if (args_info.net_arg)
+			printf("net: %s\n", args_info.net_arg);
+		if (args_info.dynip_arg)
+			printf("dynip: %s\n", args_info.dynip_arg);
+		if (args_info.statip_arg)
+			printf("statip: %s\n", args_info.statip_arg);
+		if (args_info.ipup_arg)
+			printf("ipup: %s\n", args_info.ipup_arg);
+		if (args_info.ipdown_arg)
+			printf("ipdown: %s\n", args_info.ipdown_arg);
+		if (args_info.pidfile_arg)
+			printf("pidfile: %s\n", args_info.pidfile_arg);
+		if (args_info.statedir_arg)
+			printf("statedir: %s\n", args_info.statedir_arg);
+		printf("timelimit: %d\n", args_info.timelimit_arg);
+	}
 
-  if (cmdline_parser (argc, argv, &args_info) != 0)
-    exit(1);
-  if (args_info.debug_flag) {
-    printf("listen: %s\n", args_info.listen_arg);
-    if (args_info.conf_arg) printf("conf: %s\n", args_info.conf_arg);
-    printf("fg: %d\n", args_info.fg_flag);
-    printf("debug: %d\n", args_info.debug_flag);
-    printf("qos: %#08x\n", args_info.qos_arg);
-    if (args_info.apn_arg) printf("apn: %s\n", args_info.apn_arg);
-    if (args_info.net_arg) printf("net: %s\n", args_info.net_arg);
-    if (args_info.dynip_arg) printf("dynip: %s\n", args_info.dynip_arg);
-    if (args_info.statip_arg) printf("statip: %s\n", args_info.statip_arg);
-    if (args_info.ipup_arg) printf("ipup: %s\n", args_info.ipup_arg);
-    if (args_info.ipdown_arg) printf("ipdown: %s\n", args_info.ipdown_arg);
-    if (args_info.pidfile_arg) printf("pidfile: %s\n", args_info.pidfile_arg);
-    if (args_info.statedir_arg) printf("statedir: %s\n", args_info.statedir_arg);
-    printf("timelimit: %d\n", args_info.timelimit_arg);
-  }
+	/* Try out our new parser */
 
-  /* Try out our new parser */
-  
-  if (cmdline_parser_configfile (args_info.conf_arg, &args_info, 0, 0, 0) != 0)
-    exit(1);
-  if (args_info.debug_flag) {
-    printf("cmdline_parser_configfile\n");
-    printf("listen: %s\n", args_info.listen_arg);
-    printf("conf: %s\n", args_info.conf_arg);
-    printf("fg: %d\n", args_info.fg_flag);
-    printf("debug: %d\n", args_info.debug_flag);
-    printf("qos: %#08x\n", args_info.qos_arg);
-    if (args_info.apn_arg) printf("apn: %s\n", args_info.apn_arg);
-    if (args_info.net_arg) printf("net: %s\n", args_info.net_arg);
-    if (args_info.dynip_arg) printf("dynip: %s\n", args_info.dynip_arg);
-    if (args_info.statip_arg) printf("statip: %s\n", args_info.statip_arg);
-    if (args_info.ipup_arg) printf("ipup: %s\n", args_info.ipup_arg);
-    if (args_info.ipdown_arg) printf("ipdown: %s\n", args_info.ipdown_arg);
-    if (args_info.pidfile_arg) printf("pidfile: %s\n", args_info.pidfile_arg);
-    if (args_info.statedir_arg) printf("statedir: %s\n", args_info.statedir_arg);
-    printf("timelimit: %d\n", args_info.timelimit_arg);
-  }
+	if (cmdline_parser_configfile(args_info.conf_arg, &args_info, 0, 0, 0)
+	    != 0)
+		exit(1);
+	if (args_info.debug_flag) {
+		printf("cmdline_parser_configfile\n");
+		printf("listen: %s\n", args_info.listen_arg);
+		printf("conf: %s\n", args_info.conf_arg);
+		printf("fg: %d\n", args_info.fg_flag);
+		printf("debug: %d\n", args_info.debug_flag);
+		printf("qos: %#08x\n", args_info.qos_arg);
+		if (args_info.apn_arg)
+			printf("apn: %s\n", args_info.apn_arg);
+		if (args_info.net_arg)
+			printf("net: %s\n", args_info.net_arg);
+		if (args_info.dynip_arg)
+			printf("dynip: %s\n", args_info.dynip_arg);
+		if (args_info.statip_arg)
+			printf("statip: %s\n", args_info.statip_arg);
+		if (args_info.ipup_arg)
+			printf("ipup: %s\n", args_info.ipup_arg);
+		if (args_info.ipdown_arg)
+			printf("ipdown: %s\n", args_info.ipdown_arg);
+		if (args_info.pidfile_arg)
+			printf("pidfile: %s\n", args_info.pidfile_arg);
+		if (args_info.statedir_arg)
+			printf("statedir: %s\n", args_info.statedir_arg);
+		printf("timelimit: %d\n", args_info.timelimit_arg);
+	}
 
-  /* Handle each option */
+	/* Handle each option */
 
-  /* debug                                                        */
-  debug = args_info.debug_flag;
+	/* debug                                                        */
+	debug = args_info.debug_flag;
 
-  /* listen                                                       */
-  /* Do hostname lookup to translate hostname to IP address       */
-  /* Any port listening is not possible as a valid address is     */
-  /* required for create_pdp_context_response messages            */
-  if (args_info.listen_arg) {
-    if (!(host = gethostbyname(args_info.listen_arg))) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Invalid listening address: %s!", args_info.listen_arg);
-      exit(1);
-    }
-    else {
-      memcpy(&listen_.s_addr, host->h_addr, host->h_length);
-    }
-  }
-  else {
-    sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	    "Listening address must be specified! "
-	    "Please use command line option --listen or "
-	    "edit %s configuration file\n", args_info.conf_arg);
-    exit(1);
-  }
-  
+	/* listen                                                       */
+	/* Do hostname lookup to translate hostname to IP address       */
+	/* Any port listening is not possible as a valid address is     */
+	/* required for create_pdp_context_response messages            */
+	if (args_info.listen_arg) {
+		if (!(host = gethostbyname(args_info.listen_arg))) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Invalid listening address: %s!",
+				args_info.listen_arg);
+			exit(1);
+		} else {
+			memcpy(&listen_.s_addr, host->h_addr, host->h_length);
+		}
+	} else {
+		sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+			"Listening address must be specified! "
+			"Please use command line option --listen or "
+			"edit %s configuration file\n", args_info.conf_arg);
+		exit(1);
+	}
 
-  /* net                                                          */
-  /* Store net as in_addr net and mask                            */
-  if (args_info.net_arg) {
-    if(ippool_aton(&net, &mask, args_info.net_arg, 0)) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Invalid network address: %s!", args_info.net_arg);
-      exit(1);
-    }
-    netaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
-    destaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
-  }
-  else {
-    sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	    "Network address must be specified: %s!", args_info.net_arg);
-    exit(1);
-  }
+	/* net                                                          */
+	/* Store net as in_addr net and mask                            */
+	if (args_info.net_arg) {
+		if (ippool_aton(&net, &mask, args_info.net_arg, 0)) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Invalid network address: %s!",
+				args_info.net_arg);
+			exit(1);
+		}
+		netaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
+		destaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
+	} else {
+		sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+			"Network address must be specified: %s!",
+			args_info.net_arg);
+		exit(1);
+	}
 
-  /* dynip                                                        */
-  if (!args_info.dynip_arg) {
-    if (ippool_new(&ippool, args_info.net_arg, NULL, 1, 0,
-		   IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Failed to allocate IP pool!");
-      exit(1);
-    }
-  }
-  else {
-    if (ippool_new(&ippool, args_info.dynip_arg, NULL, 1 ,0,
-		   IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Failed to allocate IP pool!");
-      exit(1);
-    }
-  }
+	/* dynip                                                        */
+	if (!args_info.dynip_arg) {
+		if (ippool_new(&ippool, args_info.net_arg, NULL, 1, 0,
+			       IPPOOL_NONETWORK | IPPOOL_NOGATEWAY |
+			       IPPOOL_NOBROADCAST)) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Failed to allocate IP pool!");
+			exit(1);
+		}
+	} else {
+		if (ippool_new(&ippool, args_info.dynip_arg, NULL, 1, 0,
+			       IPPOOL_NONETWORK | IPPOOL_NOGATEWAY |
+			       IPPOOL_NOBROADCAST)) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Failed to allocate IP pool!");
+			exit(1);
+		}
+	}
 
-  /* DNS1 and DNS2 */
+	/* DNS1 and DNS2 */
 #ifdef HAVE_INET_ATON
-  dns1.s_addr = 0;
-  if (args_info.pcodns1_arg) {
-    if (0 == inet_aton(args_info.pcodns1_arg, &dns1)) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Failed to convert pcodns1!");
-      exit(1);
-    }
-  }
-  dns2.s_addr = 0;
-  if (args_info.pcodns2_arg) {
-    if (0 == inet_aton(args_info.pcodns2_arg, &dns2)) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Failed to convert pcodns2!");
-      exit(1);
-    }
-  }
+	dns1.s_addr = 0;
+	if (args_info.pcodns1_arg) {
+		if (0 == inet_aton(args_info.pcodns1_arg, &dns1)) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Failed to convert pcodns1!");
+			exit(1);
+		}
+	}
+	dns2.s_addr = 0;
+	if (args_info.pcodns2_arg) {
+		if (0 == inet_aton(args_info.pcodns2_arg, &dns2)) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Failed to convert pcodns2!");
+			exit(1);
+		}
+	}
 #else
-  dns1.s_addr = 0;
-  if (args_info.pcodns1_arg) {
-    dns1.s_addr = inet_addr(args_info.pcodns1_arg);
-    if (dns1.s_addr == -1)  {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Failed to convert pcodns1!");
-      exit(1);
-    }
-  }
-  dns2.s_addr = 0;
-  if (args_info.pcodns2_arg) {
-    dns2.s_addr = inet_addr(args_info.pcodns2_arg);
-    if (dns2.s_addr == -1) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "Failed to convert pcodns2!");
-      exit(1);
-    }
-  }
+	dns1.s_addr = 0;
+	if (args_info.pcodns1_arg) {
+		dns1.s_addr = inet_addr(args_info.pcodns1_arg);
+		if (dns1.s_addr == -1) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Failed to convert pcodns1!");
+			exit(1);
+		}
+	}
+	dns2.s_addr = 0;
+	if (args_info.pcodns2_arg) {
+		dns2.s_addr = inet_addr(args_info.pcodns2_arg);
+		if (dns2.s_addr == -1) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"Failed to convert pcodns2!");
+			exit(1);
+		}
+	}
 #endif
 
+	pco.l = 20;
+	pco.v[0] = 0x80;	/* x0000yyy x=1, yyy=000: PPP */
+	pco.v[1] = 0x80;	/* IPCP */
+	pco.v[2] = 0x21;
+	pco.v[3] = 0x10;	/* Length of contents */
+	pco.v[4] = 0x02;	/* ACK */
+	pco.v[5] = 0x00;	/* ID: Need to match request */
+	pco.v[6] = 0x00;	/* Length */
+	pco.v[7] = 0x10;
+	pco.v[8] = 0x81;	/* DNS 1 */
+	pco.v[9] = 0x06;
+	memcpy(&pco.v[10], &dns1, sizeof(dns1));
+	pco.v[14] = 0x83;
+	pco.v[15] = 0x06;	/* DNS 2 */
+	memcpy(&pco.v[16], &dns2, sizeof(dns2));
 
-  pco.l = 20;
-  pco.v[0] = 0x80; /* x0000yyy x=1, yyy=000: PPP */
-  pco.v[1] = 0x80; /* IPCP */
-  pco.v[2] = 0x21; 
-  pco.v[3] = 0x10; /* Length of contents */
-  pco.v[4] = 0x02; /* ACK */
-  pco.v[5] = 0x00; /* ID: Need to match request */
-  pco.v[6] = 0x00; /* Length */
-  pco.v[7] = 0x10;
-  pco.v[8] = 0x81; /* DNS 1 */
-  pco.v[9] = 0x06;
-  memcpy(&pco.v[10], &dns1, sizeof(dns1));
-  pco.v[14] = 0x83;
-  pco.v[15] = 0x06; /* DNS 2 */
-  memcpy(&pco.v[16], &dns2, sizeof(dns2));
+	/* ipup */
+	ipup = args_info.ipup_arg;
 
-  /* ipup */
-  ipup = args_info.ipup_arg;
+	/* ipdown */
+	ipdown = args_info.ipdown_arg;
 
-  /* ipdown */
-  ipdown = args_info.ipdown_arg;
+	/* Timelimit                                                       */
+	timelimit = args_info.timelimit_arg;
+	starttime = time(NULL);
 
-  /* Timelimit                                                       */
-  timelimit = args_info.timelimit_arg;
-  starttime = time(NULL);
-  
-  /* qos                                                             */
-  qos.l = 3;
-  qos.v[2] = (args_info.qos_arg) & 0xff;
-  qos.v[1] = ((args_info.qos_arg) >> 8) & 0xff;
-  qos.v[0] = ((args_info.qos_arg) >> 16) & 0xff;
+	/* qos                                                             */
+	qos.l = 3;
+	qos.v[2] = (args_info.qos_arg) & 0xff;
+	qos.v[1] = ((args_info.qos_arg) >> 8) & 0xff;
+	qos.v[0] = ((args_info.qos_arg) >> 16) & 0xff;
 
-  /* apn                                                             */
-  if (strlen(args_info.apn_arg) > (sizeof(apn.v)-1)) {
-    printf("Invalid APN\n");
-    return -1;
-  }
-  apn.l = strlen(args_info.apn_arg) + 1;
-  apn.v[0] = (char) strlen(args_info.apn_arg);
-  strncpy((char *) &apn.v[1], args_info.apn_arg, sizeof(apn.v)-1);
+	/* apn                                                             */
+	if (strlen(args_info.apn_arg) > (sizeof(apn.v) - 1)) {
+		printf("Invalid APN\n");
+		return -1;
+	}
+	apn.l = strlen(args_info.apn_arg) + 1;
+	apn.v[0] = (char)strlen(args_info.apn_arg);
+	strncpy((char *)&apn.v[1], args_info.apn_arg, sizeof(apn.v) - 1);
 
+	/* foreground                                                   */
+	/* If flag not given run as a daemon                            */
+	if (!args_info.fg_flag) {
+		FILE *f;
+		int rc;
+		closelog();
+		/* Close the standard file descriptors. */
+		/* Is this really needed ? */
+		f = freopen("/dev/null", "w", stdout);
+		if (f == NULL) {
+			sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
+				"Could not redirect stdout to /dev/null");
+		}
+		f = freopen("/dev/null", "w", stderr);
+		if (f == NULL) {
+			sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
+				"Could not redirect stderr to /dev/null");
+		}
+		f = freopen("/dev/null", "r", stdin);
+		if (f == NULL) {
+			sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
+				"Could not redirect stdin to /dev/null");
+		}
+		rc = daemon(0, 0);
+		if (rc != 0) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, rc,
+				"Could not daemonize");
+			exit(1);
+		}
+		/* Open log again. This time with new pid */
+		openlog(PACKAGE, LOG_PID, LOG_DAEMON);
+	}
 
-  /* foreground                                                   */
-  /* If flag not given run as a daemon                            */
-  if (!args_info.fg_flag)
-    {
-      FILE *f;
-      int rc;
-      closelog(); 
-      /* Close the standard file descriptors. */
-      /* Is this really needed ? */
-      f = freopen("/dev/null", "w", stdout);
-      if (f == NULL) {
-        sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
-          "Could not redirect stdout to /dev/null");
-      }
-      f = freopen("/dev/null", "w", stderr);
-      if (f == NULL) {
-        sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
-          "Could not redirect stderr to /dev/null");
-      }
-      f = freopen("/dev/null", "r", stdin);
-      if (f == NULL) {
-        sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
-          "Could not redirect stdin to /dev/null");
-      }
-      rc = daemon(0, 0);
-      if (rc != 0) {
-        sys_err(LOG_ERR, __FILE__, __LINE__, rc, "Could not daemonize");
-        exit(1);
-      }
-      /* Open log again. This time with new pid */
-      openlog(PACKAGE, LOG_PID, LOG_DAEMON);
-    }
+	/* pidfile */
+	/* This has to be done after we have our final pid */
+	if (args_info.pidfile_arg) {
+		log_pid(args_info.pidfile_arg);
+	}
 
-  /* pidfile */
-  /* This has to be done after we have our final pid */
-  if (args_info.pidfile_arg) {
-    log_pid(args_info.pidfile_arg);
-  }
-  
+	if (debug)
+		printf("gtpclient: Initialising GTP tunnel\n");
 
-  if (debug) printf("gtpclient: Initialising GTP tunnel\n");
-  
-  if (gtp_new(&gsn, args_info.statedir_arg,  &listen_, GTP_MODE_GGSN)) {
-    sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	    "Failed to create gtp");
-    exit(1);
-  }
-  if (gsn->fd0 > maxfd) maxfd = gsn->fd0;
-  if (gsn->fd1c > maxfd) maxfd = gsn->fd1c;
-  if (gsn->fd1u > maxfd) maxfd = gsn->fd1u;
+	if (gtp_new(&gsn, args_info.statedir_arg, &listen_, GTP_MODE_GGSN)) {
+		sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to create gtp");
+		exit(1);
+	}
+	if (gsn->fd0 > maxfd)
+		maxfd = gsn->fd0;
+	if (gsn->fd1c > maxfd)
+		maxfd = gsn->fd1c;
+	if (gsn->fd1u > maxfd)
+		maxfd = gsn->fd1u;
 
-  gtp_set_cb_data_ind(gsn, encaps_tun);
-  gtp_set_cb_delete_context(gsn, delete_context);
-  gtp_set_cb_create_context_ind(gsn, create_context_ind);
+	gtp_set_cb_data_ind(gsn, encaps_tun);
+	gtp_set_cb_delete_context(gsn, delete_context);
+	gtp_set_cb_create_context_ind(gsn, create_context_ind);
 
+	/* Create a tunnel interface */
+	if (debug)
+		printf("Creating tun interface\n");
+	if (tun_new((struct tun_t **)&tun)) {
+		sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to create tun");
+		if (debug)
+			printf("Failed to create tun\n");
+		exit(1);
+	}
 
-  /* Create a tunnel interface */
-  if (debug) printf("Creating tun interface\n");
-  if (tun_new((struct tun_t**) &tun)) {
-    sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	    "Failed to create tun");
-    if (debug) printf("Failed to create tun\n");
-    exit(1);
-  }
+	if (debug)
+		printf("Setting tun IP address\n");
+	if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) {
+		sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+			"Failed to set tun IP address");
+		if (debug)
+			printf("Failed to set tun IP address\n");
+		exit(1);
+	}
 
-  if (debug) printf("Setting tun IP address\n");
-  if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) {
-    sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	    "Failed to set tun IP address");
-    if (debug) printf("Failed to set tun IP address\n");
-    exit(1);
-  }
+	tun_set_cb_ind(tun, cb_tun_ind);
+	if (tun->fd > maxfd)
+		maxfd = tun->fd;
 
-
-  tun_set_cb_ind(tun, cb_tun_ind);
-  if (tun->fd > maxfd) maxfd = tun->fd;
-  
-  if (ipup) tun_runscript(tun, ipup);
+	if (ipup)
+		tun_runscript(tun, ipup);
 
   /******************************************************************/
-  /* Main select loop                                               */
+	/* Main select loop                                               */
   /******************************************************************/
 
-  while ((((starttime + timelimit) > time(NULL)) || (0 == timelimit)) && (!end)) {
+	while ((((starttime + timelimit) > time(NULL)) || (0 == timelimit))
+	       && (!end)) {
 
-    FD_ZERO(&fds);
-    if (tun) FD_SET(tun->fd, &fds);
-    FD_SET(gsn->fd0, &fds);
-    FD_SET(gsn->fd1c, &fds);
-    FD_SET(gsn->fd1u, &fds);
-    
-    gtp_retranstimeout(gsn, &idleTime);
-    switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) {
-    case -1:	/* errno == EINTR : unblocked signal */
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "select() returned -1");
-      /* On error, select returns without modifying fds */
-      FD_ZERO(&fds);
-      break;  
-    case 0:
-      /* printf("Select returned 0\n"); */
-      gtp_retrans(gsn); /* Only retransmit if nothing else */
-      break; 
-    default:
-      break;
-    }
+		FD_ZERO(&fds);
+		if (tun)
+			FD_SET(tun->fd, &fds);
+		FD_SET(gsn->fd0, &fds);
+		FD_SET(gsn->fd1c, &fds);
+		FD_SET(gsn->fd1u, &fds);
 
-    if (tun->fd != -1 && FD_ISSET(tun->fd, &fds) && 
-	tun_decaps(tun) < 0) {
-      sys_err(LOG_ERR, __FILE__, __LINE__, 0,
-	      "TUN read failed (fd)=(%d)", tun->fd);
-    }
-    
-    if (FD_ISSET(gsn->fd0, &fds))
-      gtp_decaps0(gsn);
-    
-    if (FD_ISSET(gsn->fd1c, &fds))
-      gtp_decaps1c(gsn);
-    
-    if (FD_ISSET(gsn->fd1u, &fds))
-      gtp_decaps1u(gsn);
-    
-  }
+		gtp_retranstimeout(gsn, &idleTime);
+		switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) {
+		case -1:	/* errno == EINTR : unblocked signal */
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"select() returned -1");
+			/* On error, select returns without modifying fds */
+			FD_ZERO(&fds);
+			break;
+		case 0:
+			/* printf("Select returned 0\n"); */
+			gtp_retrans(gsn);	/* Only retransmit if nothing else */
+			break;
+		default:
+			break;
+		}
 
-  cmdline_parser_free(&args_info);
-  ippool_free(ippool);
-  gtp_free(gsn);
-  tun_free(tun);
-  
-  return 1;
-  
+		if (tun->fd != -1 && FD_ISSET(tun->fd, &fds) &&
+		    tun_decaps(tun) < 0) {
+			sys_err(LOG_ERR, __FILE__, __LINE__, 0,
+				"TUN read failed (fd)=(%d)", tun->fd);
+		}
+
+		if (FD_ISSET(gsn->fd0, &fds))
+			gtp_decaps0(gsn);
+
+		if (FD_ISSET(gsn->fd1c, &fds))
+			gtp_decaps1c(gsn);
+
+		if (FD_ISSET(gsn->fd1u, &fds))
+			gtp_decaps1u(gsn);
+
+	}
+
+	cmdline_parser_free(&args_info);
+	ippool_free(ippool);
+	gtp_free(gsn);
+	tun_free(tun);
+
+	return 1;
+
 }
-