libxtables: set names of programs

Set proper name of application.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
diff --git a/include/ip6tables.h b/include/ip6tables.h
index 86587e6..ca0f9a0 100644
--- a/include/ip6tables.h
+++ b/include/ip6tables.h
@@ -15,4 +15,6 @@
 extern int delete_chain(const ip6t_chainlabel chain, int verbose, struct ip6tc_handle *handle);
 void print_rule(const struct ip6t_entry *e, struct ip6tc_handle *h, const char *chain, int counters);
 
+extern struct xtables_globals ip6tables_globals;
+
 #endif /*_IP6TABLES_USER_H*/
diff --git a/include/iptables.h b/include/iptables.h
index f0aa345..84211c3 100644
--- a/include/iptables.h
+++ b/include/iptables.h
@@ -26,4 +26,6 @@
 #define LINUX_VERSION_MINOR(x)	(((x)>> 8) & 0xFF)
 #define LINUX_VERSION_PATCH(x)	( (x)      & 0xFF)
 
+extern struct xtables_globals iptables_globals;
+
 #endif /*_IPTABLES_USER_H*/
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index acaf97b..3d535de 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -133,6 +133,7 @@
 	xtables_program_name = program_name;
 	xtables_init();
 	xtables_set_nfproto(NFPROTO_IPV6);
+	ip6tables_globals.program_name = "ip6tables-restore";
 #ifdef NO_SHARED_LIBS
 	init_extensions();
 #endif
diff --git a/ip6tables-save.c b/ip6tables-save.c
index 32b5992..3af81ab 100644
--- a/ip6tables-save.c
+++ b/ip6tables-save.c
@@ -142,6 +142,7 @@
 	xtables_program_name = program_name;
 	xtables_init();
 	xtables_set_nfproto(NFPROTO_IPV6);
+	ip6tables_globals.program_name = "ip6tables-save";
 #ifdef NO_SHARED_LIBS
 	init_extensions();
 #endif
diff --git a/ip6tables-standalone.c b/ip6tables-standalone.c
index cea4818..ab77065 100644
--- a/ip6tables-standalone.c
+++ b/ip6tables-standalone.c
@@ -55,6 +55,7 @@
 	xtables_program_name = program_name;
 	xtables_init();
 	xtables_set_nfproto(NFPROTO_IPV6);
+	ip6tables_globals.program_name = "ip6tables";
 #ifdef NO_SHARED_LIBS
 	init_extensions();
 #endif
diff --git a/ip6tables.c b/ip6tables.c
index a73ea9a..fad7ef2 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -149,7 +149,6 @@
 struct xtables_globals ip6tables_globals = {
 	.option_offset = 0,
 	.program_version = IPTABLES_VERSION,
-	.program_name = "ip6tables",
 	.opts = original_opts,
 	.exit_err = ip6tables_exit_error,
 };
diff --git a/iptables-restore.c b/iptables-restore.c
index 810806f..0103016 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -135,6 +135,7 @@
 	xtables_program_name = program_name;
 	xtables_init();
 	xtables_set_nfproto(NFPROTO_IPV4);
+	iptables_globals.program_name = "iptables-restore";
 #ifdef NO_SHARED_LIBS
 	init_extensions();
 #endif
diff --git a/iptables-save.c b/iptables-save.c
index c4306fd..396406f 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -142,6 +142,7 @@
 	xtables_program_name = program_name;
 	xtables_init();
 	xtables_set_nfproto(NFPROTO_IPV4);
+	iptables_globals.program_name = "iptables-save";
 #ifdef NO_SHARED_LIBS
 	init_extensions();
 #endif
diff --git a/iptables-standalone.c b/iptables-standalone.c
index ece7cf4..007f2c2 100644
--- a/iptables-standalone.c
+++ b/iptables-standalone.c
@@ -56,6 +56,7 @@
 	xtables_program_name = program_name;
 	xtables_init();
 	xtables_set_nfproto(NFPROTO_IPV4);
+	iptables_globals.program_name = "iptables";
 #ifdef NO_SHARED_LIBS
 	init_extensions();
 #endif
diff --git a/iptables.c b/iptables.c
index b90952d..670d8aa 100644
--- a/iptables.c
+++ b/iptables.c
@@ -150,7 +150,6 @@
 struct xtables_globals iptables_globals = {
 	.option_offset = 0,
 	.program_version = IPTABLES_VERSION,
-	.program_name = "iptables",
 	.opts = original_opts,
 	.exit_err = iptables_exit_error,
 };