Support for external ipup script
diff --git a/ggsn/cmdline.c b/ggsn/cmdline.c
index ef50f7c..3c5d7e2 100644
--- a/ggsn/cmdline.c
+++ b/ggsn/cmdline.c
@@ -1,7 +1,7 @@
 /*
-  File autogenerated by gengetopt version 2.8
+  File autogenerated by gengetopt version 2.8rc
   generated with the following command:
-  gengetopt --conf-parser 
+  ../../gengetopt-2.8rc/src/gengetopt --conf-parser 
 
   The developers of gengetopt consider the fixed text that goes in all
   gengetopt output files to be in the public domain:
@@ -55,6 +55,8 @@
   printf("              --timelimit=INT    Exit after timelimit seconds (default='0')\n");
   printf("   -aSTRING   --apn=STRING       Access point name (default='internet')\n");
   printf("   -qINT      --qos=INT          Requested quality of service (default='0x0b921f')\n");
+  printf("              --ipup=STRING      Script to run after link-up\n");
+  printf("              --ipdown=STRING    Script to run after link-down\n");
 }
 
 
@@ -91,6 +93,8 @@
   args_info->timelimit_given = 0 ;
   args_info->apn_given = 0 ;
   args_info->qos_given = 0 ;
+  args_info->ipup_given = 0 ;
+  args_info->ipdown_given = 0 ;
 #define clear_args() { \
   args_info->fg_flag = 0;\
   args_info->debug_flag = 0;\
@@ -103,6 +107,8 @@
   args_info->timelimit_arg = 0 ;\
   args_info->apn_arg = strdup("internet") ;\
   args_info->qos_arg = 0x0b921f ;\
+  args_info->ipup_arg = NULL; \
+  args_info->ipdown_arg = NULL; \
 }
 
   clear_args();
@@ -130,6 +136,8 @@
         { "timelimit",	1, NULL, 0 },
         { "apn",	1, NULL, 'a' },
         { "qos",	1, NULL, 'q' },
+        { "ipup",	1, NULL, 0 },
+        { "ipdown",	1, NULL, 0 },
         { NULL,	0, NULL, 0 }
       };
 
@@ -280,6 +288,32 @@
             args_info->timelimit_arg = strtol (optarg,&stop_char,0);
             break;
           }
+          /* Script to run after link-up.  */
+          else if (strcmp (long_options[option_index].name, "ipup") == 0)
+          {
+            if (args_info->ipup_given)
+              {
+                fprintf (stderr, "%s: `--ipup' option given more than once\n", PACKAGE);
+                clear_args ();
+                exit (EXIT_FAILURE);
+              }
+            args_info->ipup_given = 1;
+            args_info->ipup_arg = strdup (optarg);
+            break;
+          }
+          /* Script to run after link-down.  */
+          else if (strcmp (long_options[option_index].name, "ipdown") == 0)
+          {
+            if (args_info->ipdown_given)
+              {
+                fprintf (stderr, "%s: `--ipdown' option given more than once\n", PACKAGE);
+                clear_args ();
+                exit (EXIT_FAILURE);
+              }
+            args_info->ipdown_given = 1;
+            args_info->ipdown_arg = strdup (optarg);
+            break;
+          }
 
         case '?':	/* Invalid option.  */
           /* `getopt_long' already printed an error message.  */
@@ -515,6 +549,38 @@
                 }
               continue;
             }
+          if (!strcmp(fopt, "ipup"))
+            {
+              if (override || !args_info->ipup_given)
+                {
+                  args_info->ipup_given = 1;
+                  if (fnum == 2)
+                    args_info->ipup_arg = strdup (farg);
+                  else
+                    {
+                      fprintf (stderr, "%s:%d: required <option_name> <option_val>\n",
+                               filename, line_num);
+                      exit (EXIT_FAILURE);
+                    }
+                }
+              continue;
+            }
+          if (!strcmp(fopt, "ipdown"))
+            {
+              if (override || !args_info->ipdown_given)
+                {
+                  args_info->ipdown_given = 1;
+                  if (fnum == 2)
+                    args_info->ipdown_arg = strdup (farg);
+                  else
+                    {
+                      fprintf (stderr, "%s:%d: required <option_name> <option_val>\n",
+                               filename, line_num);
+                      exit (EXIT_FAILURE);
+                    }
+                }
+              continue;
+            }
           
 
           /* Tried all known options. This one is unknown! */