[PATCH] libxtables: Introduce xtables_afinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am going to incrementally send these changes over a period of time
until i resolve all my issues; i hope this is fine with your process.

cheers,
jamal
commit 74350de063cc4bc1f57b5db89ae035cde7fe895b
Author: Jamal Hadi Salim <hadi@xxxxxxxxxx>
Date:   Sat Feb 7 11:54:09 2009 -0500

    This change allows me to compile the following
    little program.
    Otherwise  we get symbol failures with afinfo
    
    -----
     #include "./include/xtables.h"
     #include <stdlib.h>
    
     /*
      * gcc simp-ipt.c -L /lib/xtables -lxtables -ldl
     */
     char *lib_dir;
     unsigned int global_option_offset = 0;
     const char *program_version = XTABLES_VERSION;
     const char *program_name = "tc-ipt";
     struct xtables_afinfo afinfo = {
            .libprefix      = "libxt_",
     };
    
     void exit_error(enum exittype status, const char *msg, ...)
     {
    	exit(status);
     }
    
     int main(int argc, char **argv) {
    
            return 0;
     }
    -----

diff --git a/include/xtables.h.in b/include/xtables.h.in
index 02a832d..9e45c8b 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h.in
@@ -249,6 +249,28 @@ extern void save_string(const char *value);
 /* Present in both iptables.c and ip6tables.c */
 extern u_int16_t parse_protocol(const char *s);
 
+
+/* protocol family dependent informations */
+struct xtables_afinfo {
+	/* protocol family */
+	int family;
+
+	/* prefix of library name (ex "libipt_" */
+	char *libprefix;
+
+	/* used by setsockopt (ex IPPROTO_IP */
+	int ipproto;
+
+	/* kernel module (ex "ip_tables" */
+	char *kmod;
+
+	/* optname to check revision support of match */
+	int so_rev_match;
+
+	/* optname to check revision support of match */
+	int so_rev_target;
+};
+
 #ifdef XTABLES_INTERNAL
 #	include <xtables/internal.h>
 #endif

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux