iptables-edit: introduces iptables-edit cli tool
PATCH 3/3 iptables-edit: introduces iptables-edit cli tool
introduces the iptables-edit command line tool
Signed-off-by Peter Warasin <[email protected]>
Signature · 5 lines
:: e n d i a n :: open source - open minds :: peter warasin :: http://www.endian.com :: [email protected]
Makefile renamed from Makefile.orig +16 -3
@@ -48,9 +48,9 @@ # No longer experimental. ifneq ($(DO_MULTI), 1) -EXTRAS+=iptables-save iptables-restore iptables-xml +EXTRAS+=iptables-save iptables-restore iptables-xml iptables-edit endif -EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables-save $(DESTDIR)$(BINDIR)/iptables-restore $(DESTDIR)$(BINDIR)/iptables-xml $(DESTDIR)$(MANDIR)/man8/iptables-restore.8 $(DESTDIR)$(MANDIR)/man8/iptables-save.8 +EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables-save $(DESTDIR)$(BINDIR)/iptables-restore $(DESTDIR)$(BINDIR)/iptables-xml $(DESTDIR)$(BINDIR)/iptables-edit $(DESTDIR)$(MANDIR)/man8/iptables-restore.8 $(DESTDIR)$(MANDIR)/man8/iptables-save.8 ifeq ($(DO_IPV6), 1) EXTRAS+=ip6tables ip6tables.o ip6tables.8
@@ -135,7 +135,7 @@ $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $< ifeq ($(DO_MULTI), 1) -iptables: iptables-multi.c iptables-save.c iptables-restore.c iptables-xml.c iptables-standalone.c iptables.o iptables-save-lib.o iptables-restore-lib.o $(STATIC_LIBS) libiptc/libiptc.a +iptables: iptables-multi.c iptables-save.c iptables-restore.c iptables-xml.c iptables-edit.c iptables-standalone.c iptables.o iptables-save-lib.o iptables-restore-lib.o $(STATIC_LIBS) libiptc/libiptc.a $(CC) $(CFLAGS) -DIPTABLES_MULTI -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) else iptables: iptables-standalone.c iptables.o $(STATIC_LIBS) libiptc/libiptc.a
@@ -185,6 +185,19 @@ cp $< $@ endif +iptables-edit: iptables-edit.c iptables-save-lib.o iptables-restore-lib.o iptables.o $(STATIC_LIBS) libiptc/libiptc.a + $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) + +ifeq ($(DO_MULTI), 1) +$(DESTDIR)$(BINDIR)/iptables-edit: iptables + @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) + ln -sf $< $@ +else +$(DESTDIR)$(BINDIR)/iptables-edit: iptables-edit + @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) + cp $< $@ +endif + ip6tables.o: ip6tables.c $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $<
iptables-multi.c renamed from iptables-multi.c.orig +4 -0
@@ -6,6 +6,7 @@int iptables_main (int argc,char **argv);int iptables_save_main (int argc,char **argv);int iptables_restore_main (int argc,char **argv); +int iptables_edit_main (int argc,char **argv);int iptables_xml_main (int argc,char **argv);int main (int argc,char **argv) {
@@ -28,6 +29,9 @@if (!strcmp (progname,"iptables-xml" ))return iptables_xml_main (argc, argv); + +if (!strcmp (progname,"iptables-edit" )) +return iptables_edit_main (argc, argv);fprintf (stderr,"iptables multi-purpose version: unknown applet name %s\n" , progname);exit (1 );
iptables-edit.c renamed from iptables-edit.c.orig +260 -0
260 lines not on this page · raw message