[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/Makefile.am b/ap/lib/libnl/libnl-3.2.25/python/netlink/Makefile.am
new file mode 100644
index 0000000..1f6eaf8
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/Makefile.am
@@ -0,0 +1,11 @@
+# -*- Makefile -*-
+
+SUBDIRS = route genl
+
+EXTRA_DIST = \
+ capi.i \
+ fixes.h \
+ __init__.py \
+ core.py \
+ util.py \
+ utils.h
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/Makefile.in b/ap/lib/libnl/libnl-3.2.25/python/netlink/Makefile.in
new file mode 100644
index 0000000..b99c5e1
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/Makefile.in
@@ -0,0 +1,628 @@
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# -*- Makefile -*-
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = python/netlink
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/defs.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLEX = @FLEX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBNL_VERSION = @LIBNL_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_REVISION = @LT_REVISION@
+MAJ_VERSION = @MAJ_VERSION@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MIC_VERSION = @MIC_VERSION@
+MIN_VERSION = @MIN_VERSION@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = route genl
+EXTRA_DIST = \
+ capi.i \
+ fixes.h \
+ __init__.py \
+ core.py \
+ util.py \
+ utils.h
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign python/netlink/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign python/netlink/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic clean-libtool cscopelist-am ctags \
+ ctags-am distclean distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/__init__.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/__init__.py
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/capi.i b/ap/lib/libnl/libnl-3.2.25/python/netlink/capi.i
new file mode 100644
index 0000000..e5d8a53
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/capi.i
@@ -0,0 +1,964 @@
+%module capi
+%{
+#include <netlink/netlink.h>
+#include <netlink/types.h>
+#include <netlink/socket.h>
+#include <netlink/msg.h>
+#include <netlink/object.h>
+#include <netlink/cache.h>
+#include <netlink/attr.h>
+#include <net/if.h>
+
+#define DEBUG
+#include "utils.h"
+%}
+
+%include <stdint.i>
+%include <cstring.i>
+%include <cpointer.i>
+
+%inline %{
+ struct nl_dump_params *alloc_dump_params(void)
+ {
+ struct nl_dump_params *dp;
+ if (!(dp = calloc(1, sizeof(*dp))))
+ return NULL;
+ dp->dp_fd = stdout;
+ return dp;
+ }
+
+ void free_dump_params(struct nl_dump_params *dp)
+ {
+ free(dp);
+ }
+%};
+
+/* <netlink/types.h> */
+
+enum nl_dump_type {
+ NL_DUMP_LINE, /**< Dump object briefly on one line */
+ NL_DUMP_DETAILS, /**< Dump all attributes but no statistics */
+ NL_DUMP_STATS, /**< Dump all attributes including statistics */
+ __NL_DUMP_MAX,
+};
+
+struct nl_dump_params
+{
+ /**
+ * Specifies the type of dump that is requested.
+ */
+ enum nl_dump_type dp_type;
+
+ /**
+ * Specifies the number of whitespaces to be put in front
+ * of every new line (indentation).
+ */
+ int dp_prefix;
+
+ /**
+ * Causes the cache index to be printed for each element.
+ */
+ int dp_print_index;
+
+ /**
+ * Causes each element to be prefixed with the message type.
+ */
+ int dp_dump_msgtype;
+
+ /**
+ * A callback invoked for output
+ *
+ * Passed arguments are:
+ * - dumping parameters
+ * - string to append to the output
+ */
+ void (*dp_cb)(struct nl_dump_params *, char *);
+
+ /**
+ * A callback invoked for every new line, can be used to
+ * customize the indentation.
+ *
+ * Passed arguments are:
+ * - dumping parameters
+ * - line number starting from 0
+ */
+ void (*dp_nl_cb)(struct nl_dump_params *, int);
+
+ /**
+ * User data pointer, can be used to pass data to callbacks.
+ */
+ void *dp_data;
+
+ /**
+ * File descriptor the dumping output should go to
+ */
+ FILE * dp_fd;
+
+ /**
+ * Alternatively the output may be redirected into a buffer
+ */
+ char * dp_buf;
+
+ /**
+ * Length of the buffer dp_buf
+ */
+ size_t dp_buflen;
+
+ /**
+ * PRIVATE
+ * Set if a dump was performed prior to the actual dump handler.
+ */
+ int dp_pre_dump;
+
+ /**
+ * PRIVATE
+ * Owned by the current caller
+ */
+ int dp_ivar;
+
+ unsigned int dp_line;
+};
+
+/* <net/if.h> */
+extern unsigned int if_nametoindex(const char *ifname);
+
+/* <netlink/errno.h> */
+extern const char *nl_geterror(int);
+
+/* <netlink/utils.h> */
+
+extern double nl_cancel_down_bytes(unsigned long long, char **);
+extern double nl_cancel_down_bits(unsigned long long, char **);
+%cstring_output_maxsize(char *buf, size_t len)
+extern int nl_rate2str(unsigned long long rate, int type, char *buf, size_t len);
+extern double nl_cancel_down_us(uint32_t, char **);
+
+extern long nl_size2int(const char *);
+%cstring_output_maxsize(char *buf, const size_t len)
+extern char *nl_size2str(const size_t, char *buf, const size_t len);
+extern long nl_prob2int(const char *);
+
+extern int nl_get_user_hz(void);
+extern uint32_t nl_us2ticks(uint32_t);
+extern uint32_t nl_ticks2us(uint32_t);
+extern int nl_str2msec(const char *, uint64_t *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_msec2str(uint64_t, char *buf, size_t len);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_llproto2str(int, char *buf, size_t len);
+extern int nl_str2llproto(const char *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_ether_proto2str(int, char *buf, size_t len);
+extern int nl_str2ether_proto(const char *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_ip_proto2str(int, char *buf, size_t len);
+extern int nl_str2ip_proto(const char *);
+
+extern void nl_new_line(struct nl_dump_params *);
+extern void nl_dump(struct nl_dump_params *, const char *, ...);
+extern void nl_dump_line(struct nl_dump_params *, const char *, ...);
+
+/* <netlink/netlink.h> */
+extern struct nl_dump_params *alloc_dump_params(void);
+extern void free_dump_params(struct nl_dump_params *);
+
+extern int nl_connect(struct nl_sock *, int);
+extern void nl_close(struct nl_sock *);
+
+/* <netlink/socket.h> */
+extern struct nl_sock *nl_socket_alloc(void);
+extern struct nl_sock *nl_socket_alloc_cb(struct nl_cb *);
+extern void nl_socket_free(struct nl_sock *);
+
+extern uint32_t nl_socket_get_local_port(const struct nl_sock *);
+extern void nl_socket_set_local_port(struct nl_sock *, uint32_t);
+
+extern uint32_t nl_socket_get_peer_port(const struct nl_sock *);
+extern void nl_socket_set_peer_port(struct nl_sock *, uint32_t);
+
+extern uint32_t nl_socket_get_peer_groups(const struct nl_sock *sk);
+extern void nl_socket_set_peer_groups(struct nl_sock *sk, uint32_t groups);
+
+extern int nl_socket_set_buffer_size(struct nl_sock *, int, int);
+extern void nl_socket_set_cb(struct nl_sock *, struct nl_cb *);
+
+extern int nl_send_auto_complete(struct nl_sock *, struct nl_msg *);
+extern int nl_recvmsgs(struct nl_sock *, struct nl_cb *);
+
+/* <netlink/msg.h> */
+extern int nlmsg_size(int);
+extern int nlmsg_total_size(int);
+extern int nlmsg_padlen(int);
+
+extern void * nlmsg_data(const struct nlmsghdr *);
+extern int nlmsg_datalen(const struct nlmsghdr *);
+extern void * nlmsg_tail(const struct nlmsghdr *);
+
+/* attribute access */
+extern struct nlattr * nlmsg_attrdata(const struct nlmsghdr *, int);
+extern int nlmsg_attrlen(const struct nlmsghdr *, int);
+
+/* message parsing */
+extern int nlmsg_valid_hdr(const struct nlmsghdr *, int);
+extern int nlmsg_ok(const struct nlmsghdr *, int);
+extern struct nlmsghdr * nlmsg_next(struct nlmsghdr *, int *);
+extern int nlmsg_parse(struct nlmsghdr *, int, struct nlattr **,
+ int, struct nla_policy *);
+extern struct nlattr * nlmsg_find_attr(struct nlmsghdr *, int, int);
+extern int nlmsg_validate(struct nlmsghdr *, int, int,
+ struct nla_policy *);
+
+extern struct nl_msg * nlmsg_alloc(void);
+extern struct nl_msg * nlmsg_alloc_size(size_t);
+extern struct nl_msg * nlmsg_alloc_simple(int, int);
+extern void nlmsg_set_default_size(size_t);
+extern struct nl_msg * nlmsg_inherit(struct nlmsghdr *);
+extern struct nl_msg * nlmsg_convert(struct nlmsghdr *);
+extern void * nlmsg_reserve(struct nl_msg *, size_t, int);
+extern int nlmsg_append(struct nl_msg *, void *, size_t, int);
+extern int nlmsg_expand(struct nl_msg *, size_t);
+
+extern struct nlmsghdr * nlmsg_put(struct nl_msg *, uint32_t, uint32_t,
+ int, int, int);
+extern struct nlmsghdr * nlmsg_hdr(struct nl_msg *);
+extern void nlmsg_get(struct nl_msg *);
+extern void nlmsg_free(struct nl_msg *);
+
+/* attribute modification */
+extern void nlmsg_set_proto(struct nl_msg *, int);
+extern int nlmsg_get_proto(struct nl_msg *);
+extern size_t nlmsg_get_max_size(struct nl_msg *);
+extern void nlmsg_set_src(struct nl_msg *, struct sockaddr_nl *);
+extern struct sockaddr_nl *nlmsg_get_src(struct nl_msg *);
+extern void nlmsg_set_dst(struct nl_msg *, struct sockaddr_nl *);
+extern struct sockaddr_nl *nlmsg_get_dst(struct nl_msg *);
+extern void nlmsg_set_creds(struct nl_msg *, struct ucred *);
+extern struct ucred * nlmsg_get_creds(struct nl_msg *);
+
+extern char * nl_nlmsgtype2str(int, char *, size_t);
+extern int nl_str2nlmsgtype(const char *);
+
+extern char * nl_nlmsg_flags2str(int, char *, size_t);
+
+extern int nl_msg_parse(struct nl_msg *,
+ void (*cb)(struct nl_object *, void *),
+ void *);
+
+extern void nl_msg_dump(struct nl_msg *, FILE *);
+
+%inline %{
+ struct nl_object *cast_obj(void *obj)
+ {
+ return (struct nl_object *) obj;
+ }
+
+ struct nl_object *object_alloc_name(const char *name)
+ {
+ struct nl_object *obj;
+
+ if (nl_object_alloc_name(name, &obj) < 0)
+ return NULL;
+
+ return obj;
+ }
+%};
+
+extern struct nl_object *nl_object_alloc(struct nl_object_ops *);
+extern void nl_object_free(struct nl_object *);
+extern struct nl_object *nl_object_clone(struct nl_object *);
+extern void nl_object_get(struct nl_object *);
+extern void nl_object_put(struct nl_object *);
+extern int nl_object_shared(struct nl_object *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern void nl_object_dump_buf(struct nl_object *, char *buf, size_t len);
+
+extern void nl_object_dump(struct nl_object *, struct nl_dump_params *);
+
+extern int nl_object_identical(struct nl_object *, struct nl_object *);
+extern uint32_t nl_object_diff(struct nl_object *, struct nl_object *);
+extern int nl_object_match_filter(struct nl_object *, struct nl_object *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_object_attrs2str(struct nl_object *, uint32_t, char *buf, size_t len);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_object_attr_list(struct nl_object *, char *buf, size_t len);
+
+extern void nl_object_mark(struct nl_object *);
+extern void nl_object_unmark(struct nl_object *);
+extern int nl_object_is_marked(struct nl_object *);
+
+extern int nl_object_get_refcnt(struct nl_object *);
+
+/* <netlink/cache.h> */
+
+typedef void (*change_func_t)(struct nl_cache *, struct nl_object *, int, void *);
+
+%inline %{
+ struct nl_cache *alloc_cache_name(const char *name)
+ {
+ struct nl_cache *c;
+ if (nl_cache_alloc_name(name, &c) < 0)
+ return NULL;
+ return c;
+ }
+
+ struct nl_cache_mngr *alloc_cache_mngr(struct nl_sock *sock,
+ int protocol, int flags)
+ {
+ struct nl_cache_mngr *mngr;
+
+ if (nl_cache_mngr_alloc(sock, protocol, flags, &mngr) < 0)
+ return NULL;
+
+ return mngr;
+ }
+
+ struct nl_cache *cache_mngr_add(struct nl_cache_mngr *mngr,
+ const char *name, change_func_t func,
+ void *arg)
+ {
+ struct nl_cache *cache;
+
+ if (nl_cache_mngr_add(mngr, name, func, arg, &cache) < 0)
+ return NULL;
+
+ return cache;
+ }
+%}
+
+/* Access Functions */
+extern int nl_cache_nitems(struct nl_cache *);
+extern int nl_cache_nitems_filter(struct nl_cache *,
+ struct nl_object *);
+extern struct nl_cache_ops * nl_cache_get_ops(struct nl_cache *);
+extern struct nl_object * nl_cache_get_first(struct nl_cache *);
+extern struct nl_object * nl_cache_get_last(struct nl_cache *);
+extern struct nl_object * nl_cache_get_next(struct nl_object *);
+extern struct nl_object * nl_cache_get_prev(struct nl_object *);
+
+extern struct nl_cache * nl_cache_alloc(struct nl_cache_ops *);
+extern struct nl_cache * nl_cache_subset(struct nl_cache *,
+ struct nl_object *);
+extern void nl_cache_clear(struct nl_cache *);
+extern void nl_cache_free(struct nl_cache *);
+
+/* Cache modification */
+extern int nl_cache_add(struct nl_cache *,
+ struct nl_object *);
+extern int nl_cache_parse_and_add(struct nl_cache *,
+ struct nl_msg *);
+extern void nl_cache_remove(struct nl_object *);
+extern int nl_cache_refill(struct nl_sock *,
+ struct nl_cache *);
+extern int nl_cache_pickup(struct nl_sock *,
+ struct nl_cache *);
+extern int nl_cache_resync(struct nl_sock *,
+ struct nl_cache *,
+ change_func_t,
+ void *);
+extern int nl_cache_include(struct nl_cache *,
+ struct nl_object *,
+ change_func_t,
+ void *);
+extern void nl_cache_set_arg1(struct nl_cache *, int);
+extern void nl_cache_set_arg2(struct nl_cache *, int);
+
+/* General */
+extern int nl_cache_is_empty(struct nl_cache *);
+extern struct nl_object * nl_cache_search(struct nl_cache *,
+ struct nl_object *);
+extern void nl_cache_mark_all(struct nl_cache *);
+
+/* Dumping */
+extern void nl_cache_dump(struct nl_cache *,
+ struct nl_dump_params *);
+extern void nl_cache_dump_filter(struct nl_cache *,
+ struct nl_dump_params *,
+ struct nl_object *);
+
+/* Iterators */
+extern void nl_cache_foreach(struct nl_cache *,
+ void (*cb)(struct nl_object *,
+ void *),
+ void *arg);
+extern void nl_cache_foreach_filter(struct nl_cache *,
+ struct nl_object *,
+ void (*cb)(struct
+ nl_object *,
+ void *),
+ void *arg);
+
+/* --- cache management --- */
+
+/* Cache type management */
+extern struct nl_cache_ops * nl_cache_ops_lookup(const char *);
+extern struct nl_cache_ops * nl_cache_ops_associate(int, int);
+extern struct nl_msgtype * nl_msgtype_lookup(struct nl_cache_ops *, int);
+extern void nl_cache_ops_foreach(void (*cb)(struct nl_cache_ops *, void *), void *);
+extern int nl_cache_mngt_register(struct nl_cache_ops *);
+extern int nl_cache_mngt_unregister(struct nl_cache_ops *);
+
+/* Global cache provisioning/requiring */
+extern void nl_cache_mngt_provide(struct nl_cache *);
+extern void nl_cache_mngt_unprovide(struct nl_cache *);
+extern struct nl_cache * nl_cache_mngt_require(const char *);
+
+struct nl_cache_mngr;
+
+#define NL_AUTO_PROVIDE 1
+
+extern int nl_cache_mngr_get_fd(struct nl_cache_mngr *);
+extern int nl_cache_mngr_poll(struct nl_cache_mngr *,
+ int);
+extern int nl_cache_mngr_data_ready(struct nl_cache_mngr *);
+extern void nl_cache_mngr_free(struct nl_cache_mngr *);
+
+/* <netlink/addr.h> */
+%inline %{
+ struct nl_addr *addr_parse(const char *addr, int guess)
+ {
+ struct nl_addr *result;
+
+ if (nl_addr_parse(addr, guess, &result) < 0)
+ return NULL;
+
+ return result;
+ }
+%};
+
+extern struct nl_addr *nl_addr_alloc(size_t);
+extern struct nl_addr *nl_addr_alloc_attr(struct nlattr *, int);
+extern struct nl_addr *nl_addr_build(int, void *, size_t);
+extern struct nl_addr *nl_addr_clone(struct nl_addr *);
+
+extern struct nl_addr *nl_addr_get(struct nl_addr *);
+extern void nl_addr_put(struct nl_addr *);
+extern int nl_addr_shared(struct nl_addr *);
+
+extern int nl_addr_cmp(struct nl_addr *, struct nl_addr *);
+extern int nl_addr_cmp_prefix(struct nl_addr *, struct nl_addr *);
+extern int nl_addr_iszero(struct nl_addr *);
+extern int nl_addr_valid(char *, int);
+extern int nl_addr_guess_family(struct nl_addr *);
+extern int nl_addr_fill_sockaddr(struct nl_addr *, struct sockaddr *, socklen_t *);
+extern int nl_addr_info(struct nl_addr *, struct addrinfo **);
+extern int nl_addr_resolve(struct nl_addr *addr, char *host, size_t hostlen);
+
+extern void nl_addr_set_family(struct nl_addr *, int);
+extern int nl_addr_get_family(struct nl_addr *);
+extern int nl_addr_set_binary_addr(struct nl_addr *, void *, size_t);
+
+extern void *nl_addr_get_binary_addr(struct nl_addr *);
+extern unsigned int nl_addr_get_len(struct nl_addr *);
+extern void nl_addr_set_prefixlen(struct nl_addr *, int);
+extern unsigned int nl_addr_get_prefixlen(struct nl_addr *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_af2str(int, char *buf, size_t len);
+extern int nl_str2af(const char *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *nl_addr2str(struct nl_addr *, char *buf, size_t len);
+
+/* Message Handlers <netlink/handlers.h> */
+/**
+ * Callback actions
+ * @ingroup cb
+ */
+enum nl_cb_action {
+ /** Proceed with wathever would come next */
+ NL_OK,
+ /** Skip this message */
+ NL_SKIP,
+ /** Stop parsing altogether and discard remaining messages */
+ NL_STOP,
+};
+
+/**
+ * Callback kinds
+ * @ingroup cb
+ */
+enum nl_cb_kind {
+ /** Default handlers (quiet) */
+ NL_CB_DEFAULT,
+ /** Verbose default handlers (error messages printed) */
+ NL_CB_VERBOSE,
+ /** Debug handlers for debugging */
+ NL_CB_DEBUG,
+ /** Customized handler specified by the user */
+ NL_CB_CUSTOM,
+ __NL_CB_KIND_MAX,
+};
+
+#define NL_CB_KIND_MAX (__NL_CB_KIND_MAX - 1)
+
+/**
+ * Callback types
+ * @ingroup cb
+ */
+enum nl_cb_type {
+ /** Message is valid */
+ NL_CB_VALID,
+ /** Last message in a series of multi part messages received */
+ NL_CB_FINISH,
+ /** Report received that data was lost */
+ NL_CB_OVERRUN,
+ /** Message wants to be skipped */
+ NL_CB_SKIPPED,
+ /** Message is an acknowledge */
+ NL_CB_ACK,
+ /** Called for every message received */
+ NL_CB_MSG_IN,
+ /** Called for every message sent out except for nl_sendto() */
+ NL_CB_MSG_OUT,
+ /** Message is malformed and invalid */
+ NL_CB_INVALID,
+ /** Called instead of internal sequence number checking */
+ NL_CB_SEQ_CHECK,
+ /** Sending of an acknowledge message has been requested */
+ NL_CB_SEND_ACK,
+ /** Flag NLM_F_DUMP_INTR is set in message */
+ NL_CB_DUMP_INTR,
+ __NL_CB_TYPE_MAX,
+};
+
+#define NL_CB_TYPE_MAX (__NL_CB_TYPE_MAX - 1)
+
+extern struct nl_cb *nl_cb_alloc(enum nl_cb_kind);
+extern struct nl_cb *nl_cb_clone(struct nl_cb *);
+
+struct nlmsgerr {
+ int error;
+};
+
+%{
+
+struct pynl_callback {
+ PyObject *cbf;
+ PyObject *cba;
+};
+
+struct pynl_cbinfo {
+ struct nl_cb *cb;
+ struct pynl_callback cbtype[NL_CB_TYPE_MAX+1];
+ struct pynl_callback cberr;
+ struct list_head list;
+};
+
+LIST_HEAD(callback_list);
+
+static struct pynl_cbinfo *pynl_find_cbinfo(struct nl_cb *cb, int unlink)
+{
+ struct list_head *pos, *prev;
+ struct pynl_cbinfo *info;
+
+ list_for_each_safe(pos, prev, &callback_list) {
+ info = container_of(pos, struct pynl_cbinfo, list);
+ if (info->cb == cb) {
+ if (unlink)
+ list_del(pos, prev);
+ pynl_dbg("cb=%p: found=%p\n", cb, info);
+ return info;
+ }
+ }
+ pynl_dbg("cb=%p: not found\n", cb);
+ return NULL;
+}
+
+static struct pynl_cbinfo *pynl_get_cbinfo(struct nl_cb *cb, int unlink)
+{
+ struct pynl_cbinfo *info;
+
+ info = pynl_find_cbinfo(cb, unlink);
+
+ if (info || unlink) {
+ /* found or no need to allocate a new one */
+ pynl_dbg("cb=%p: done\n", cb);
+ return info;
+ }
+
+ info = calloc(1, sizeof(*info));
+ info->cb = cb;
+ list_add(&info->list, &callback_list);
+ pynl_dbg("cb=%p: added %p\n", cb, info);
+ return info;
+}
+
+static int nl_recv_msg_handler(struct nl_msg *msg, void *arg)
+{
+ struct pynl_callback *cbd = arg;
+ PyObject *msgobj;
+ PyObject *cbparobj;
+ PyObject *resobj;
+ PyObject *funcobj;
+ int result;
+
+ if (!cbd) {
+ result = NL_STOP;
+ goto done;
+ }
+ msgobj = SWIG_NewPointerObj(SWIG_as_voidptr(msg),
+ SWIGTYPE_p_nl_msg, 0 | 0 );
+ /* add selfobj if callback is a method */
+ if (cbd->cbf && PyMethod_Check(cbd->cbf)) {
+ PyObject *selfobj = PyMethod_Self(cbd->cbf);
+ cbparobj = Py_BuildValue("(OOO)", selfobj ? selfobj : cbd->cba,
+ msgobj, cbd->cba);
+ funcobj = PyMethod_Function(cbd->cbf);
+ pynl_dbg("callback %sbounded instance method %p\n",
+ selfobj ? "" : "un", funcobj);
+ } else {
+ cbparobj = Py_BuildValue("(OO)", msgobj, cbd->cba);
+ funcobj = cbd->cbf;
+ pynl_dbg("callback function %p\n", funcobj);
+ }
+ resobj = PyObject_CallObject(funcobj, cbparobj);
+ Py_DECREF(cbparobj);
+ if (resobj && PyInt_Check(resobj))
+ result = (int)PyInt_AsLong(resobj);
+ else
+ result = NL_STOP;
+ Py_XDECREF(resobj);
+done:
+ pynl_dbg("result=%d\n", result);
+ return result;
+}
+
+static int nl_recv_err_handler(struct sockaddr_nl *nla, struct nlmsgerr *err,
+ void *arg)
+{
+ struct pynl_callback *cbd = arg;
+ PyObject *errobj;
+ PyObject *cbparobj;
+ PyObject *resobj;
+ PyObject *funcobj;
+ int result;
+
+ if (!cbd)
+ return NL_STOP;
+ errobj = SWIG_NewPointerObj(SWIG_as_voidptr(err),
+ SWIGTYPE_p_nlmsgerr, 0 | 0 );
+ /* add selfobj if callback is a method */
+ if (cbd->cbf && PyMethod_Check(cbd->cbf)) {
+ PyObject *selfobj = PyMethod_Self(cbd->cbf);
+ cbparobj = Py_BuildValue("(OOO)", selfobj ? selfobj : cbd->cba,
+ errobj, cbd->cba);
+ funcobj = PyMethod_Function(cbd->cbf);
+ } else {
+ cbparobj = Py_BuildValue("(OO)", errobj, cbd->cba);
+ funcobj = cbd->cbf;
+ }
+ resobj = PyObject_CallObject(funcobj, cbparobj);
+ Py_DECREF(cbparobj);
+ if (resobj && PyInt_Check(resobj))
+ result = (int)PyInt_AsLong(resobj);
+ else
+ result = NL_STOP;
+ Py_XDECREF(resobj);
+ pynl_dbg("error: err=%d ret=%d\n", err->error, result);
+ return result;
+}
+
+%}
+%inline %{
+struct nl_cb *py_nl_cb_clone(struct nl_cb *cb)
+{
+ struct pynl_cbinfo *info, *clone_info;
+ struct nl_cb *clone;
+ int i;
+
+ clone = nl_cb_clone(cb);
+ info = pynl_find_cbinfo(cb, 0);
+ if (info) {
+ clone_info = pynl_get_cbinfo(clone, 0);
+ /* increase refcnt to callback parameters and copy them */
+ for (i = 0; info && i <= NL_CB_TYPE_MAX; i++) {
+ Py_XINCREF(info->cbtype[i].cbf);
+ Py_XINCREF(info->cbtype[i].cba);
+ clone_info->cbtype[i].cbf = info->cbtype[i].cbf;
+ clone_info->cbtype[i].cba = info->cbtype[i].cba;
+ }
+ Py_XINCREF(info->cberr.cbf);
+ Py_XINCREF(info->cberr.cba);
+ clone_info->cberr.cbf = info->cberr.cbf;
+ clone_info->cberr.cba = info->cberr.cba;
+ }
+ return clone;
+}
+
+void py_nl_cb_put(struct nl_cb *cb)
+{
+ struct pynl_cbinfo *info;
+ int i;
+
+ /* obtain callback info (and unlink) */
+ info = pynl_get_cbinfo(cb, 1);
+ pynl_dbg("cb=%p, info=%p\n", cb, info);
+ /* decrease refcnt for callback type handlers */
+ for (i = 0; info && i <= NL_CB_TYPE_MAX; i++) {
+ Py_XDECREF(info->cbtype[i].cbf);
+ Py_XDECREF(info->cbtype[i].cba);
+ }
+ /* decrease refcnt for error handler and free callback info */
+ if (info) {
+ Py_XDECREF(info->cberr.cbf);
+ Py_XDECREF(info->cberr.cba);
+ free(info);
+ }
+ nl_cb_put(cb);
+}
+
+int py_nl_cb_set(struct nl_cb *cb, enum nl_cb_type t, enum nl_cb_kind k,
+ PyObject *func, PyObject *a)
+{
+ struct pynl_cbinfo *info;
+
+ /* obtain callback info */
+ info = pynl_get_cbinfo(cb, 0);
+
+ /* clear existing handlers (if any) */
+ Py_XDECREF(info->cbtype[t].cbf);
+ Py_XDECREF(info->cbtype[t].cba);
+ info->cbtype[t].cbf = NULL;
+ info->cbtype[t].cba = NULL;
+ pynl_dbg("cb=%p, info=%p, type=%d, kind=%d\n", cb, info, t, k);
+ /* handle custom callback */
+ if (k == NL_CB_CUSTOM) {
+ Py_XINCREF(func);
+ Py_XINCREF(a);
+ info->cbtype[t].cbf = func;
+ info->cbtype[t].cba = a;
+ return nl_cb_set(cb, t, k,
+ nl_recv_msg_handler, &info->cbtype[t]);
+ }
+ return nl_cb_set(cb, t, k, NULL, NULL);
+}
+
+int py_nl_cb_set_all(struct nl_cb *cb, enum nl_cb_kind k,
+ PyObject *func , PyObject *a)
+{
+ struct pynl_cbinfo *info;
+ int t;
+
+ info = pynl_get_cbinfo(cb, 0);
+ pynl_dbg("cb=%p, info=%p, kind=%d\n", cb, info, k);
+ for (t = 0; t <= NL_CB_TYPE_MAX; t++) {
+ /* (possibly) free existing handler */
+ Py_XDECREF(info->cbtype[t].cbf);
+ Py_XDECREF(info->cbtype[t].cba);
+ info->cbtype[t].cbf = NULL;
+ info->cbtype[t].cba = NULL;
+ if (k == NL_CB_CUSTOM) {
+ Py_XINCREF(func);
+ Py_XINCREF(a);
+ info->cbtype[t].cbf = func;
+ info->cbtype[t].cba = a;
+ }
+ }
+ if (k == NL_CB_CUSTOM)
+ /* callback argument is same for all so using idx 0 here */
+ return nl_cb_set_all(cb, k, nl_recv_msg_handler,
+ &info->cbtype[0]);
+ else
+ return nl_cb_set_all(cb, k, NULL, NULL);
+}
+
+int py_nl_cb_err(struct nl_cb *cb, enum nl_cb_kind k,
+ PyObject *func, PyObject *a)
+{
+ struct pynl_cbinfo *info;
+
+ /* obtain callback info */
+ info = pynl_get_cbinfo(cb, 0);
+ pynl_dbg("cb=%p, info=%p, kind=%d\n", cb, info, k);
+ /* clear existing handlers (if any) */
+ Py_XDECREF(info->cberr.cbf);
+ Py_XDECREF(info->cberr.cba);
+ info->cberr.cbf = NULL;
+ info->cberr.cba = NULL;
+
+ /* handle custom callback */
+ if (k == NL_CB_CUSTOM) {
+ Py_XINCREF(func);
+ Py_XINCREF(a);
+ info->cberr.cbf = func;
+ info->cberr.cba = a;
+ return nl_cb_err(cb, k,
+ nl_recv_err_handler, &info->cberr);
+ }
+ return nl_cb_err(cb, k, NULL, NULL);
+}
+%}
+
+/* Attributes <netlink/attr.h> */
+/*
+ * This typemap is a bit tricky as it uses arg1, which is knowledge about
+ * the SWIGged wrapper output.
+ */
+%typemap(out) void * {
+ $result = PyByteArray_FromStringAndSize($1, nla_len(arg1));
+}
+extern void *nla_data(struct nlattr *);
+%typemap(out) void *;
+extern int nla_type(const struct nlattr *);
+
+/* Integer attribute */
+extern uint8_t nla_get_u8(struct nlattr *);
+extern int nla_put_u8(struct nl_msg *, int, uint8_t);
+extern uint16_t nla_get_u16(struct nlattr *);
+extern int nla_put_u16(struct nl_msg *, int, uint16_t);
+extern uint32_t nla_get_u32(struct nlattr *);
+extern int nla_put_u32(struct nl_msg *, int, uint32_t);
+extern uint64_t nla_get_u64(struct nlattr *);
+extern int nla_put_u64(struct nl_msg *, int, uint64_t);
+
+/* String attribute */
+extern char * nla_get_string(struct nlattr *);
+extern char * nla_strdup(struct nlattr *);
+extern int nla_put_string(struct nl_msg *, int, const char *);
+
+/* Flag attribute */
+extern int nla_get_flag(struct nlattr *);
+extern int nla_put_flag(struct nl_msg *, int);
+
+/* Msec attribute */
+extern unsigned long nla_get_msecs(struct nlattr *);
+extern int nla_put_msecs(struct nl_msg *, int, unsigned long);
+
+/* Attribute nesting */
+extern int nla_put_nested(struct nl_msg *, int, struct nl_msg *);
+extern struct nlattr * nla_nest_start(struct nl_msg *, int);
+extern int nla_nest_end(struct nl_msg *, struct nlattr *);
+%inline %{
+PyObject *py_nla_parse_nested(int max, struct nlattr *nest_attr, PyObject *p)
+{
+ struct nlattr *tb_msg[max + 1];
+ struct nla_policy *policy = NULL;
+ void *pol;
+ PyObject *attrs = Py_None;
+ PyObject *k;
+ PyObject *v;
+ PyObject *resobj;
+ int err;
+ int i;
+
+ if (p != Py_None) {
+ PyObject *pobj;
+
+ if (!PyList_Check(p)) {
+ fprintf(stderr, "expected list object\n");
+ err = -1;
+ goto fail;
+ }
+ pobj = PyList_GetItem(p, 0);
+ err = SWIG_ConvertPtr(pobj, &pol, SWIGTYPE_p_nla_policy, 0 | 0 );
+ if (!SWIG_IsOK(err))
+ goto fail;
+ policy = pol;
+ }
+ err = nla_parse_nested(tb_msg, max, nest_attr, policy);
+ if (err < 0) {
+ fprintf(stderr, "Failed to parse response message\n");
+ } else {
+ attrs = PyDict_New();
+ for (i = 0; i <= max; i++)
+ if (tb_msg[i]) {
+ k = PyInt_FromLong((long)i);
+ v = SWIG_NewPointerObj(SWIG_as_voidptr(tb_msg[i]), SWIGTYPE_p_nlattr, 0 | 0 );
+ PyDict_SetItem(attrs, k, v);
+ }
+ }
+fail:
+ if (attrs == Py_None)
+ Py_INCREF(attrs);
+ resobj = Py_BuildValue("(iO)", err, attrs);
+ return resobj;
+}
+
+/*
+ * nla_get_nested() - get list of nested attributes.
+ *
+ * nla_for_each_<nested|attr>() is a macro construct that needs another approach
+ * for Python. Create and return list of nested attributes.
+ */
+PyObject *nla_get_nested(struct nlattr *nest_attr)
+{
+ PyObject *listobj;
+ PyObject *nestattrobj;
+ struct nlattr *pos;
+ int rem;
+
+ listobj = PyList_New(0);
+ nla_for_each_nested(pos, nest_attr, rem) {
+ nestattrobj = SWIG_NewPointerObj(SWIG_as_voidptr(pos),
+ SWIGTYPE_p_nlattr, 0 | 0 );
+ PyList_Append(listobj, nestattrobj);
+ }
+ return listobj;
+}
+%}
+
+ /**
+ * @ingroup attr
+ * Basic attribute data types
+ *
+ * See \ref attr_datatypes for more details.
+ */
+enum {
+ NLA_UNSPEC, /**< Unspecified type, binary data chunk */
+ NLA_U8, /**< 8 bit integer */
+ NLA_U16, /**< 16 bit integer */
+ NLA_U32, /**< 32 bit integer */
+ NLA_U64, /**< 64 bit integer */
+ NLA_STRING, /**< NUL terminated character string */
+ NLA_FLAG, /**< Flag */
+ NLA_MSECS, /**< Micro seconds (64bit) */
+ NLA_NESTED, /**< Nested attributes */
+ __NLA_TYPE_MAX,
+};
+
+#define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1)
+
+/** @} */
+
+/**
+ * @ingroup attr
+ * Attribute validation policy.
+ *
+ * See \ref attr_datatypes for more details.
+ */
+struct nla_policy {
+ /** Type of attribute or NLA_UNSPEC */
+ uint16_t type;
+
+ /** Minimal length of payload required */
+ uint16_t minlen;
+
+ /** Maximal length of payload allowed */
+ uint16_t maxlen;
+};
+
+%inline %{
+PyObject *nla_policy_array(int n_items)
+{
+ struct nla_policy *policies;
+ PyObject *listobj;
+ PyObject *polobj;
+ int i;
+
+ policies = calloc(n_items, sizeof(*policies));
+ listobj = PyList_New(n_items);
+ for (i = 0; i < n_items; i++) {
+ polobj = SWIG_NewPointerObj(SWIG_as_voidptr(&policies[i]),
+ SWIGTYPE_p_nla_policy, 0 | 0 );
+ PyList_SetItem(listobj, i, polobj);
+ }
+ return listobj;
+}
+%}
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/core.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/core.py
new file mode 100644
index 0000000..e5864cf
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/core.py
@@ -0,0 +1,793 @@
+#
+# Netlink interface based on libnl
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""netlink library based on libnl
+
+This module provides an interface to netlink sockets
+
+The module contains the following public classes:
+ - Socket -- The netlink socket
+ - Message -- The netlink message
+ - Callback -- The netlink callback handler
+ - Object -- Abstract object (based on struct nl_obect in libnl) used as
+ base class for all object types which can be put into a Cache
+ - Cache -- A collection of objects which are derived from the base
+ class Object. Used for netlink protocols which maintain a list
+ or tree of objects.
+ - DumpParams --
+
+The following exceptions are defined:
+ - NetlinkError -- Base exception for all general purpose exceptions raised.
+ - KernelError -- Raised when the kernel returns an error as response to a
+ request.
+
+All other classes or functions in this module are considered implementation
+details.
+"""
+from __future__ import absolute_import
+
+
+
+from . import capi
+import sys
+import socket
+
+__all__ = [
+ 'Socket',
+ 'Message',
+ 'Callback',
+ 'DumpParams',
+ 'Object',
+ 'Cache',
+ 'KernelError',
+ 'NetlinkError',
+]
+
+__version__ = '0.1'
+
+# netlink protocols
+NETLINK_ROUTE = 0
+# NETLINK_UNUSED = 1
+NETLINK_USERSOCK = 2
+NETLINK_FIREWALL = 3
+NETLINK_INET_DIAG = 4
+NETLINK_NFLOG = 5
+NETLINK_XFRM = 6
+NETLINK_SELINUX = 7
+NETLINK_ISCSI = 8
+NETLINK_AUDIT = 9
+NETLINK_FIB_LOOKUP = 10
+NETLINK_CONNECTOR = 11
+NETLINK_NETFILTER = 12
+NETLINK_IP6_FW = 13
+NETLINK_DNRTMSG = 14
+NETLINK_KOBJECT_UEVENT = 15
+NETLINK_GENERIC = 16
+NETLINK_SCSITRANSPORT = 18
+NETLINK_ECRYPTFS = 19
+
+NL_DONTPAD = 0
+NL_AUTO_PORT = 0
+NL_AUTO_SEQ = 0
+
+NL_DUMP_LINE = 0
+NL_DUMP_DETAILS = 1
+NL_DUMP_STATS = 2
+
+NLM_F_REQUEST = 1
+NLM_F_MULTI = 2
+NLM_F_ACK = 4
+NLM_F_ECHO = 8
+
+NLM_F_ROOT = 0x100
+NLM_F_MATCH = 0x200
+NLM_F_ATOMIC = 0x400
+NLM_F_DUMP = NLM_F_ROOT | NLM_F_MATCH
+
+NLM_F_REPLACE = 0x100
+NLM_F_EXCL = 0x200
+NLM_F_CREATE = 0x400
+NLM_F_APPEND = 0x800
+
+class NetlinkError(Exception):
+ def __init__(self, error):
+ self._error = error
+ self._msg = capi.nl_geterror(error)
+
+ def __str__(self):
+ return self._msg
+
+class KernelError(NetlinkError):
+ def __str__(self):
+ return 'Kernel returned: {0}'.format(self._msg)
+
+class ImmutableError(NetlinkError):
+ def __init__(self, msg):
+ self._msg = msg
+
+ def __str__(self):
+ return 'Immutable attribute: {0}'.format(self._msg)
+
+class Message(object):
+ """Netlink message"""
+
+ def __init__(self, size=0):
+ if size == 0:
+ self._msg = capi.nlmsg_alloc()
+ else:
+ self._msg = capi.nlmsg_alloc_size(size)
+
+ if self._msg is None:
+ raise Exception('Message allocation returned NULL')
+
+ def __del__(self):
+ capi.nlmsg_free(self._msg)
+
+ def __len__(self):
+ return capi.nlmsg_len(nlmsg_hdr(self._msg))
+
+ @property
+ def protocol(self):
+ return capi.nlmsg_get_proto(self._msg)
+
+ @protocol.setter
+ def protocol(self, value):
+ capi.nlmsg_set_proto(self._msg, value)
+
+ @property
+ def maxSize(self):
+ return capi.nlmsg_get_max_size(self._msg)
+
+ @property
+ def hdr(self):
+ return capi.nlmsg_hdr(self._msg)
+
+ @property
+ def data(self):
+ return capi.nlmsg_data(self._msg)
+
+ @property
+ def attrs(self):
+ return capi.nlmsg_attrdata(self._msg)
+
+ def send(self, sock):
+ sock.send(self)
+
+class Callback(object):
+ """Netlink callback"""
+
+ def __init__(self, kind=capi.NL_CB_DEFAULT):
+ if isinstance(kind, Callback):
+ self._cb = capi.py_nl_cb_clone(kind._cb)
+ else:
+ self._cb = capi.nl_cb_alloc(kind)
+
+ def __del__(self):
+ capi.py_nl_cb_put(self._cb)
+
+ def set_type(self, t, k, handler, obj):
+ return capi.py_nl_cb_set(self._cb, t, k, handler, obj)
+
+ def set_all(self, k, handler, obj):
+ return capi.py_nl_cb_set_all(self._cb, k, handler, obj)
+
+ def set_err(self, k, handler, obj):
+ return capi.py_nl_cb_err(self._cb, k, handler, obj)
+
+ def clone(self):
+ return Callback(self)
+
+class Socket(object):
+ """Netlink socket"""
+
+ def __init__(self, cb=None):
+ if isinstance(cb, Callback):
+ self._sock = capi.nl_socket_alloc_cb(cb._cb)
+ elif cb == None:
+ self._sock = capi.nl_socket_alloc()
+ else:
+ raise Exception('\'cb\' parameter has wrong type')
+
+ if self._sock is None:
+ raise Exception('NULL pointer returned while allocating socket')
+
+ def __del__(self):
+ capi.nl_socket_free(self._sock)
+
+ def __str__(self):
+ return 'nlsock<{0}>'.format(self.local_port)
+
+ @property
+ def local_port(self):
+ return capi.nl_socket_get_local_port(self._sock)
+
+ @local_port.setter
+ def local_port(self, value):
+ capi.nl_socket_set_local_port(self._sock, int(value))
+
+ @property
+ def peer_port(self):
+ return capi.nl_socket_get_peer_port(self._sock)
+
+ @peer_port.setter
+ def peer_port(self, value):
+ capi.nl_socket_set_peer_port(self._sock, int(value))
+
+ @property
+ def peer_groups(self):
+ return capi.nl_socket_get_peer_groups(self._sock)
+
+ @peer_groups.setter
+ def peer_groups(self, value):
+ capi.nl_socket_set_peer_groups(self._sock, value)
+
+ def set_bufsize(self, rx, tx):
+ capi.nl_socket_set_buffer_size(self._sock, rx, tx)
+
+ def connect(self, proto):
+ capi.nl_connect(self._sock, proto)
+ return self
+
+ def disconnect(self):
+ capi.nl_close(self._sock)
+
+ def sendto(self, buf):
+ ret = capi.nl_sendto(self._sock, buf, len(buf))
+ if ret < 0:
+ raise Exception('Failed to send')
+ else:
+ return ret
+
+ def send_auto_complete(self, msg):
+ if not isinstance(msg, Message):
+ raise Exception('must provide Message instance')
+ ret = capi.nl_send_auto_complete(self._sock, msg._msg)
+ if ret < 0:
+ raise Exception('send_auto_complete failed: ret=%d' % ret)
+ return ret
+
+ def recvmsgs(self, recv_cb):
+ if not isinstance(recv_cb, Callback):
+ raise Exception('must provide Callback instance')
+ ret = capi.nl_recvmsgs(self._sock, recv_cb._cb)
+ if ret < 0:
+ raise Exception('recvmsg failed: ret=%d' % ret)
+
+_sockets = {}
+
+def lookup_socket(protocol):
+ try:
+ sock = _sockets[protocol]
+ except KeyError:
+ sock = Socket()
+ sock.connect(protocol)
+ _sockets[protocol] = sock
+
+ return sock
+
+class DumpParams(object):
+ """Dumping parameters"""
+
+ def __init__(self, type_=NL_DUMP_LINE):
+ self._dp = capi.alloc_dump_params()
+ if not self._dp:
+ raise Exception('Unable to allocate struct nl_dump_params')
+
+ self._dp.dp_type = type_
+
+ def __del__(self):
+ capi.free_dump_params(self._dp)
+
+ @property
+ def type(self):
+ return self._dp.dp_type
+
+ @type.setter
+ def type(self, value):
+ self._dp.dp_type = value
+
+ @property
+ def prefix(self):
+ return self._dp.dp_prefix
+
+ @prefix.setter
+ def prefix(self, value):
+ self._dp.dp_prefix = value
+
+# underscore this to make sure it is deleted first upon module deletion
+_defaultDumpParams = DumpParams(NL_DUMP_LINE)
+
+class Object(object):
+ """Cacheable object (base class)"""
+
+ def __init__(self, obj_name, name, obj=None):
+ self._obj_name = obj_name
+ self._name = name
+ self._modules = []
+
+ if not obj:
+ obj = capi.object_alloc_name(self._obj_name)
+
+ self._nl_object = obj
+
+ # Create a clone which stores the original state to notice
+ # modifications
+ clone_obj = capi.nl_object_clone(self._nl_object)
+ self._orig = self._obj2type(clone_obj)
+
+ def __del__(self):
+ if not self._nl_object:
+ raise ValueError()
+
+ capi.nl_object_put(self._nl_object)
+
+ def __str__(self):
+ if hasattr(self, 'format'):
+ return self.format()
+ else:
+ return capi.nl_object_dump_buf(self._nl_object, 4096).rstrip()
+
+ def _new_instance(self):
+ raise NotImplementedError()
+
+ def clone(self):
+ """Clone object"""
+ return self._new_instance(capi.nl_object_clone(self._nl_object))
+
+ def _module_lookup(self, path, constructor=None):
+ """Lookup object specific module and load it
+
+ Object implementations consisting of multiple types may
+ offload some type specific code to separate modules which
+ are loadable on demand, e.g. a VLAN link or a specific
+ queueing discipline implementation.
+
+ Loads the module `path` and calls the constructor if
+ supplied or `module`.init()
+
+ The constructor/init function typically assigns a new
+ object covering the type specific implementation aspects
+ to the new object, e.g. link.vlan = VLANLink()
+ """
+ try:
+ __import__(path)
+ except ImportError:
+ return
+
+ module = sys.modules[path]
+
+ if constructor:
+ ret = getattr(module, constructor)(self)
+ else:
+ ret = module.init(self)
+
+ if ret:
+ self._modules.append(ret)
+
+ def _module_brief(self):
+ ret = ''
+
+ for module in self._modules:
+ if hasattr(module, 'brief'):
+ ret += module.brief()
+
+ return ret
+
+ def dump(self, params=None):
+ """Dump object as human readable text"""
+ if params is None:
+ params = _defaultDumpParams
+
+ capi.nl_object_dump(self._nl_object, params._dp)
+
+
+ @property
+ def mark(self):
+ return bool(capi.nl_object_is_marked(self._nl_object))
+
+ @mark.setter
+ def mark(self, value):
+ if value:
+ capi.nl_object_mark(self._nl_object)
+ else:
+ capi.nl_object_unmark(self._nl_object)
+
+ @property
+ def shared(self):
+ return capi.nl_object_shared(self._nl_object) != 0
+
+ @property
+ def attrs(self):
+ attr_list = capi.nl_object_attr_list(self._nl_object, 1024)
+ return attr_list[0].split()
+
+ @property
+ def refcnt(self):
+ return capi.nl_object_get_refcnt(self._nl_object)
+
+ # this method resolves multiple levels of sub types to allow
+ # accessing properties of subclass/subtypes (e.g. link.vlan.id)
+ def _resolve(self, attr):
+ obj = self
+ l = attr.split('.')
+ while len(l) > 1:
+ obj = getattr(obj, l.pop(0))
+ return (obj, l.pop(0))
+
+ def _setattr(self, attr, val):
+ obj, attr = self._resolve(attr)
+ return setattr(obj, attr, val)
+
+ def _hasattr(self, attr):
+ obj, attr = self._resolve(attr)
+ return hasattr(obj, attr)
+
+class ObjIterator(object):
+ def __init__(self, cache, obj):
+ self._cache = cache
+ self._nl_object = None
+
+ if not obj:
+ self._end = 1
+ else:
+ capi.nl_object_get(obj)
+ self._nl_object = obj
+ self._first = 1
+ self._end = 0
+
+ def __del__(self):
+ if self._nl_object:
+ capi.nl_object_put(self._nl_object)
+
+ def __iter__(self):
+ return self
+
+ def get_next(self):
+ return capi.nl_cache_get_next(self._nl_object)
+
+ def next(self):
+ return self.__next__()
+
+ def __next__(self):
+ if self._end:
+ raise StopIteration()
+
+ if self._first:
+ ret = self._nl_object
+ self._first = 0
+ else:
+ ret = self.get_next()
+ if not ret:
+ self._end = 1
+ raise StopIteration()
+
+ # return ref of previous element and acquire ref of current
+ # element to have object stay around until we fetched the
+ # next ptr
+ capi.nl_object_put(self._nl_object)
+ capi.nl_object_get(ret)
+ self._nl_object = ret
+
+ # reference used inside object
+ capi.nl_object_get(ret)
+ return self._cache._new_object(ret)
+
+
+class ReverseObjIterator(ObjIterator):
+ def get_next(self):
+ return capi.nl_cache_get_prev(self._nl_object)
+
+class Cache(object):
+ """Collection of netlink objects"""
+ def __init__(self):
+ if self.__class__ is Cache:
+ raise NotImplementedError()
+ self.arg1 = None
+ self.arg2 = None
+
+ def __del__(self):
+ capi.nl_cache_free(self._nl_cache)
+
+ def __len__(self):
+ return capi.nl_cache_nitems(self._nl_cache)
+
+ def __iter__(self):
+ obj = capi.nl_cache_get_first(self._nl_cache)
+ return ObjIterator(self, obj)
+
+ def __reversed__(self):
+ obj = capi.nl_cache_get_last(self._nl_cache)
+ return ReverseObjIterator(self, obj)
+
+ def __contains__(self, item):
+ obj = capi.nl_cache_search(self._nl_cache, item._nl_object)
+ if obj is None:
+ return False
+ else:
+ capi.nl_object_put(obj)
+ return True
+
+ # called by sub classes to allocate type specific caches by name
+ @staticmethod
+ def _alloc_cache_name(name):
+ return capi.alloc_cache_name(name)
+
+ # implemented by sub classes, must return new instasnce of cacheable
+ # object
+ @staticmethod
+ def _new_object(obj):
+ raise NotImplementedError()
+
+ # implemented by sub classes, must return instance of sub class
+ def _new_cache(self, cache):
+ raise NotImplementedError()
+
+ def subset(self, filter_):
+ """Return new cache containing subset of cache
+
+ Cretes a new cache containing all objects which match the
+ specified filter.
+ """
+ if not filter_:
+ raise ValueError()
+
+ c = capi.nl_cache_subset(self._nl_cache, filter_._nl_object)
+ return self._new_cache(cache=c)
+
+ def dump(self, params=None, filter_=None):
+ """Dump (print) cache as human readable text"""
+ if not params:
+ params = _defaultDumpParams
+
+ if filter_:
+ filter_ = filter_._nl_object
+
+ capi.nl_cache_dump_filter(self._nl_cache, params._dp, filter_)
+
+ def clear(self):
+ """Remove all cache entries"""
+ capi.nl_cache_clear(self._nl_cache)
+
+ # Called by sub classes to set first cache argument
+ def _set_arg1(self, arg):
+ self.arg1 = arg
+ capi.nl_cache_set_arg1(self._nl_cache, arg)
+
+ # Called by sub classes to set second cache argument
+ def _set_arg2(self, arg):
+ self.arg2 = arg
+ capi.nl_cache_set_arg2(self._nl_cache, arg)
+
+ def refill(self, socket=None):
+ """Clear cache and refill it"""
+ if socket is None:
+ socket = lookup_socket(self._protocol)
+
+ capi.nl_cache_refill(socket._sock, self._nl_cache)
+ return self
+
+ def resync(self, socket=None, cb=None, args=None):
+ """Synchronize cache with content in kernel"""
+ if socket is None:
+ socket = lookup_socket(self._protocol)
+
+ capi.nl_cache_resync(socket._sock, self._nl_cache, cb, args)
+
+ def provide(self):
+ """Provide this cache to others
+
+ Caches which have been "provided" are made available
+ to other users (of the same application context) which
+ "require" it. F.e. a link cache is generally provided
+ to allow others to translate interface indexes to
+ link names
+ """
+
+ capi.nl_cache_mngt_provide(self._nl_cache)
+
+ def unprovide(self):
+ """Unprovide this cache
+
+ No longer make the cache available to others. If the cache
+ has been handed out already, that reference will still
+ be valid.
+ """
+ capi.nl_cache_mngt_unprovide(self._nl_cache)
+
+# Cache Manager (Work in Progress)
+NL_AUTO_PROVIDE = 1
+class CacheManager(object):
+ def __init__(self, protocol, flags=None):
+
+ self._sock = Socket()
+ self._sock.connect(protocol)
+
+ if not flags:
+ flags = NL_AUTO_PROVIDE
+
+ self._mngr = capi.cache_mngr_alloc(self._sock._sock, protocol, flags)
+
+ def __del__(self):
+ if self._sock:
+ self._sock.disconnect()
+
+ if self._mngr:
+ capi.nl_cache_mngr_free(self._mngr)
+
+ def add(self, name):
+ capi.cache_mngr_add(self._mngr, name, None, None)
+
+class AddressFamily(object):
+ """Address family representation
+
+ af = AddressFamily('inet6')
+ # raises:
+ # - ValueError if family name is not known
+ # - TypeError if invalid type is specified for family
+
+ print af # => 'inet6' (string representation)
+ print int(af) # => 10 (numeric representation)
+ print repr(af) # => AddressFamily('inet6')
+ """
+ def __init__(self, family=socket.AF_UNSPEC):
+ if isinstance(family, str):
+ family = capi.nl_str2af(family)
+ if family < 0:
+ raise ValueError('Unknown family name')
+ elif not isinstance(family, int):
+ raise TypeError()
+
+ self._family = family
+
+ def __str__(self):
+ return capi.nl_af2str(self._family, 32)[0]
+
+ def __int__(self):
+ return self._family
+
+ def __repr__(self):
+ return 'AddressFamily({0!r})'.format(str(self))
+
+
+class AbstractAddress(object):
+ """Abstract address object
+
+ addr = AbstractAddress('127.0.0.1/8')
+ print addr # => '127.0.0.1/8'
+ print addr.prefixlen # => '8'
+ print addr.family # => 'inet'
+ print len(addr) # => '4' (32bit ipv4 address)
+
+ a = AbstractAddress('10.0.0.1/24')
+ b = AbstractAddress('10.0.0.2/24')
+ print a == b # => False
+
+
+ """
+ def __init__(self, addr):
+ self._nl_addr = None
+
+ if isinstance(addr, str):
+ # returns None on success I guess
+ # TO CORRECT
+ addr = capi.addr_parse(addr, socket.AF_UNSPEC)
+ if addr is None:
+ raise ValueError('Invalid address format')
+ elif addr:
+ capi.nl_addr_get(addr)
+
+ self._nl_addr = addr
+
+ def __del__(self):
+ if self._nl_addr:
+ capi.nl_addr_put(self._nl_addr)
+
+ def __cmp__(self, other):
+ if isinstance(other, str):
+ other = AbstractAddress(other)
+
+ diff = self.prefixlen - other.prefixlen
+ if diff == 0:
+ diff = capi.nl_addr_cmp(self._nl_addr, other._nl_addr)
+
+ return diff
+
+ def contains(self, item):
+ diff = int(self.family) - int(item.family)
+ if diff:
+ return False
+
+ if item.prefixlen < self.prefixlen:
+ return False
+
+ diff = capi.nl_addr_cmp_prefix(self._nl_addr, item._nl_addr)
+ return diff == 0
+
+ def __nonzero__(self):
+ if self._nl_addr:
+ return not capi.nl_addr_iszero(self._nl_addr)
+ else:
+ return False
+
+ def __len__(self):
+ if self._nl_addr:
+ return capi.nl_addr_get_len(self._nl_addr)
+ else:
+ return 0
+
+ def __str__(self):
+ if self._nl_addr:
+ return capi.nl_addr2str(self._nl_addr, 64)[0]
+ else:
+ return 'none'
+
+ @property
+ def shared(self):
+ """True if address is shared (multiple users)"""
+ if self._nl_addr:
+ return capi.nl_addr_shared(self._nl_addr) != 0
+ else:
+ return False
+
+ @property
+ def prefixlen(self):
+ """Length of prefix (number of bits)"""
+ if self._nl_addr:
+ return capi.nl_addr_get_prefixlen(self._nl_addr)
+ else:
+ return 0
+
+ @prefixlen.setter
+ def prefixlen(self, value):
+ if not self._nl_addr:
+ raise TypeError()
+
+ capi.nl_addr_set_prefixlen(self._nl_addr, int(value))
+
+ @property
+ def family(self):
+ """Address family"""
+ f = 0
+ if self._nl_addr:
+ f = capi.nl_addr_get_family(self._nl_addr)
+
+ return AddressFamily(f)
+
+ @family.setter
+ def family(self, value):
+ if not self._nl_addr:
+ raise TypeError()
+
+ if not isinstance(value, AddressFamily):
+ value = AddressFamily(value)
+
+ capi.nl_addr_set_family(self._nl_addr, int(value))
+
+
+# keyword:
+# type = { int | str }
+# immutable = { True | False }
+# fmt = func (formatting function)
+# title = string
+
+def nlattr(**kwds):
+ """netlink object attribute decorator
+
+ decorator used to mark mutable and immutable properties
+ of netlink objects. All properties marked as such are
+ regarded to be accessable.
+
+ @property
+ @netlink.nlattr(type=int)
+ def my_attr(self):
+ return self._my_attr
+
+ """
+
+ def wrap_fn(func):
+ func.formatinfo = kwds
+ return func
+ return wrap_fn
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/fixes.h b/ap/lib/libnl/libnl-3.2.25/python/netlink/fixes.h
new file mode 100644
index 0000000..9a6118b
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/fixes.h
@@ -0,0 +1 @@
+#include <stdint.h>
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/Makefile.am b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/Makefile.am
new file mode 100644
index 0000000..9e30904
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/Makefile.am
@@ -0,0 +1,5 @@
+# -*- Makefile -*-
+
+EXTRA_DIST = \
+ capi.i \
+ __init__.py
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/Makefile.in b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/Makefile.in
new file mode 100644
index 0000000..bd80e2d
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/Makefile.in
@@ -0,0 +1,443 @@
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# -*- Makefile -*-
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = python/netlink/genl
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/defs.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLEX = @FLEX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBNL_VERSION = @LIBNL_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_REVISION = @LT_REVISION@
+MAJ_VERSION = @MAJ_VERSION@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MIC_VERSION = @MIC_VERSION@
+MIN_VERSION = @MIN_VERSION@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ capi.i \
+ __init__.py
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign python/netlink/genl/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign python/netlink/genl/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/__init__.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/__init__.py
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/capi.i b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/capi.i
new file mode 100644
index 0000000..069e617
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/genl/capi.i
@@ -0,0 +1,108 @@
+%module capi
+%{
+#include <netlink/genl/ctrl.h>
+#include <netlink/genl/family.h>
+#include <netlink/genl/genl.h>
+#include <netlink/genl/mngt.h>
+%}
+
+%include <stdint.i>
+%include <cstring.i>
+
+/* #include <netlink/genl/ctrl.h> */
+extern int genl_ctrl_alloc_cache(struct nl_sock *, struct nl_cache **o_cache);
+extern struct genl_family *genl_ctrl_search(struct nl_cache *, int);
+extern struct genl_family *genl_ctrl_search_by_name(struct nl_cache *,
+ const char *);
+extern int genl_ctrl_resolve(struct nl_sock *, const char *);
+extern int genl_ctrl_resolve_grp(struct nl_sock *sk, const char *family,
+ const char *grp);
+
+/* #include <netlink/genl/family.h> */
+extern struct genl_family *genl_family_alloc(void);
+extern void genl_family_put(struct genl_family *);
+
+extern unsigned int genl_family_get_id(struct genl_family *);
+extern void genl_family_set_id(struct genl_family *, unsigned int);
+extern char *genl_family_get_name(struct genl_family *);
+extern void genl_family_set_name(struct genl_family *, const char *name);
+extern uint8_t genl_family_get_version(struct genl_family *);
+extern void genl_family_set_version(struct genl_family *, uint8_t);
+extern uint32_t genl_family_get_hdrsize(struct genl_family *);
+extern void genl_family_set_hdrsize(struct genl_family *, uint32_t);
+extern uint32_t genl_family_get_maxattr(struct genl_family *);
+extern void genl_family_set_maxattr(struct genl_family *, uint32_t);
+
+extern int genl_family_add_op(struct genl_family *, int, int);
+extern int genl_family_add_grp(struct genl_family *, uint32_t , const char *);
+
+/* #include <netlink/genl/genl.h> */
+extern int genl_connect(struct nl_sock *);
+
+extern void *genlmsg_put(struct nl_msg *, uint32_t, uint32_t,
+ int, int, int, uint8_t, uint8_t);
+
+struct nlattr {
+};
+
+struct nla_policy {
+ /** Type of attribute or NLA_UNSPEC */
+ uint16_t type;
+
+ /** Minimal length of payload required */
+ uint16_t minlen;
+
+ /** Maximal length of payload allowed */
+ uint16_t maxlen;
+};
+
+%inline %{
+PyObject *py_genlmsg_parse(struct nlmsghdr *nlh, int uhl, int max,
+ PyObject *p)
+{
+ struct nlattr *tb_msg[max + 1];
+ struct nla_policy *policy = NULL;
+ void *pol;
+ PyObject *attrs = Py_None;
+ PyObject *k;
+ PyObject *v;
+ PyObject *resobj;
+ int err;
+ int i;
+
+ if (p != Py_None) {
+ PyObject *pobj;
+
+ if (!PyList_Check(p)) {
+ fprintf(stderr, "expected list object\n");
+ err = -1;
+ goto fail;
+ }
+ pobj = PyList_GetItem(p, 0);
+ err = SWIG_ConvertPtr(pobj, &pol, SWIGTYPE_p_nla_policy, 0 | 0 );
+ if (!SWIG_IsOK(err))
+ goto fail;
+ policy = pol;
+ }
+ err = genlmsg_parse(nlh, uhl, tb_msg, max, policy);
+ if (err < 0) {
+ fprintf(stderr, "Failed to parse response message\n");
+ } else {
+ attrs = PyDict_New();
+ for (i = 0; i <= max; i++)
+ if (tb_msg[i]) {
+ k = PyInt_FromLong((long)i);
+ v = SWIG_NewPointerObj(SWIG_as_voidptr(tb_msg[i]), SWIGTYPE_p_nlattr, 0 | 0 );
+ PyDict_SetItem(attrs, k, v);
+ }
+ }
+fail:
+ if (attrs == Py_None)
+ Py_INCREF(Py_None);
+ resobj = Py_BuildValue("(iO)", err, attrs);
+ return resobj;
+}
+
+%}
+/* #include <netlink/genl/mngt.h> */
+/* nothing yet */
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/Makefile.am b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/Makefile.am
new file mode 100644
index 0000000..ef714f4
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/Makefile.am
@@ -0,0 +1,14 @@
+# -*- Makefile -*-
+
+EXTRA_DIST = \
+ capi.i \
+ __init__.py \
+ address.py \
+ link.py \
+ tc.py \
+ links/__init__.py \
+ links/dummy.py \
+ links/inet.py \
+ links/vlan.py \
+ qdisc/__init__.py \
+ qdisc/htb.py
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/Makefile.in b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/Makefile.in
new file mode 100644
index 0000000..2c56123
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/Makefile.in
@@ -0,0 +1,452 @@
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# -*- Makefile -*-
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = python/netlink/route
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/defs.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLEX = @FLEX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBNL_VERSION = @LIBNL_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_REVISION = @LT_REVISION@
+MAJ_VERSION = @MAJ_VERSION@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MIC_VERSION = @MIC_VERSION@
+MIN_VERSION = @MIN_VERSION@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ capi.i \
+ __init__.py \
+ address.py \
+ link.py \
+ tc.py \
+ links/__init__.py \
+ links/dummy.py \
+ links/inet.py \
+ links/vlan.py \
+ qdisc/__init__.py \
+ qdisc/htb.py
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign python/netlink/route/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign python/netlink/route/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/__init__.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/__init__.py
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/address.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/address.py
new file mode 100644
index 0000000..cab2a97
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/address.py
@@ -0,0 +1,367 @@
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""Module providing access to network addresses
+"""
+
+from __future__ import absolute_import
+
+
+__version__ = '1.0'
+__all__ = [
+ 'AddressCache',
+ 'Address']
+
+import datetime
+from .. import core as netlink
+from . import capi as capi
+from . import link as Link
+from .. import util as util
+
+class AddressCache(netlink.Cache):
+ """Cache containing network addresses"""
+
+ def __init__(self, cache=None):
+ if not cache:
+ cache = self._alloc_cache_name('route/addr')
+
+ self._protocol = netlink.NETLINK_ROUTE
+ self._nl_cache = cache
+
+ def __getitem__(self, key):
+ # Using ifindex=0 here implies that the local address itself
+ # is unique, otherwise the first occurence is returned.
+ return self.lookup(0, key)
+
+ def lookup(self, ifindex, local):
+ if type(local) is str:
+ local = netlink.AbstractAddress(local)
+
+ addr = capi.rtnl_addr_get(self._nl_cache, ifindex,
+ local._nl_addr)
+ if addr is None:
+ raise KeyError()
+
+ return Address._from_capi(addr)
+
+ @staticmethod
+ def _new_object(obj):
+ return Address(obj)
+
+ @staticmethod
+ def _new_cache(cache):
+ return AddressCache(cache=cache)
+
+class Address(netlink.Object):
+ """Network address"""
+
+ def __init__(self, obj=None):
+ netlink.Object.__init__(self, 'route/addr', 'address', obj)
+ self._rtnl_addr = self._obj2type(self._nl_object)
+
+ @classmethod
+ def _from_capi(cls, obj):
+ return cls(capi.addr2obj(obj))
+
+ @staticmethod
+ def _obj2type(obj):
+ return capi.obj2addr(obj)
+
+ def __cmp__(self, other):
+ # sort by:
+ # 1. network link
+ # 2. address family
+ # 3. local address (including prefixlen)
+ diff = self.ifindex - other.ifindex
+
+ if diff == 0:
+ diff = self.family - other.family
+ if diff == 0:
+ diff = capi.nl_addr_cmp(self.local, other.local)
+
+ return diff
+
+ @staticmethod
+ def _new_instance(obj):
+ return Address(obj)
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def ifindex(self):
+ """interface index"""
+ return capi.rtnl_addr_get_ifindex(self._rtnl_addr)
+
+ @ifindex.setter
+ def ifindex(self, value):
+ link = Link.resolve(value)
+ if not link:
+ raise ValueError()
+
+ self.link = link
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.string)
+ def link(self):
+ link = capi.rtnl_addr_get_link(self._rtnl_addr)
+ if not link:
+ return None
+
+ return Link.Link.from_capi(link)
+
+ @link.setter
+ def link(self, value):
+ if type(value) is str:
+ try:
+ value = Link.resolve(value)
+ except KeyError:
+ raise ValueError()
+
+ capi.rtnl_addr_set_link(self._rtnl_addr, value._rtnl_link)
+
+ # ifindex is immutable but we assume that if _orig does not
+ # have an ifindex specified, it was meant to be given here
+ if capi.rtnl_addr_get_ifindex(self._orig) == 0:
+ capi.rtnl_addr_set_ifindex(self._orig, value.ifindex)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.string)
+ def label(self):
+ """address label"""
+ return capi.rtnl_addr_get_label(self._rtnl_addr)
+
+ @label.setter
+ def label(self, value):
+ capi.rtnl_addr_set_label(self._rtnl_addr, value)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.string)
+ def flags(self):
+ """Flags
+
+ Setting this property will *Not* reset flags to value you supply in
+
+ Examples:
+ addr.flags = '+xxx' # add xxx flag
+ addr.flags = 'xxx' # exactly the same
+ addr.flags = '-xxx' # remove xxx flag
+ addr.flags = [ '+xxx', '-yyy' ] # list operation
+ """
+ flags = capi.rtnl_addr_get_flags(self._rtnl_addr)
+ return capi.rtnl_addr_flags2str(flags, 256)[0].split(',')
+
+ def _set_flag(self, flag):
+ if flag.startswith('-'):
+ i = capi.rtnl_addr_str2flags(flag[1:])
+ capi.rtnl_addr_unset_flags(self._rtnl_addr, i)
+ elif flag.startswith('+'):
+ i = capi.rtnl_addr_str2flags(flag[1:])
+ capi.rtnl_addr_set_flags(self._rtnl_addr, i)
+ else:
+ i = capi.rtnl_addr_str2flags(flag)
+ capi.rtnl_addr_set_flags(self._rtnl_addr, i)
+
+ @flags.setter
+ def flags(self, value):
+ if type(value) is list:
+ for flag in value:
+ self._set_flag(flag)
+ else:
+ self._set_flag(value)
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def family(self):
+ """Address family"""
+ fam = capi.rtnl_addr_get_family(self._rtnl_addr)
+ return netlink.AddressFamily(fam)
+
+ @family.setter
+ def family(self, value):
+ if not isinstance(value, netlink.AddressFamily):
+ value = netlink.AddressFamily(value)
+
+ capi.rtnl_addr_set_family(self._rtnl_addr, int(value))
+
+ @property
+ @netlink.nlattr(type=int, fmt=util.num)
+ def scope(self):
+ """Address scope"""
+ scope = capi.rtnl_addr_get_scope(self._rtnl_addr)
+ return capi.rtnl_scope2str(scope, 32)[0]
+
+ @scope.setter
+ def scope(self, value):
+ if type(value) is str:
+ value = capi.rtnl_str2scope(value)
+ capi.rtnl_addr_set_scope(self._rtnl_addr, value)
+
+ @property
+ @netlink.nlattr(type=str, immutable=True, fmt=util.addr)
+ def local(self):
+ """Local address"""
+ a = capi.rtnl_addr_get_local(self._rtnl_addr)
+ return netlink.AbstractAddress(a)
+
+ @local.setter
+ def local(self, value):
+ a = netlink.AbstractAddress(value)
+ capi.rtnl_addr_set_local(self._rtnl_addr, a._nl_addr)
+
+ # local is immutable but we assume that if _orig does not
+ # have a local address specified, it was meant to be given here
+ if capi.rtnl_addr_get_local(self._orig) is None:
+ capi.rtnl_addr_set_local(self._orig, a._nl_addr)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.addr)
+ def peer(self):
+ """Peer address"""
+ a = capi.rtnl_addr_get_peer(self._rtnl_addr)
+ return netlink.AbstractAddress(a)
+
+ @peer.setter
+ def peer(self, value):
+ a = netlink.AbstractAddress(value)
+ capi.rtnl_addr_set_peer(self._rtnl_addr, a._nl_addr)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.addr)
+ def broadcast(self):
+ """Broadcast address"""
+ a = capi.rtnl_addr_get_broadcast(self._rtnl_addr)
+ return netlink.AbstractAddress(a)
+
+ @broadcast.setter
+ def broadcast(self, value):
+ a = netlink.AbstractAddress(value)
+ capi.rtnl_addr_set_broadcast(self._rtnl_addr, a._nl_addr)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.addr)
+ def multicast(self):
+ """multicast address"""
+ a = capi.rtnl_addr_get_multicast(self._rtnl_addr)
+ return netlink.AbstractAddress(a)
+
+ @multicast.setter
+ def multicast(self, value):
+ try:
+ a = netlink.AbstractAddress(value)
+ except ValueError as err:
+ raise AttributeError('multicast', err)
+
+ capi.rtnl_addr_set_multicast(self._rtnl_addr, a._nl_addr)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.addr)
+ def anycast(self):
+ """anycast address"""
+ a = capi.rtnl_addr_get_anycast(self._rtnl_addr)
+ return netlink.AbstractAddress(a)
+
+ @anycast.setter
+ def anycast(self, value):
+ a = netlink.AbstractAddress(value)
+ capi.rtnl_addr_set_anycast(self._rtnl_addr, a._nl_addr)
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def valid_lifetime(self):
+ """Valid lifetime"""
+ msecs = capi.rtnl_addr_get_valid_lifetime(self._rtnl_addr)
+ if msecs == 0xFFFFFFFF:
+ return None
+ else:
+ return datetime.timedelta(seconds=msecs)
+
+ @valid_lifetime.setter
+ def valid_lifetime(self, value):
+ capi.rtnl_addr_set_valid_lifetime(self._rtnl_addr, int(value))
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def preferred_lifetime(self):
+ """Preferred lifetime"""
+ msecs = capi.rtnl_addr_get_preferred_lifetime(self._rtnl_addr)
+ if msecs == 0xFFFFFFFF:
+ return None
+ else:
+ return datetime.timedelta(seconds=msecs)
+
+ @preferred_lifetime.setter
+ def preferred_lifetime(self, value):
+ capi.rtnl_addr_set_preferred_lifetime(self._rtnl_addr, int(value))
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def create_time(self):
+ """Creation time"""
+ hsec = capi.rtnl_addr_get_create_time(self._rtnl_addr)
+ return datetime.timedelta(milliseconds=10*hsec)
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def last_update(self):
+ """Last update"""
+ hsec = capi.rtnl_addr_get_last_update_time(self._rtnl_addr)
+ return datetime.timedelta(milliseconds=10*hsec)
+
+ def add(self, socket=None, flags=None):
+ if not socket:
+ socket = netlink.lookup_socket(netlink.NETLINK_ROUTE)
+
+ if not flags:
+ flags = netlink.NLM_F_CREATE
+
+ ret = capi.rtnl_addr_add(socket._sock, self._rtnl_addr, flags)
+ if ret < 0:
+ raise netlink.KernelError(ret)
+
+ def delete(self, socket, flags=0):
+ """Attempt to delete this address in the kernel"""
+ ret = capi.rtnl_addr_delete(socket._sock, self._rtnl_addr, flags)
+ if ret < 0:
+ raise netlink.KernelError(ret)
+
+ ###################################################################
+ # private properties
+ #
+ # Used for formatting output. USE AT OWN RISK
+ @property
+ def _flags(self):
+ return ','.join(self.flags)
+
+ def format(self, details=False, stats=False, nodev=False, indent=''):
+ """Return address as formatted text"""
+ fmt = util.MyFormatter(self, indent)
+
+ buf = fmt.format('{a|local!b}')
+
+ if not nodev:
+ buf += fmt.format(' {a|ifindex}')
+
+ buf += fmt.format(' {a|scope}')
+
+ if self.label:
+ buf += fmt.format(' "{a|label}"')
+
+ buf += fmt.format(' <{a|_flags}>')
+
+ if details:
+ buf += fmt.nl('\t{t|broadcast} {t|multicast}') \
+ + fmt.nl('\t{t|peer} {t|anycast}')
+
+ if self.valid_lifetime:
+ buf += fmt.nl('\t{s|valid-lifetime!k} '\
+ '{a|valid_lifetime}')
+
+ if self.preferred_lifetime:
+ buf += fmt.nl('\t{s|preferred-lifetime!k} '\
+ '{a|preferred_lifetime}')
+
+ if stats and (self.create_time or self.last_update):
+ buf += self.nl('\t{s|created!k} {a|create_time}'\
+ ' {s|last-updated!k} {a|last_update}')
+
+ return buf
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/capi.i b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/capi.i
new file mode 100644
index 0000000..2d72bd7
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/capi.i
@@ -0,0 +1,507 @@
+%module capi
+%{
+#include <netlink/route/rtnl.h>
+#include <netlink/route/link.h>
+#include <netlink/route/link/vlan.h>
+#include <netlink/route/link/macvlan.h>
+#include <netlink/route/link/vxlan.h>
+#include <netlink/route/link/bridge.h>
+#include <netlink/route/link/inet.h>
+
+#include <netlink/route/tc.h>
+#include <netlink/route/qdisc.h>
+#include <netlink/route/class.h>
+#include <netlink/route/classifier.h>
+
+#include <netlink/route/qdisc/htb.h>
+
+#include <netlink/route/addr.h>
+%}
+
+%include <stdint.i>
+%include <cstring.i>
+
+%inline %{
+ struct nl_object *link2obj(struct rtnl_link *link)
+ {
+ return OBJ_CAST(link);
+ }
+
+ struct rtnl_link *obj2link(struct nl_object *obj)
+ {
+ return (struct rtnl_link *) obj;
+ }
+
+ struct rtnl_link *get_from_kernel(struct nl_sock *sk, int ifindex, const char *name)
+ {
+ struct rtnl_link *link;
+ if (rtnl_link_get_kernel(sk, ifindex, name, &link) < 0)
+ return NULL;
+ return link;
+ }
+
+ uint32_t inet_get_conf(struct rtnl_link *link, const unsigned int id)
+ {
+ uint32_t result;
+
+ if (rtnl_link_inet_get_conf(link, id, &result) < 0)
+ return 0;
+
+ return result;
+ }
+%};
+
+extern struct nl_object *link2obj(struct rtnl_link *);
+extern struct rtnl_link *obj2link(struct nl_object *);
+
+/* <netlink/route/rtnl.h> */
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char * rtnl_scope2str(int, char *buf, size_t len);
+extern int rtnl_str2scope(const char *);
+
+/* <netlink/route/link.h> */
+
+extern struct rtnl_link *rtnl_link_alloc(void);
+
+extern struct rtnl_link *rtnl_link_get(struct nl_cache *, int);
+extern struct rtnl_link *rtnl_link_get_by_name(struct nl_cache *, const char *);
+
+extern int rtnl_link_build_add_request(struct rtnl_link *, int, struct nl_msg **);
+extern int rtnl_link_add(struct nl_sock *, struct rtnl_link *, int);
+extern int rtnl_link_build_change_request(struct rtnl_link *, struct rtnl_link *, int, struct nl_msg **);
+extern int rtnl_link_change(struct nl_sock *, struct rtnl_link *, struct rtnl_link *, int);
+
+extern int rtnl_link_build_delete_request(const struct rtnl_link *, struct nl_msg **);
+extern int rtnl_link_delete(struct nl_sock *, const struct rtnl_link *);
+extern int rtnl_link_build_get_request(int, const char *, struct nl_msg **);
+
+extern char *rtnl_link_stat2str(int, char *, size_t);
+extern int rtnl_link_str2stat(const char *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *rtnl_link_flags2str(int, char *buf, size_t len);
+extern int rtnl_link_str2flags(const char *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *rtnl_link_operstate2str(uint8_t, char *buf, size_t len);
+extern int rtnl_link_str2operstate(const char *);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *rtnl_link_mode2str(uint8_t, char *buf, size_t len);
+extern int rtnl_link_str2mode(const char *);
+
+extern void rtnl_link_set_qdisc(struct rtnl_link *, const char *);
+extern char *rtnl_link_get_qdisc(struct rtnl_link *);
+
+extern void rtnl_link_set_name(struct rtnl_link *, const char *);
+extern char *rtnl_link_get_name(struct rtnl_link *);
+
+extern void rtnl_link_set_flags(struct rtnl_link *, unsigned int);
+extern void rtnl_link_unset_flags(struct rtnl_link *, unsigned int);
+extern unsigned int rtnl_link_get_flags(struct rtnl_link *);
+
+extern void rtnl_link_set_mtu(struct rtnl_link *, unsigned int);
+extern unsigned int rtnl_link_get_mtu(struct rtnl_link *);
+
+extern void rtnl_link_set_txqlen(struct rtnl_link *, unsigned int);
+extern unsigned int rtnl_link_get_txqlen(struct rtnl_link *);
+
+extern void rtnl_link_set_ifindex(struct rtnl_link *, int);
+extern int rtnl_link_get_ifindex(struct rtnl_link *);
+
+extern void rtnl_link_set_family(struct rtnl_link *, int);
+extern int rtnl_link_get_family(struct rtnl_link *);
+
+extern void rtnl_link_set_arptype(struct rtnl_link *, unsigned int);
+extern unsigned int rtnl_link_get_arptype(struct rtnl_link *);
+
+extern void rtnl_link_set_addr(struct rtnl_link *, struct nl_addr *);
+extern struct nl_addr *rtnl_link_get_addr(struct rtnl_link *);
+
+extern void rtnl_link_set_broadcast(struct rtnl_link *, struct nl_addr *);
+extern struct nl_addr *rtnl_link_get_broadcast(struct rtnl_link *);
+
+extern void rtnl_link_set_link(struct rtnl_link *, int);
+extern int rtnl_link_get_link(struct rtnl_link *);
+
+extern void rtnl_link_set_master(struct rtnl_link *, int);
+extern int rtnl_link_get_master(struct rtnl_link *);
+
+extern void rtnl_link_set_operstate(struct rtnl_link *, uint8_t);
+extern uint8_t rtnl_link_get_operstate(struct rtnl_link *);
+
+extern void rtnl_link_set_linkmode(struct rtnl_link *, uint8_t);
+extern uint8_t rtnl_link_get_linkmode(struct rtnl_link *);
+
+extern const char *rtnl_link_get_ifalias(struct rtnl_link *);
+extern void rtnl_link_set_ifalias(struct rtnl_link *, const char *);
+
+extern int rtnl_link_get_num_vf(struct rtnl_link *, uint32_t *);
+
+extern uint64_t rtnl_link_get_stat(struct rtnl_link *, int);
+extern int rtnl_link_set_stat(struct rtnl_link *, const unsigned int, const uint64_t);
+
+extern int rtnl_link_set_type(struct rtnl_link *, const char *);
+extern char *rtnl_link_get_type(struct rtnl_link *);
+
+extern int rtnl_link_enslave(struct nl_sock * sock, struct rtnl_link * master, struct rtnl_link * slave);
+extern int rtnl_link_release(struct nl_sock * sock, struct rtnl_link * slave);
+
+/* <netlink/route/link/vlan.h> */
+
+struct vlan_map
+{
+ uint32_t vm_from;
+ uint32_t vm_to;
+};
+
+#define VLAN_PRIO_MAX 7
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char *rtnl_link_vlan_flags2str(int, char *buf, size_t len);
+extern int rtnl_link_vlan_str2flags(const char *);
+
+extern int rtnl_link_vlan_set_id(struct rtnl_link *, int);
+extern int rtnl_link_vlan_get_id(struct rtnl_link *);
+
+extern int rtnl_link_vlan_set_flags(struct rtnl_link *, unsigned int);
+extern int rtnl_link_vlan_unset_flags(struct rtnl_link *, unsigned int);
+extern unsigned int rtnl_link_vlan_get_flags(struct rtnl_link *);
+
+extern int rtnl_link_vlan_set_ingress_map(struct rtnl_link *, int, uint32_t);
+extern uint32_t *rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
+
+extern int rtnl_link_vlan_set_egress_map(struct rtnl_link *, uint32_t, int);
+extern struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *, int *);
+
+/* <netlink/route/link/macvlan.h> */
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern struct rtnl_link *rtnl_link_macvlan_alloc(void);
+extern int rtnl_link_is_macvlan(struct rtnl_link *);
+extern char * rtnl_link_macvlan_mode2str(int, char *, size_t);
+extern int rtnl_link_macvlan_str2mode(const char *);
+extern char * rtnl_link_macvlan_flags2str(int, char *, size_t);
+extern int rtnl_link_macvlan_str2flags(const char *);
+extern int rtnl_link_macvlan_set_mode(struct rtnl_link *, uint32_t);
+extern uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *);
+extern int rtnl_link_macvlan_set_flags(struct rtnl_link *, uint16_t);
+extern int rtnl_link_macvlan_unset_flags(struct rtnl_link *, uint16_t);
+extern uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *);
+
+/* <netlink/route/link/vxlan.h> */
+
+#define VXLAN_ID_MAX 16777215
+
+extern struct rtnl_link *rtnl_link_vxlan_alloc(void);
+
+extern int rtnl_link_is_vxlan(struct rtnl_link *);
+
+extern int rtnl_link_vxlan_set_id(struct rtnl_link *, uint32_t);
+extern int rtnl_link_vxlan_get_id(struct rtnl_link *, uint32_t *);
+
+extern int rtnl_link_vxlan_set_group(struct rtnl_link *, struct nl_addr *);
+extern int rtnl_link_vxlan_get_group(struct rtnl_link *, struct nl_addr **);
+
+extern int rtnl_link_vxlan_set_link(struct rtnl_link *, uint32_t);
+extern int rtnl_link_vxlan_get_link(struct rtnl_link *, uint32_t *);
+
+extern int rtnl_link_vxlan_set_local(struct rtnl_link *, struct nl_addr *);
+extern int rtnl_link_vxlan_get_local(struct rtnl_link *, struct nl_addr **);
+
+extern int rtnl_link_vxlan_set_ttl(struct rtnl_link *, uint8_t);
+extern int rtnl_link_vxlan_get_ttl(struct rtnl_link *);
+
+extern int rtnl_link_vxlan_set_tos(struct rtnl_link *, uint8_t);
+extern int rtnl_link_vxlan_get_tos(struct rtnl_link *);
+
+extern int rtnl_link_vxlan_set_learning(struct rtnl_link *, uint8_t);
+extern int rtnl_link_vxlan_get_learning(struct rtnl_link *);
+extern int rtnl_link_vxlan_enable_learning(struct rtnl_link *);
+extern int rtnl_link_vxlan_disable_learning(struct rtnl_link *);
+
+extern int rtnl_link_vxlan_set_ageing(struct rtnl_link *, uint32_t);
+extern int rtnl_link_vxlan_get_ageing(struct rtnl_link *, uint32_t *);
+
+extern int rtnl_link_vxlan_set_limit(struct rtnl_link *, uint32_t);
+extern int rtnl_link_vxlan_get_limit(struct rtnl_link *, uint32_t *);
+
+extern int rtnl_link_vxlan_set_port_range(struct rtnl_link *,
+ struct ifla_vxlan_port_range *);
+extern int rtnl_link_vxlan_get_port_range(struct rtnl_link *,
+ struct ifla_vxlan_port_range *);
+
+extern int rtnl_link_vxlan_set_proxy(struct rtnl_link *, uint8_t);
+extern int rtnl_link_vxlan_get_proxy(struct rtnl_link *);
+extern int rtnl_link_vxlan_enable_proxy(struct rtnl_link *);
+extern int rtnl_link_vxlan_disable_proxy(struct rtnl_link *);
+
+extern int rtnl_link_vxlan_set_rsc(struct rtnl_link *, uint8_t);
+extern int rtnl_link_vxlan_get_rsc(struct rtnl_link *);
+extern int rtnl_link_vxlan_enable_rsc(struct rtnl_link *);
+extern int rtnl_link_vxlan_disable_rsc(struct rtnl_link *);
+
+extern int rtnl_link_vxlan_set_l2miss(struct rtnl_link *, uint8_t);
+extern int rtnl_link_vxlan_get_l2miss(struct rtnl_link *);
+extern int rtnl_link_vxlan_enable_l2miss(struct rtnl_link *);
+extern int rtnl_link_vxlan_disable_l2miss(struct rtnl_link *);
+
+extern int rtnl_link_vxlan_set_l3miss(struct rtnl_link *, uint8_t);
+extern int rtnl_link_vxlan_get_l3miss(struct rtnl_link *);
+extern int rtnl_link_vxlan_enable_l3miss(struct rtnl_link *);
+extern int rtnl_link_vxlan_disable_l3miss(struct rtnl_link *);
+
+/* <netlink/route/link/bridge.h> */
+
+enum rtnl_link_bridge_flags {
+ RTNL_BRIDGE_HAIRPIN_MODE = 0x0001,
+ RTNL_BRIDGE_BPDU_GUARD = 0x0002,
+ RTNL_BRIDGE_ROOT_BLOCK = 0x0004,
+ RTNL_BRIDGE_FAST_LEAVE = 0x0008,
+};
+
+extern int rtnl_link_is_bridge(struct rtnl_link *);
+extern int rtnl_link_bridge_has_ext_info(struct rtnl_link *);
+
+extern int rtnl_link_bridge_set_port_state(struct rtnl_link *, uint8_t );
+extern int rtnl_link_bridge_get_port_state(struct rtnl_link *);
+
+extern int rtnl_link_bridge_set_priority(struct rtnl_link *, uint16_t);
+extern int rtnl_link_bridge_get_priority(struct rtnl_link *);
+
+extern int rtnl_link_bridge_set_cost(struct rtnl_link *, uint32_t);
+extern int rtnl_link_bridge_get_cost(struct rtnl_link *, uint32_t *);
+
+extern int rtnl_link_bridge_unset_flags(struct rtnl_link *, unsigned int);
+extern int rtnl_link_bridge_set_flags(struct rtnl_link *, unsigned int);
+extern int rtnl_link_bridge_get_flags(struct rtnl_link *);
+
+extern char * rtnl_link_bridge_flags2str(int, char *, size_t);
+extern int rtnl_link_bridge_str2flags(const char *);
+
+/* <netlink/route/link/inet.h> */
+%cstring_output_maxsize(char *buf, size_t len)
+extern const char *rtnl_link_inet_devconf2str(int, char *buf, size_t len);
+extern unsigned int rtnl_link_inet_str2devconf(const char *);
+
+extern int rtnl_link_inet_set_conf(struct rtnl_link *, const unsigned int, uint32_t);
+
+/* <netlink/route/tc.h> */
+
+%inline %{
+ uint32_t tc_str2handle(const char *name)
+ {
+ uint32_t result;
+
+ if (rtnl_tc_str2handle(name, &result) < 0)
+ return 0;
+
+ return result;
+ }
+%};
+
+extern void rtnl_tc_set_ifindex(struct rtnl_tc *, int);
+extern int rtnl_tc_get_ifindex(struct rtnl_tc *);
+extern void rtnl_tc_set_link(struct rtnl_tc *, struct rtnl_link *);
+extern struct rtnl_link *rtnl_tc_get_link(struct rtnl_tc *);
+extern void rtnl_tc_set_mtu(struct rtnl_tc *, uint32_t);
+extern uint32_t rtnl_tc_get_mtu(struct rtnl_tc *);
+extern void rtnl_tc_set_mpu(struct rtnl_tc *, uint32_t);
+extern uint32_t rtnl_tc_get_mpu(struct rtnl_tc *);
+extern void rtnl_tc_set_overhead(struct rtnl_tc *, uint32_t);
+extern uint32_t rtnl_tc_get_overhead(struct rtnl_tc *);
+extern void rtnl_tc_set_linktype(struct rtnl_tc *, uint32_t);
+extern uint32_t rtnl_tc_get_linktype(struct rtnl_tc *);
+extern void rtnl_tc_set_handle(struct rtnl_tc *, uint32_t);
+extern uint32_t rtnl_tc_get_handle(struct rtnl_tc *);
+extern void rtnl_tc_set_parent(struct rtnl_tc *, uint32_t);
+extern uint32_t rtnl_tc_get_parent(struct rtnl_tc *);
+extern int rtnl_tc_set_kind(struct rtnl_tc *, const char *);
+extern char * rtnl_tc_get_kind(struct rtnl_tc *);
+extern uint64_t rtnl_tc_get_stat(struct rtnl_tc *, enum rtnl_tc_stat);
+
+extern int rtnl_tc_calc_txtime(int, int);
+extern int rtnl_tc_calc_bufsize(int, int);
+extern int rtnl_tc_calc_cell_log(int);
+
+extern int rtnl_tc_read_classid_file(void);
+%cstring_output_maxsize(char *buf, size_t len)
+extern char * rtnl_tc_handle2str(uint32_t, char *buf, size_t len);
+extern int rtnl_classid_generate(const char *, uint32_t *, uint32_t);
+
+/* <netlink/route/qdisc.h> */
+
+%inline %{
+ struct nl_object *qdisc2obj(struct rtnl_qdisc *qdisc)
+ {
+ return OBJ_CAST(qdisc);
+ }
+
+ struct rtnl_qdisc *obj2qdisc(struct nl_object *obj)
+ {
+ return (struct rtnl_qdisc *) obj;
+ }
+
+ struct nl_object *class2obj(struct rtnl_class *cl)
+ {
+ return OBJ_CAST(cl);
+ }
+
+ struct rtnl_class *obj2class(struct nl_object *obj)
+ {
+ return (struct rtnl_class *) obj;
+ }
+
+ struct nl_object *cls2obj(struct rtnl_cls *cls)
+ {
+ return OBJ_CAST(cls);
+ }
+
+ struct rtnl_cls *obj2cls(struct nl_object *obj)
+ {
+ return (struct rtnl_cls *) obj;
+ }
+
+ struct rtnl_tc *obj2tc(struct nl_object *obj)
+ {
+ return TC_CAST(obj);
+ }
+%};
+extern struct rtnl_qdisc *
+ rtnl_qdisc_alloc(void);
+
+extern struct rtnl_qdisc *
+ rtnl_qdisc_get(struct nl_cache *, int, uint32_t);
+
+extern struct rtnl_qdisc *
+ rtnl_qdisc_get_by_parent(struct nl_cache *, int, uint32_t);
+
+extern int rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int,
+ struct nl_msg **);
+extern int rtnl_qdisc_add(struct nl_sock *, struct rtnl_qdisc *, int);
+
+extern int rtnl_qdisc_build_update_request(struct rtnl_qdisc *,
+ struct rtnl_qdisc *,
+ int, struct nl_msg **);
+
+extern int rtnl_qdisc_update(struct nl_sock *, struct rtnl_qdisc *,
+ struct rtnl_qdisc *, int);
+
+extern int rtnl_qdisc_build_delete_request(struct rtnl_qdisc *,
+ struct nl_msg **);
+extern int rtnl_qdisc_delete(struct nl_sock *, struct rtnl_qdisc *);
+
+/* <netlink/route/classifier.h> */
+
+extern struct rtnl_cls *rtnl_cls_alloc(void);
+extern void rtnl_cls_put(struct rtnl_cls *);
+
+extern int rtnl_cls_add(struct nl_sock *, struct rtnl_cls *, int);
+
+extern int rtnl_cls_delete(struct nl_sock *, struct rtnl_cls *,
+ int);
+
+extern void rtnl_cls_set_prio(struct rtnl_cls *, uint16_t);
+extern uint16_t rtnl_cls_get_prio(struct rtnl_cls *);
+
+extern void rtnl_cls_set_protocol(struct rtnl_cls *, uint16_t);
+extern uint16_t rtnl_cls_get_protocol(struct rtnl_cls *);
+
+/* <netlink/route/qdisc/htb.h> */
+
+extern uint32_t rtnl_htb_get_rate2quantum(struct rtnl_qdisc *);
+extern int rtnl_htb_set_rate2quantum(struct rtnl_qdisc *, uint32_t);
+extern uint32_t rtnl_htb_get_defcls(struct rtnl_qdisc *);
+extern int rtnl_htb_set_defcls(struct rtnl_qdisc *, uint32_t);
+
+extern uint32_t rtnl_htb_get_prio(struct rtnl_class *);
+extern int rtnl_htb_set_prio(struct rtnl_class *, uint32_t);
+extern uint32_t rtnl_htb_get_rate(struct rtnl_class *);
+extern int rtnl_htb_set_rate(struct rtnl_class *, uint32_t);
+extern uint32_t rtnl_htb_get_ceil(struct rtnl_class *);
+extern int rtnl_htb_set_ceil(struct rtnl_class *, uint32_t);
+extern uint32_t rtnl_htb_get_rbuffer(struct rtnl_class *);
+extern int rtnl_htb_set_rbuffer(struct rtnl_class *, uint32_t);
+extern uint32_t rtnl_htb_get_cbuffer(struct rtnl_class *);
+extern int rtnl_htb_set_cbuffer(struct rtnl_class *, uint32_t);
+extern uint32_t rtnl_htb_get_quantum(struct rtnl_class *);
+extern int rtnl_htb_set_quantum(struct rtnl_class *, uint32_t);
+extern int rtnl_htb_get_level(struct rtnl_class *);
+
+/* <netlink/route/addr.h> */
+
+%inline %{
+ struct nl_object *addr2obj(struct rtnl_addr *addr)
+ {
+ return OBJ_CAST(addr);
+ }
+
+ struct rtnl_addr *obj2addr(struct nl_object *obj)
+ {
+ return (struct rtnl_addr *) obj;
+ }
+%};
+
+extern struct rtnl_addr *rtnl_addr_alloc(void);
+
+extern struct rtnl_addr *
+ rtnl_addr_get(struct nl_cache *, int, struct nl_addr *);
+
+extern int rtnl_addr_build_add_request(struct rtnl_addr *, int,
+ struct nl_msg **);
+extern int rtnl_addr_add(struct nl_sock *, struct rtnl_addr *, int);
+
+extern int rtnl_addr_build_delete_request(struct rtnl_addr *, int,
+ struct nl_msg **);
+extern int rtnl_addr_delete(struct nl_sock *,
+ struct rtnl_addr *, int);
+
+%cstring_output_maxsize(char *buf, size_t len)
+extern char * rtnl_addr_flags2str(int, char *buf, size_t len);
+extern int rtnl_addr_str2flags(const char *);
+
+extern int rtnl_addr_set_label(struct rtnl_addr *, const char *);
+extern char * rtnl_addr_get_label(struct rtnl_addr *);
+
+extern void rtnl_addr_set_ifindex(struct rtnl_addr *, int);
+extern int rtnl_addr_get_ifindex(struct rtnl_addr *);
+
+extern void rtnl_addr_set_link(struct rtnl_addr *, struct rtnl_link *);
+extern struct rtnl_link *
+ rtnl_addr_get_link(struct rtnl_addr *);
+extern void rtnl_addr_set_family(struct rtnl_addr *, int);
+extern int rtnl_addr_get_family(struct rtnl_addr *);
+
+extern void rtnl_addr_set_prefixlen(struct rtnl_addr *, int);
+extern int rtnl_addr_get_prefixlen(struct rtnl_addr *);
+
+extern void rtnl_addr_set_scope(struct rtnl_addr *, int);
+extern int rtnl_addr_get_scope(struct rtnl_addr *);
+
+extern void rtnl_addr_set_flags(struct rtnl_addr *, unsigned int);
+extern void rtnl_addr_unset_flags(struct rtnl_addr *, unsigned int);
+extern unsigned int rtnl_addr_get_flags(struct rtnl_addr *);
+
+extern int rtnl_addr_set_local(struct rtnl_addr *,
+ struct nl_addr *);
+extern struct nl_addr *rtnl_addr_get_local(struct rtnl_addr *);
+
+extern int rtnl_addr_set_peer(struct rtnl_addr *, struct nl_addr *);
+extern struct nl_addr *rtnl_addr_get_peer(struct rtnl_addr *);
+
+extern int rtnl_addr_set_broadcast(struct rtnl_addr *, struct nl_addr *);
+extern struct nl_addr *rtnl_addr_get_broadcast(struct rtnl_addr *);
+
+extern int rtnl_addr_set_multicast(struct rtnl_addr *, struct nl_addr *);
+extern struct nl_addr *rtnl_addr_get_multicast(struct rtnl_addr *);
+
+extern int rtnl_addr_set_anycast(struct rtnl_addr *, struct nl_addr *);
+extern struct nl_addr *rtnl_addr_get_anycast(struct rtnl_addr *);
+
+extern uint32_t rtnl_addr_get_valid_lifetime(struct rtnl_addr *);
+extern void rtnl_addr_set_valid_lifetime(struct rtnl_addr *, uint32_t);
+extern uint32_t rtnl_addr_get_preferred_lifetime(struct rtnl_addr *);
+extern void rtnl_addr_set_preferred_lifetime(struct rtnl_addr *, uint32_t);
+extern uint32_t rtnl_addr_get_create_time(struct rtnl_addr *);
+extern uint32_t rtnl_addr_get_last_update_time(struct rtnl_addr *);
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/link.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/link.py
new file mode 100644
index 0000000..5ec14b2
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/link.py
@@ -0,0 +1,551 @@
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""Module providing access to network links
+
+This module provides an interface to view configured network links,
+modify them and to add and delete virtual network links.
+
+The following is a basic example:
+ import netlink.core as netlink
+ import netlink.route.link as link
+
+ sock = netlink.Socket()
+ sock.connect(netlink.NETLINK_ROUTE)
+
+ cache = link.LinkCache() # create new empty link cache
+ cache.refill(sock) # fill cache with all configured links
+ eth0 = cache['eth0'] # lookup link "eth0"
+ print eth0 # print basic configuration
+
+The module contains the following public classes:
+
+ - Link -- Represents a network link. Instances can be created directly
+ via the constructor (empty link objects) or via the refill()
+ method of a LinkCache.
+ - LinkCache -- Derived from netlink.Cache, holds any number of
+ network links (Link instances). Main purpose is to keep
+ a local list of all network links configured in the
+ kernel.
+
+The following public functions exist:
+ - get_from_kernel(socket, name)
+
+"""
+
+from __future__ import absolute_import
+
+__version__ = '0.1'
+__all__ = [
+ 'LinkCache',
+ 'Link',
+ 'get_from_kernel',
+]
+
+import socket
+from .. import core as netlink
+from .. import capi as core_capi
+from . import capi as capi
+from .links import inet as inet
+from .. import util as util
+
+# Link statistics definitions
+RX_PACKETS = 0
+TX_PACKETS = 1
+RX_BYTES = 2
+TX_BYTES = 3
+RX_ERRORS = 4
+TX_ERRORS = 5
+RX_DROPPED = 6
+TX_DROPPED = 7
+RX_COMPRESSED = 8
+TX_COMPRESSED = 9
+RX_FIFO_ERR = 10
+TX_FIFO_ERR = 11
+RX_LEN_ERR = 12
+RX_OVER_ERR = 13
+RX_CRC_ERR = 14
+RX_FRAME_ERR = 15
+RX_MISSED_ERR = 16
+TX_ABORT_ERR = 17
+TX_CARRIER_ERR = 18
+TX_HBEAT_ERR = 19
+TX_WIN_ERR = 20
+COLLISIONS = 21
+MULTICAST = 22
+IP6_INPKTS = 23
+IP6_INHDRERRORS = 24
+IP6_INTOOBIGERRORS = 25
+IP6_INNOROUTES = 26
+IP6_INADDRERRORS = 27
+IP6_INUNKNOWNPROTOS = 28
+IP6_INTRUNCATEDPKTS = 29
+IP6_INDISCARDS = 30
+IP6_INDELIVERS = 31
+IP6_OUTFORWDATAGRAMS = 32
+IP6_OUTPKTS = 33
+IP6_OUTDISCARDS = 34
+IP6_OUTNOROUTES = 35
+IP6_REASMTIMEOUT = 36
+IP6_REASMREQDS = 37
+IP6_REASMOKS = 38
+IP6_REASMFAILS = 39
+IP6_FRAGOKS = 40
+IP6_FRAGFAILS = 41
+IP6_FRAGCREATES = 42
+IP6_INMCASTPKTS = 43
+IP6_OUTMCASTPKTS = 44
+IP6_INBCASTPKTS = 45
+IP6_OUTBCASTPKTS = 46
+IP6_INOCTETS = 47
+IP6_OUTOCTETS = 48
+IP6_INMCASTOCTETS = 49
+IP6_OUTMCASTOCTETS = 50
+IP6_INBCASTOCTETS = 51
+IP6_OUTBCASTOCTETS = 52
+ICMP6_INMSGS = 53
+ICMP6_INERRORS = 54
+ICMP6_OUTMSGS = 55
+ICMP6_OUTERRORS = 56
+
+class LinkCache(netlink.Cache):
+ """Cache of network links"""
+
+ def __init__(self, family=socket.AF_UNSPEC, cache=None):
+ if not cache:
+ cache = self._alloc_cache_name('route/link')
+
+ self._info_module = None
+ self._protocol = netlink.NETLINK_ROUTE
+ self._nl_cache = cache
+ self._set_arg1(family)
+
+ def __getitem__(self, key):
+ if type(key) is int:
+ link = capi.rtnl_link_get(self._nl_cache, key)
+ else:
+ link = capi.rtnl_link_get_by_name(self._nl_cache, key)
+
+ if link is None:
+ raise KeyError()
+ else:
+ return Link.from_capi(link)
+
+ @staticmethod
+ def _new_object(obj):
+ return Link(obj)
+
+ def _new_cache(self, cache):
+ return LinkCache(family=self.arg1, cache=cache)
+
+class Link(netlink.Object):
+ """Network link"""
+
+ def __init__(self, obj=None):
+ netlink.Object.__init__(self, 'route/link', 'link', obj)
+ self._rtnl_link = self._obj2type(self._nl_object)
+
+ if self.type:
+ self._module_lookup('netlink.route.links.' + self.type)
+
+ self.inet = inet.InetLink(self)
+ self.af = {'inet' : self.inet }
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, tb):
+ if exc_type is None:
+ self.change()
+ else:
+ return false
+
+ @classmethod
+ def from_capi(cls, obj):
+ return cls(capi.link2obj(obj))
+
+ @staticmethod
+ def _obj2type(obj):
+ return capi.obj2link(obj)
+
+ def __cmp__(self, other):
+ return self.ifindex - other.ifindex
+
+ @staticmethod
+ def _new_instance(obj):
+ if not obj:
+ raise ValueError()
+
+ return Link(obj)
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def ifindex(self):
+ """interface index"""
+ return capi.rtnl_link_get_ifindex(self._rtnl_link)
+
+ @ifindex.setter
+ def ifindex(self, value):
+ capi.rtnl_link_set_ifindex(self._rtnl_link, int(value))
+
+ # ifindex is immutable but we assume that if _orig does not
+ # have an ifindex specified, it was meant to be given here
+ if capi.rtnl_link_get_ifindex(self._orig) == 0:
+ capi.rtnl_link_set_ifindex(self._orig, int(value))
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.bold)
+ def name(self):
+ """Name of link"""
+ return capi.rtnl_link_get_name(self._rtnl_link)
+
+ @name.setter
+ def name(self, value):
+ capi.rtnl_link_set_name(self._rtnl_link, value)
+
+ # name is the secondary identifier, if _orig does not have
+ # the name specified yet, assume it was meant to be specified
+ # here. ifindex will always take priority, therefore if ifindex
+ # is specified as well, this will be ignored automatically.
+ if capi.rtnl_link_get_name(self._orig) is None:
+ capi.rtnl_link_set_name(self._orig, value)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.string)
+ def flags(self):
+ """Flags
+ Setting this property will *Not* reset flags to value you supply in
+ Examples:
+ link.flags = '+xxx' # add xxx flag
+ link.flags = 'xxx' # exactly the same
+ link.flags = '-xxx' # remove xxx flag
+ link.flags = [ '+xxx', '-yyy' ] # list operation
+ """
+ flags = capi.rtnl_link_get_flags(self._rtnl_link)
+ return capi.rtnl_link_flags2str(flags, 256)[0].split(',')
+
+ def _set_flag(self, flag):
+ if flag.startswith('-'):
+ i = capi.rtnl_link_str2flags(flag[1:])
+ capi.rtnl_link_unset_flags(self._rtnl_link, i)
+ elif flag.startswith('+'):
+ i = capi.rtnl_link_str2flags(flag[1:])
+ capi.rtnl_link_set_flags(self._rtnl_link, i)
+ else:
+ i = capi.rtnl_link_str2flags(flag)
+ capi.rtnl_link_set_flags(self._rtnl_link, i)
+
+ @flags.setter
+ def flags(self, value):
+ if not (type(value) is str):
+ for flag in value:
+ self._set_flag(flag)
+ else:
+ self._set_flag(value)
+
+ @property
+ @netlink.nlattr(type=int, fmt=util.num)
+ def mtu(self):
+ """Maximum Transmission Unit"""
+ return capi.rtnl_link_get_mtu(self._rtnl_link)
+
+ @mtu.setter
+ def mtu(self, value):
+ capi.rtnl_link_set_mtu(self._rtnl_link, int(value))
+
+ @property
+ @netlink.nlattr(type=int, immutable=True, fmt=util.num)
+ def family(self):
+ """Address family"""
+ return capi.rtnl_link_get_family(self._rtnl_link)
+
+ @family.setter
+ def family(self, value):
+ capi.rtnl_link_set_family(self._rtnl_link, value)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.addr)
+ def address(self):
+ """Hardware address (MAC address)"""
+ a = capi.rtnl_link_get_addr(self._rtnl_link)
+ return netlink.AbstractAddress(a)
+
+ @address.setter
+ def address(self, value):
+ capi.rtnl_link_set_addr(self._rtnl_link, value._addr)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.addr)
+ def broadcast(self):
+ """Hardware broadcast address"""
+ a = capi.rtnl_link_get_broadcast(self._rtnl_link)
+ return netlink.AbstractAddress(a)
+
+ @broadcast.setter
+ def broadcast(self, value):
+ capi.rtnl_link_set_broadcast(self._rtnl_link, value._addr)
+
+ @property
+ @netlink.nlattr(type=str, immutable=True, fmt=util.string)
+ def qdisc(self):
+ """Name of qdisc (cannot be changed)"""
+ return capi.rtnl_link_get_qdisc(self._rtnl_link)
+
+ @qdisc.setter
+ def qdisc(self, value):
+ capi.rtnl_link_set_qdisc(self._rtnl_link, value)
+
+ @property
+ @netlink.nlattr(type=int, fmt=util.num)
+ def txqlen(self):
+ """Length of transmit queue"""
+ return capi.rtnl_link_get_txqlen(self._rtnl_link)
+
+ @txqlen.setter
+ def txqlen(self, value):
+ capi.rtnl_link_set_txqlen(self._rtnl_link, int(value))
+
+ @property
+ @netlink.nlattr(type=str, immutable=True, fmt=util.string)
+ def arptype(self):
+ """Type of link (cannot be changed)"""
+ type_ = capi.rtnl_link_get_arptype(self._rtnl_link)
+ return core_capi.nl_llproto2str(type_, 64)[0]
+
+ @arptype.setter
+ def arptype(self, value):
+ i = core_capi.nl_str2llproto(value)
+ capi.rtnl_link_set_arptype(self._rtnl_link, i)
+
+ @property
+ @netlink.nlattr(type=str, immutable=True, fmt=util.string, title='state')
+ def operstate(self):
+ """Operational status"""
+ operstate = capi.rtnl_link_get_operstate(self._rtnl_link)
+ return capi.rtnl_link_operstate2str(operstate, 32)[0]
+
+ @operstate.setter
+ def operstate(self, value):
+ i = capi.rtnl_link_str2operstate(value)
+ capi.rtnl_link_set_operstate(self._rtnl_link, i)
+
+ @property
+ @netlink.nlattr(type=str, immutable=True, fmt=util.string)
+ def mode(self):
+ """Link mode"""
+ mode = capi.rtnl_link_get_linkmode(self._rtnl_link)
+ return capi.rtnl_link_mode2str(mode, 32)[0]
+
+ @mode.setter
+ def mode(self, value):
+ i = capi.rtnl_link_str2mode(value)
+ capi.rtnl_link_set_linkmode(self._rtnl_link, i)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.string)
+ def alias(self):
+ """Interface alias (SNMP)"""
+ return capi.rtnl_link_get_ifalias(self._rtnl_link)
+
+ @alias.setter
+ def alias(self, value):
+ capi.rtnl_link_set_ifalias(self._rtnl_link, value)
+
+ @property
+ @netlink.nlattr(type=str, fmt=util.string)
+ def type(self):
+ """Link type"""
+ return capi.rtnl_link_get_type(self._rtnl_link)
+
+ @type.setter
+ def type(self, value):
+ if capi.rtnl_link_set_type(self._rtnl_link, value) < 0:
+ raise NameError('unknown info type')
+
+ self._module_lookup('netlink.route.links.' + value)
+
+ def get_stat(self, stat):
+ """Retrieve statistical information"""
+ if type(stat) is str:
+ stat = capi.rtnl_link_str2stat(stat)
+ if stat < 0:
+ raise NameError('unknown name of statistic')
+
+ return capi.rtnl_link_get_stat(self._rtnl_link, stat)
+
+ def enslave(self, slave, sock=None):
+ if not sock:
+ sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
+
+ return capi.rtnl_link_enslave(sock._sock, self._rtnl_link, slave._rtnl_link)
+
+ def release(self, slave, sock=None):
+ if not sock:
+ sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
+
+ return capi.rtnl_link_release(sock._sock, self._rtnl_link, slave._rtnl_link)
+
+ def add(self, sock=None, flags=None):
+ if not sock:
+ sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
+
+ if not flags:
+ flags = netlink.NLM_F_CREATE
+
+ ret = capi.rtnl_link_add(sock._sock, self._rtnl_link, flags)
+ if ret < 0:
+ raise netlink.KernelError(ret)
+
+ def change(self, sock=None, flags=0):
+ """Commit changes made to the link object"""
+ if sock is None:
+ sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
+
+ if not self._orig:
+ raise netlink.NetlinkError('Original link not available')
+ ret = capi.rtnl_link_change(sock._sock, self._orig, self._rtnl_link, flags)
+ if ret < 0:
+ raise netlink.KernelError(ret)
+
+ def delete(self, sock=None):
+ """Attempt to delete this link in the kernel"""
+ if sock is None:
+ sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
+
+ ret = capi.rtnl_link_delete(sock._sock, self._rtnl_link)
+ if ret < 0:
+ raise netlink.KernelError(ret)
+
+ ###################################################################
+ # private properties
+ #
+ # Used for formatting output. USE AT OWN RISK
+ @property
+ def _state(self):
+ if 'up' in self.flags:
+ buf = util.good('up')
+ if 'lowerup' not in self.flags:
+ buf += ' ' + util.bad('no-carrier')
+ else:
+ buf = util.bad('down')
+ return buf
+
+ @property
+ def _brief(self):
+ return self._module_brief() + self._foreach_af('brief')
+
+ @property
+ def _flags(self):
+ ignore = [
+ 'up',
+ 'running',
+ 'lowerup',
+ ]
+ return ','.join([flag for flag in self.flags if flag not in ignore])
+
+ def _foreach_af(self, name, args=None):
+ buf = ''
+ for af in self.af:
+ try:
+ func = getattr(self.af[af], name)
+ s = str(func(args))
+ if len(s) > 0:
+ buf += ' ' + s
+ except AttributeError:
+ pass
+ return buf
+
+ def format(self, details=False, stats=False, indent=''):
+ """Return link as formatted text"""
+ fmt = util.MyFormatter(self, indent)
+
+ buf = fmt.format('{a|ifindex} {a|name} {a|arptype} {a|address} '\
+ '{a|_state} <{a|_flags}> {a|_brief}')
+
+ if details:
+ buf += fmt.nl('\t{t|mtu} {t|txqlen} {t|weight} '\
+ '{t|qdisc} {t|operstate}')
+ buf += fmt.nl('\t{t|broadcast} {t|alias}')
+
+ buf += self._foreach_af('details', fmt)
+
+ if stats:
+ l = [['Packets', RX_PACKETS, TX_PACKETS],
+ ['Bytes', RX_BYTES, TX_BYTES],
+ ['Errors', RX_ERRORS, TX_ERRORS],
+ ['Dropped', RX_DROPPED, TX_DROPPED],
+ ['Compressed', RX_COMPRESSED, TX_COMPRESSED],
+ ['FIFO Errors', RX_FIFO_ERR, TX_FIFO_ERR],
+ ['Length Errors', RX_LEN_ERR, None],
+ ['Over Errors', RX_OVER_ERR, None],
+ ['CRC Errors', RX_CRC_ERR, None],
+ ['Frame Errors', RX_FRAME_ERR, None],
+ ['Missed Errors', RX_MISSED_ERR, None],
+ ['Abort Errors', None, TX_ABORT_ERR],
+ ['Carrier Errors', None, TX_CARRIER_ERR],
+ ['Heartbeat Errors', None, TX_HBEAT_ERR],
+ ['Window Errors', None, TX_WIN_ERR],
+ ['Collisions', None, COLLISIONS],
+ ['Multicast', None, MULTICAST],
+ ['', None, None],
+ ['Ipv6:', None, None],
+ ['Packets', IP6_INPKTS, IP6_OUTPKTS],
+ ['Bytes', IP6_INOCTETS, IP6_OUTOCTETS],
+ ['Discards', IP6_INDISCARDS, IP6_OUTDISCARDS],
+ ['Multicast Packets', IP6_INMCASTPKTS, IP6_OUTMCASTPKTS],
+ ['Multicast Bytes', IP6_INMCASTOCTETS, IP6_OUTMCASTOCTETS],
+ ['Broadcast Packets', IP6_INBCASTPKTS, IP6_OUTBCASTPKTS],
+ ['Broadcast Bytes', IP6_INBCASTOCTETS, IP6_OUTBCASTOCTETS],
+ ['Delivers', IP6_INDELIVERS, None],
+ ['Forwarded', None, IP6_OUTFORWDATAGRAMS],
+ ['No Routes', IP6_INNOROUTES, IP6_OUTNOROUTES],
+ ['Header Errors', IP6_INHDRERRORS, None],
+ ['Too Big Errors', IP6_INTOOBIGERRORS, None],
+ ['Address Errors', IP6_INADDRERRORS, None],
+ ['Unknown Protocol', IP6_INUNKNOWNPROTOS, None],
+ ['Truncated Packets', IP6_INTRUNCATEDPKTS, None],
+ ['Reasm Timeouts', IP6_REASMTIMEOUT, None],
+ ['Reasm Requests', IP6_REASMREQDS, None],
+ ['Reasm Failures', IP6_REASMFAILS, None],
+ ['Reasm OK', IP6_REASMOKS, None],
+ ['Frag Created', None, IP6_FRAGCREATES],
+ ['Frag Failures', None, IP6_FRAGFAILS],
+ ['Frag OK', None, IP6_FRAGOKS],
+ ['', None, None],
+ ['ICMPv6:', None, None],
+ ['Messages', ICMP6_INMSGS, ICMP6_OUTMSGS],
+ ['Errors', ICMP6_INERRORS, ICMP6_OUTERRORS]]
+
+ buf += '\n\t%s%s%s%s\n' % (33 * ' ', util.title('RX'),
+ 15 * ' ', util.title('TX'))
+
+ for row in l:
+ row[0] = util.kw(row[0])
+ row[1] = self.get_stat(row[1]) if row[1] else ''
+ row[2] = self.get_stat(row[2]) if row[2] else ''
+ buf += '\t{0[0]:27} {0[1]:>16} {0[2]:>16}\n'.format(row)
+
+ buf += self._foreach_af('stats')
+
+ return buf
+
+def get(name, sock=None):
+ """Lookup Link object directly from kernel"""
+ if not name:
+ raise ValueError()
+
+ if not sock:
+ sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
+
+ link = capi.get_from_kernel(sock._sock, 0, name)
+ if not link:
+ return None
+
+ return Link.from_capi(link)
+
+_link_cache = LinkCache()
+
+def resolve(name):
+ _link_cache.refill()
+ return _link_cache[name]
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/__init__.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/__init__.py
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/dummy.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/dummy.py
new file mode 100644
index 0000000..e9491cc
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/dummy.py
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""Dummy
+
+"""
+from __future__ import absolute_import
+
+__version__ = '1.0'
+__all__ = [
+ 'init',
+]
+
+
+class DummyLink(object):
+ def __init__(self, link):
+ self._rtnl_link = link
+
+ @staticmethod
+ def brief():
+ return 'dummy'
+
+def init(link):
+ link.dummy = DummyLink(link._rtnl_link)
+ return link.dummy
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/inet.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/inet.py
new file mode 100644
index 0000000..f5f45cb
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/inet.py
@@ -0,0 +1,158 @@
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""IPv4
+
+"""
+
+from __future__ import absolute_import
+
+__all__ = [
+ '',
+]
+
+from ... import core as netlink
+from .. import capi as capi
+from ... import util as util
+DEVCONF_FORWARDING = 1
+DEVCONF_MC_FORWARDING = 2
+DEVCONF_PROXY_ARP = 3
+DEVCONF_ACCEPT_REDIRECTS = 4
+DEVCONF_SECURE_REDIRECTS = 5
+DEVCONF_SEND_REDIRECTS = 6
+DEVCONF_SHARED_MEDIA = 7
+DEVCONF_RP_FILTER = 8
+DEVCONF_ACCEPT_SOURCE_ROUTE = 9
+DEVCONF_BOOTP_RELAY = 10
+DEVCONF_LOG_MARTIANS = 11
+DEVCONF_TAG = 12
+DEVCONF_ARPFILTER = 13
+DEVCONF_MEDIUM_ID = 14
+DEVCONF_NOXFRM = 15
+DEVCONF_NOPOLICY = 16
+DEVCONF_FORCE_IGMP_VERSION = 17
+DEVCONF_ARP_ANNOUNCE = 18
+DEVCONF_ARP_IGNORE = 19
+DEVCONF_PROMOTE_SECONDARIES = 20
+DEVCONF_ARP_ACCEPT = 21
+DEVCONF_ARP_NOTIFY = 22
+DEVCONF_ACCEPT_LOCAL = 23
+DEVCONF_SRC_VMARK = 24
+DEVCONF_PROXY_ARP_PVLAN = 25
+DEVCONF_MAX = DEVCONF_PROXY_ARP_PVLAN
+
+def _resolve(id):
+ if type(id) is str:
+ id = capi.rtnl_link_inet_str2devconf(id)[0]
+ if id < 0:
+ raise NameError('unknown configuration id')
+ return id
+
+class InetLink(object):
+ def __init__(self, link):
+ self._link = link
+
+ def details(self, fmt):
+ buf = fmt.nl('\n\t{0}\n\t'.format(util.title('Configuration:')))
+
+ for i in range(DEVCONF_FORWARDING, DEVCONF_MAX+1):
+ if i & 1 and i > 1:
+ buf += fmt.nl('\t')
+ txt = util.kw(capi.rtnl_link_inet_devconf2str(i, 32)[0])
+ buf += fmt.format('{0:28s} {1:12} ', txt,
+ self.get_conf(i))
+
+
+ return buf
+
+ def get_conf(self, id):
+ return capi.inet_get_conf(self._link._rtnl_link, _resolve(id))
+
+ def set_conf(self, id, value):
+ return capi.rtnl_link_inet_set_conf(self._link._rtnl_link,
+ _resolve(id), int(value))
+
+ @property
+ @netlink.nlattr(type=bool, fmt=util.boolean)
+ def forwarding(self):
+ return bool(self.get_conf(DEVCONF_FORWARDING))
+
+ @forwarding.setter
+ def forwarding(self, value):
+ self.set_conf(DEVCONF_FORWARDING, int(value))
+
+
+ @property
+ @netlink.nlattr(type=bool, fmt=util.boolean)
+ def mc_forwarding(self):
+ return bool(self.get_conf(DEVCONF_MC_FORWARDING))
+
+ @mc_forwarding.setter
+ def mc_forwarding(self, value):
+ self.set_conf(DEVCONF_MC_FORWARDING, int(value))
+
+
+ @property
+ @netlink.nlattr(type=bool, fmt=util.boolean)
+ def proxy_arp(self):
+ return bool(self.get_conf(DEVCONF_PROXY_ARP))
+
+ @proxy_arp.setter
+ def proxy_arp(self, value):
+ self.set_conf(DEVCONF_PROXY_ARP, int(value))
+
+ @property
+ @netlink.nlattr(type=bool, fmt=util.boolean)
+ def accept_redirects(self):
+ return bool(self.get_conf(DEVCONF_ACCEPT_REDIRECTS))
+
+ @accept_redirects.setter
+ def accept_redirects(self, value):
+ self.set_conf(DEVCONF_ACCEPT_REDIRECTS, int(value))
+
+ @property
+ @netlink.nlattr(type=bool, fmt=util.boolean)
+ def secure_redirects(self):
+ return bool(self.get_conf(DEVCONF_SECURE_REDIRECTS))
+
+ @secure_redirects.setter
+ def secure_redirects(self, value):
+ self.set_conf(DEVCONF_SECURE_REDIRECTS, int(value))
+
+ @property
+ @netlink.nlattr(type=bool, fmt=util.boolean)
+ def send_redirects(self):
+ return bool(self.get_conf(DEVCONF_SEND_REDIRECTS))
+
+ @send_redirects.setter
+ def send_redirects(self, value):
+ self.set_conf(DEVCONF_SEND_REDIRECTS, int(value))
+
+ @property
+ @netlink.nlattr(type=bool, fmt=util.boolean)
+ def shared_media(self):
+ return bool(self.get_conf(DEVCONF_SHARED_MEDIA))
+
+ @shared_media.setter
+ def shared_media(self, value):
+ self.set_conf(DEVCONF_SHARED_MEDIA, int(value))
+
+# IPV4_DEVCONF_RP_FILTER,
+# IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
+# IPV4_DEVCONF_BOOTP_RELAY,
+# IPV4_DEVCONF_LOG_MARTIANS,
+# IPV4_DEVCONF_TAG,
+# IPV4_DEVCONF_ARPFILTER,
+# IPV4_DEVCONF_MEDIUM_ID,
+# IPV4_DEVCONF_NOXFRM,
+# IPV4_DEVCONF_NOPOLICY,
+# IPV4_DEVCONF_FORCE_IGMP_VERSION,
+# IPV4_DEVCONF_ARP_ANNOUNCE,
+# IPV4_DEVCONF_ARP_IGNORE,
+# IPV4_DEVCONF_PROMOTE_SECONDARIES,
+# IPV4_DEVCONF_ARP_ACCEPT,
+# IPV4_DEVCONF_ARP_NOTIFY,
+# IPV4_DEVCONF_ACCEPT_LOCAL,
+# IPV4_DEVCONF_SRC_VMARK,
+# IPV4_DEVCONF_PROXY_ARP_PVLAN,
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/vlan.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/vlan.py
new file mode 100644
index 0000000..0ba3781
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/links/vlan.py
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""VLAN network link
+
+"""
+
+from __future__ import absolute_import
+
+
+from ... import core as netlink
+from .. import capi as capi
+class VLANLink(object):
+ def __init__(self, link):
+ self._link = link
+
+ @property
+ @netlink.nlattr(type=int)
+ def id(self):
+ """vlan identifier"""
+ return capi.rtnl_link_vlan_get_id(self._link)
+
+ @id.setter
+ def id(self, value):
+ capi.rtnl_link_vlan_set_id(self._link, int(value))
+
+ @property
+ @netlink.nlattr(type=str)
+ def flags(self):
+ """ VLAN flags
+ Setting this property will *Not* reset flags to value you supply in
+ Examples:
+ link.flags = '+xxx' # add xxx flag
+ link.flags = 'xxx' # exactly the same
+ link.flags = '-xxx' # remove xxx flag
+ link.flags = [ '+xxx', '-yyy' ] # list operation
+ """
+ flags = capi.rtnl_link_vlan_get_flags(self._link)
+ return capi.rtnl_link_vlan_flags2str(flags, 256)[0].split(',')
+
+ def _set_flag(self, flag):
+ if flag.startswith('-'):
+ i = capi.rtnl_link_vlan_str2flags(flag[1:])
+ capi.rtnl_link_vlan_unset_flags(self._link, i)
+ elif flag.startswith('+'):
+ i = capi.rtnl_link_vlan_str2flags(flag[1:])
+ capi.rtnl_link_vlan_set_flags(self._link, i)
+ else:
+ i = capi.rtnl_link_vlan_str2flags(flag)
+ capi.rtnl_link_vlan_set_flags(self._link, i)
+
+ @flags.setter
+ def flags(self, value):
+ if type(value) is list:
+ for flag in value:
+ self._set_flag(flag)
+ else:
+ self._set_flag(value)
+
+ ###################################################################
+ # TODO:
+ # - ingress map
+ # - egress map
+
+ def brief(self):
+ return 'vlan-id {0}'.format(self.id)
+
+def init(link):
+ link.vlan = VLANLink(link._rtnl_link)
+ return link.vlan
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/qdisc/__init__.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/qdisc/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/qdisc/__init__.py
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/qdisc/htb.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/qdisc/htb.py
new file mode 100644
index 0000000..d051c8d
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/qdisc/htb.py
@@ -0,0 +1,145 @@
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""HTB qdisc
+
+"""
+
+from __future__ import absolute_import
+
+from ... import core as netlink
+from ... import util as util
+from .. import capi as capi
+from .. import tc as tc
+
+class HTBQdisc(object):
+ def __init__(self, qdisc):
+ self._qdisc = qdisc
+
+ @property
+ @netlink.nlattr(type=int)
+ def default_class(self):
+ return tc.Handle(capi.rtnl_htb_get_defcls(self._qdisc._rtnl_qdisc))
+
+ @default_class.setter
+ def default_class(self, value):
+ capi.rtnl_htb_set_defcls(self._qdisc._rtnl_qdisc, int(value))
+
+ @property
+ @netlink.nlattr('r2q', type=int)
+ def r2q(self):
+ return capi.rtnl_htb_get_rate2quantum(self._qdisc._rtnl_qdisc)
+
+ @r2q.setter
+ def r2q(self, value):
+ capi.rtnl_htb_get_rate2quantum(self._qdisc._rtnl_qdisc,
+ int(value))
+
+ def brief(self):
+ fmt = util.MyFormatter(self)
+
+ ret = ' {s|default-class!k} {a|default_class}'
+
+ if self.r2q:
+ ret += ' {s|r2q!k} {a|r2q}'
+
+ return fmt.format(ret)
+
+class HTBClass(object):
+ def __init__(self, cl):
+ self._class = cl
+
+ @property
+ @netlink.nlattr(type=str)
+ def rate(self):
+ rate = capi.rtnl_htb_get_rate(self._class._rtnl_class)
+ return util.Rate(rate)
+
+ @rate.setter
+ def rate(self, value):
+ capi.rtnl_htb_set_rate(self._class._rtnl_class, int(value))
+
+ @property
+ @netlink.nlattr(type=str)
+ def ceil(self):
+ ceil = capi.rtnl_htb_get_ceil(self._class._rtnl_class)
+ return util.Rate(ceil)
+
+ @ceil.setter
+ def ceil(self, value):
+ capi.rtnl_htb_set_ceil(self._class._rtnl_class, int(value))
+
+ @property
+ @netlink.nlattr(type=str)
+ def burst(self):
+ burst = capi.rtnl_htb_get_rbuffer(self._class._rtnl_class)
+ return util.Size(burst)
+
+ @burst.setter
+ def burst(self, value):
+ capi.rtnl_htb_set_rbuffer(self._class._rtnl_class, int(value))
+
+ @property
+ @netlink.nlattr(type=str)
+ def ceil_burst(self):
+ burst = capi.rtnl_htb_get_cbuffer(self._class._rtnl_class)
+ return util.Size(burst)
+
+ @ceil_burst.setter
+ def ceil_burst(self, value):
+ capi.rtnl_htb_set_cbuffer(self._class._rtnl_class, int(value))
+
+ @property
+ @netlink.nlattr(type=int)
+ def prio(self):
+ return capi.rtnl_htb_get_prio(self._class._rtnl_class)
+
+ @prio.setter
+ def prio(self, value):
+ capi.rtnl_htb_set_prio(self._class._rtnl_class, int(value))
+
+ @property
+ @netlink.nlattr(type=int)
+ def quantum(self):
+ return capi.rtnl_htb_get_quantum(self._class._rtnl_class)
+
+ @quantum.setter
+ def quantum(self, value):
+ capi.rtnl_htb_set_quantum(self._class._rtnl_class, int(value))
+
+ @property
+ @netlink.nlattr(type=int)
+ def level(self):
+ return capi.rtnl_htb_get_level(self._class._rtnl_class)
+
+ @level.setter
+ def level(self, value):
+ capi.rtnl_htb_set_level(self._class._rtnl_class, int(value))
+
+ def brief(self):
+ fmt = util.MyFormatter(self)
+
+ ret = ' {t|prio} {t|rate}'
+
+ if self.rate != self.ceil:
+ ret += ' {s|borrow-up-to!k} {a|ceil}'
+
+ ret += ' {t|burst}'
+
+ return fmt.format(ret)
+
+ def details(self):
+ fmt = util.MyFormatter(self)
+
+ return fmt.nl('\t{t|level} {t|quantum}')
+
+def init_qdisc(qdisc):
+ qdisc.htb = HTBQdisc(qdisc)
+ return qdisc.htb
+
+def init_class(cl):
+ cl.htb = HTBClass(cl)
+ return cl.htb
+
+#extern void rtnl_htb_set_quantum(struct rtnl_class *, uint32_t quantum);
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/route/tc.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/tc.py
new file mode 100644
index 0000000..0689b71
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/route/tc.py
@@ -0,0 +1,595 @@
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+from __future__ import absolute_import
+
+__all__ = [
+ 'TcCache',
+ 'Tc',
+ 'QdiscCache',
+ 'Qdisc',
+ 'TcClassCache',
+ 'TcClass',
+]
+
+from .. import core as netlink
+from . import capi as capi
+from .. import util as util
+from . import link as Link
+
+TC_PACKETS = 0
+TC_BYTES = 1
+TC_RATE_BPS = 2
+TC_RATE_PPS = 3
+TC_QLEN = 4
+TC_BACKLOG = 5
+TC_DROPS = 6
+TC_REQUEUES = 7
+TC_OVERLIMITS = 9
+
+TC_H_ROOT = 0xFFFFFFFF
+TC_H_INGRESS = 0xFFFFFFF1
+
+STAT_PACKETS = 0
+STAT_BYTES = 1
+STAT_RATE_BPS = 2
+STAT_RATE_PPS = 3
+STAT_QLEN = 4
+STAT_BACKLOG = 5
+STAT_DROPS = 6
+STAT_REQUEUES = 7
+STAT_OVERLIMITS = 8
+STAT_MAX = STAT_OVERLIMITS
+
+
+class Handle(object):
+ """ Traffic control handle
+
+ Representation of a traffic control handle which uniquely identifies
+ each traffic control object in its link namespace.
+
+ handle = tc.Handle('10:20')
+ handle = tc.handle('root')
+ print int(handle)
+ print str(handle)
+ """
+ def __init__(self, val=None):
+ if type(val) is str:
+ val = capi.tc_str2handle(val)
+ elif not val:
+ val = 0
+
+ self._val = int(val)
+
+ def __cmp__(self, other):
+ if other is None:
+ other = 0
+
+ if isinstance(other, Handle):
+ return int(self) - int(other)
+ elif isinstance(other, int):
+ return int(self) - other
+ else:
+ raise TypeError()
+
+ def __int__(self):
+ return self._val
+
+ def __str__(self):
+ return capi.rtnl_tc_handle2str(self._val, 64)[0]
+
+ def isroot(self):
+ return self._val == TC_H_ROOT or self._val == TC_H_INGRESS
+
+class TcCache(netlink.Cache):
+ """Cache of traffic control object"""
+
+ def __getitem__(self, key):
+ raise NotImplementedError()
+
+class Tc(netlink.Object):
+ def __cmp__(self, other):
+ diff = self.ifindex - other.ifindex
+ if diff == 0:
+ diff = int(self.handle) - int(other.handle)
+ return diff
+
+ def _tc_module_lookup(self):
+ self._module_lookup(self._module_path + self.kind,
+ 'init_' + self._name)
+
+ @property
+ def root(self):
+ """True if tc object is a root object"""
+ return self.parent.isroot()
+
+ @property
+ def ifindex(self):
+ """interface index"""
+ return capi.rtnl_tc_get_ifindex(self._rtnl_tc)
+
+ @ifindex.setter
+ def ifindex(self, value):
+ capi.rtnl_tc_set_ifindex(self._rtnl_tc, int(value))
+
+ @property
+ def link(self):
+ link = capi.rtnl_tc_get_link(self._rtnl_tc)
+ if not link:
+ return None
+
+ return Link.Link.from_capi(link)
+
+ @link.setter
+ def link(self, value):
+ capi.rtnl_tc_set_link(self._rtnl_tc, value._link)
+
+ @property
+ def mtu(self):
+ return capi.rtnl_tc_get_mtu(self._rtnl_tc)
+
+ @mtu.setter
+ def mtu(self, value):
+ capi.rtnl_tc_set_mtu(self._rtnl_tc, int(value))
+
+ @property
+ def mpu(self):
+ return capi.rtnl_tc_get_mpu(self._rtnl_tc)
+
+ @mpu.setter
+ def mpu(self, value):
+ capi.rtnl_tc_set_mpu(self._rtnl_tc, int(value))
+
+ @property
+ def overhead(self):
+ return capi.rtnl_tc_get_overhead(self._rtnl_tc)
+
+ @overhead.setter
+ def overhead(self, value):
+ capi.rtnl_tc_set_overhead(self._rtnl_tc, int(value))
+
+ @property
+ def linktype(self):
+ return capi.rtnl_tc_get_linktype(self._rtnl_tc)
+
+ @linktype.setter
+ def linktype(self, value):
+ capi.rtnl_tc_set_linktype(self._rtnl_tc, int(value))
+
+ @property
+ @netlink.nlattr(fmt=util.handle)
+ def handle(self):
+ return Handle(capi.rtnl_tc_get_handle(self._rtnl_tc))
+
+ @handle.setter
+ def handle(self, value):
+ capi.rtnl_tc_set_handle(self._rtnl_tc, int(value))
+
+ @property
+ @netlink.nlattr(fmt=util.handle)
+ def parent(self):
+ return Handle(capi.rtnl_tc_get_parent(self._rtnl_tc))
+
+ @parent.setter
+ def parent(self, value):
+ capi.rtnl_tc_set_parent(self._rtnl_tc, int(value))
+
+ @property
+ @netlink.nlattr(fmt=util.bold)
+ def kind(self):
+ return capi.rtnl_tc_get_kind(self._rtnl_tc)
+
+ @kind.setter
+ def kind(self, value):
+ capi.rtnl_tc_set_kind(self._rtnl_tc, value)
+ self._tc_module_lookup()
+
+ def get_stat(self, id):
+ return capi.rtnl_tc_get_stat(self._rtnl_tc, id)
+
+ @property
+ def _dev(self):
+ buf = util.kw('dev') + ' '
+
+ if self.link:
+ return buf + util.string(self.link.name)
+ else:
+ return buf + util.num(self.ifindex)
+
+ def brief(self, title, nodev=False, noparent=False):
+ ret = title + ' {a|kind} {a|handle}'
+
+ if not nodev:
+ ret += ' {a|_dev}'
+
+ if not noparent:
+ ret += ' {t|parent}'
+
+ return ret + self._module_brief()
+
+ @staticmethod
+ def details():
+ return '{t|mtu} {t|mpu} {t|overhead} {t|linktype}'
+
+ @property
+ def packets(self):
+ return self.get_stat(STAT_PACKETS)
+
+ @property
+ def bytes(self):
+ return self.get_stat(STAT_BYTES)
+
+ @property
+ def qlen(self):
+ return self.get_stat(STAT_QLEN)
+
+ @staticmethod
+ def stats(fmt):
+ return fmt.nl('{t|packets} {t|bytes} {t|qlen}')
+
+class QdiscCache(netlink.Cache):
+ """Cache of qdiscs"""
+
+ def __init__(self, cache=None):
+ if not cache:
+ cache = self._alloc_cache_name('route/qdisc')
+
+ self._protocol = netlink.NETLINK_ROUTE
+ self._nl_cache = cache
+
+# def __getitem__(self, key):
+# if type(key) is int:
+# link = capi.rtnl_link_get(self._this, key)
+# elif type(key) is str:
+# link = capi.rtnl_link_get_by_name(self._this, key)
+#
+# if qdisc is None:
+# raise KeyError()
+# else:
+# return Qdisc._from_capi(capi.qdisc2obj(qdisc))
+
+ @staticmethod
+ def _new_object(obj):
+ return Qdisc(obj)
+
+ @staticmethod
+ def _new_cache(cache):
+ return QdiscCache(cache=cache)
+
+class Qdisc(Tc):
+ """Queueing discipline"""
+
+ def __init__(self, obj=None):
+ netlink.Object.__init__(self, 'route/qdisc', 'qdisc', obj)
+ self._module_path = 'netlink.route.qdisc.'
+ self._rtnl_qdisc = self._obj2type(self._nl_object)
+ self._rtnl_tc = capi.obj2tc(self._nl_object)
+
+ if self.kind:
+ self._tc_module_lookup()
+
+ @classmethod
+ def from_capi(cls, obj):
+ return cls(capi.qdisc2obj(obj))
+
+ @staticmethod
+ def _obj2type(obj):
+ return capi.obj2qdisc(obj)
+
+ @staticmethod
+ def _new_instance(obj):
+ if not obj:
+ raise ValueError()
+
+ return Qdisc(obj)
+
+ @property
+ def childs(self):
+ ret = []
+
+ if int(self.handle):
+ ret += get_cls(self.ifindex, parent=self.handle)
+
+ if self.root:
+ ret += get_class(self.ifindex, parent=TC_H_ROOT)
+
+ ret += get_class(self.ifindex, parent=self.handle)
+
+ return ret
+
+# def add(self, socket, flags=None):
+# if not flags:
+# flags = netlink.NLM_F_CREATE
+#
+# ret = capi.rtnl_link_add(socket._sock, self._link, flags)
+# if ret < 0:
+# raise netlink.KernelError(ret)
+#
+# def change(self, socket, flags=0):
+# """Commit changes made to the link object"""
+# if not self._orig:
+# raise NetlinkError('Original link not available')
+# ret = capi.rtnl_link_change(socket._sock, self._orig, self._link, flags)
+# if ret < 0:
+# raise netlink.KernelError(ret)
+#
+# def delete(self, socket):
+# """Attempt to delete this link in the kernel"""
+# ret = capi.rtnl_link_delete(socket._sock, self._link)
+# if ret < 0:
+# raise netlink.KernelError(ret)
+
+ def format(self, details=False, stats=False, nodev=False,
+ noparent=False, indent=''):
+ """Return qdisc as formatted text"""
+ fmt = util.MyFormatter(self, indent)
+
+ buf = fmt.format(self.brief('qdisc', nodev, noparent))
+
+ if details:
+ buf += fmt.nl('\t' + self.details())
+
+ if stats:
+ buf += self.stats(fmt)
+
+# if stats:
+# l = [['Packets', RX_PACKETS, TX_PACKETS],
+# ['Bytes', RX_BYTES, TX_BYTES],
+# ['Errors', RX_ERRORS, TX_ERRORS],
+# ['Dropped', RX_DROPPED, TX_DROPPED],
+# ['Compressed', RX_COMPRESSED, TX_COMPRESSED],
+# ['FIFO Errors', RX_FIFO_ERR, TX_FIFO_ERR],
+# ['Length Errors', RX_LEN_ERR, None],
+# ['Over Errors', RX_OVER_ERR, None],
+# ['CRC Errors', RX_CRC_ERR, None],
+# ['Frame Errors', RX_FRAME_ERR, None],
+# ['Missed Errors', RX_MISSED_ERR, None],
+# ['Abort Errors', None, TX_ABORT_ERR],
+# ['Carrier Errors', None, TX_CARRIER_ERR],
+# ['Heartbeat Errors', None, TX_HBEAT_ERR],
+# ['Window Errors', None, TX_WIN_ERR],
+# ['Collisions', None, COLLISIONS],
+# ['Multicast', None, MULTICAST],
+# ['', None, None],
+# ['Ipv6:', None, None],
+# ['Packets', IP6_INPKTS, IP6_OUTPKTS],
+# ['Bytes', IP6_INOCTETS, IP6_OUTOCTETS],
+# ['Discards', IP6_INDISCARDS, IP6_OUTDISCARDS],
+# ['Multicast Packets', IP6_INMCASTPKTS, IP6_OUTMCASTPKTS],
+# ['Multicast Bytes', IP6_INMCASTOCTETS, IP6_OUTMCASTOCTETS],
+# ['Broadcast Packets', IP6_INBCASTPKTS, IP6_OUTBCASTPKTS],
+# ['Broadcast Bytes', IP6_INBCASTOCTETS, IP6_OUTBCASTOCTETS],
+# ['Delivers', IP6_INDELIVERS, None],
+# ['Forwarded', None, IP6_OUTFORWDATAGRAMS],
+# ['No Routes', IP6_INNOROUTES, IP6_OUTNOROUTES],
+# ['Header Errors', IP6_INHDRERRORS, None],
+# ['Too Big Errors', IP6_INTOOBIGERRORS, None],
+# ['Address Errors', IP6_INADDRERRORS, None],
+# ['Unknown Protocol', IP6_INUNKNOWNPROTOS, None],
+# ['Truncated Packets', IP6_INTRUNCATEDPKTS, None],
+# ['Reasm Timeouts', IP6_REASMTIMEOUT, None],
+# ['Reasm Requests', IP6_REASMREQDS, None],
+# ['Reasm Failures', IP6_REASMFAILS, None],
+# ['Reasm OK', IP6_REASMOKS, None],
+# ['Frag Created', None, IP6_FRAGCREATES],
+# ['Frag Failures', None, IP6_FRAGFAILS],
+# ['Frag OK', None, IP6_FRAGOKS],
+# ['', None, None],
+# ['ICMPv6:', None, None],
+# ['Messages', ICMP6_INMSGS, ICMP6_OUTMSGS],
+# ['Errors', ICMP6_INERRORS, ICMP6_OUTERRORS]]
+#
+# buf += '\n\t%s%s%s%s\n' % (33 * ' ', util.title('RX'),
+# 15 * ' ', util.title('TX'))
+#
+# for row in l:
+# row[0] = util.kw(row[0])
+# row[1] = self.get_stat(row[1]) if row[1] else ''
+# row[2] = self.get_stat(row[2]) if row[2] else ''
+# buf += '\t{0:27} {1:>16} {2:>16}\n'.format(*row)
+
+ return buf
+
+class TcClassCache(netlink.Cache):
+ """Cache of traffic classes"""
+
+ def __init__(self, ifindex, cache=None):
+ if not cache:
+ cache = self._alloc_cache_name('route/class')
+
+ self._protocol = netlink.NETLINK_ROUTE
+ self._nl_cache = cache
+ self._set_arg1(ifindex)
+
+ @staticmethod
+ def _new_object(obj):
+ return TcClass(obj)
+
+ def _new_cache(self, cache):
+ return TcClassCache(self.arg1, cache=cache)
+
+class TcClass(Tc):
+ """Traffic Class"""
+
+ def __init__(self, obj=None):
+ netlink.Object.__init__(self, 'route/class', 'class', obj)
+ self._module_path = 'netlink.route.qdisc.'
+ self._rtnl_class = self._obj2type(self._nl_object)
+ self._rtnl_tc = capi.obj2tc(self._nl_object)
+
+ if self.kind:
+ self._tc_module_lookup()
+
+ @classmethod
+ def from_capi(cls, obj):
+ return cls(capi.class2obj(obj))
+
+ @staticmethod
+ def _obj2type(obj):
+ return capi.obj2class(obj)
+
+ @staticmethod
+ def _new_instance(obj):
+ if not obj:
+ raise ValueError()
+
+ return TcClass(obj)
+
+ @property
+ def childs(self):
+ ret = []
+
+ # classes can have classifiers, child classes and leaf
+ # qdiscs
+ ret += get_cls(self.ifindex, parent=self.handle)
+ ret += get_class(self.ifindex, parent=self.handle)
+ ret += get_qdisc(self.ifindex, parent=self.handle)
+
+ return ret
+
+ def format(self, details=False, _stats=False, nodev=False,
+ noparent=False, indent=''):
+ """Return class as formatted text"""
+ fmt = util.MyFormatter(self, indent)
+
+ buf = fmt.format(self.brief('class', nodev, noparent))
+
+ if details:
+ buf += fmt.nl('\t' + self.details())
+
+ return buf
+
+class ClassifierCache(netlink.Cache):
+ """Cache of traffic classifiers objects"""
+
+ def __init__(self, ifindex, parent, cache=None):
+ if not cache:
+ cache = self._alloc_cache_name('route/cls')
+
+ self._protocol = netlink.NETLINK_ROUTE
+ self._nl_cache = cache
+ self._set_arg1(ifindex)
+ self._set_arg2(int(parent))
+
+ @staticmethod
+ def _new_object(obj):
+ return Classifier(obj)
+
+ def _new_cache(self, cache):
+ return ClassifierCache(self.arg1, self.arg2, cache=cache)
+
+class Classifier(Tc):
+ """Classifier"""
+
+ def __init__(self, obj=None):
+ netlink.Object.__init__(self, 'route/cls', 'cls', obj)
+ self._module_path = 'netlink.route.cls.'
+ self._rtnl_cls = self._obj2type(self._nl_object)
+ self._rtnl_tc = capi.obj2tc(self._nl_object)
+
+ @classmethod
+ def from_capi(cls, obj):
+ return cls(capi.cls2obj(obj))
+
+ @staticmethod
+ def _obj2type(obj):
+ return capi.obj2cls(obj)
+
+ @staticmethod
+ def _new_instance(obj):
+ if not obj:
+ raise ValueError()
+
+ return Classifier(obj)
+
+ @property
+ def priority(self):
+ return capi.rtnl_cls_get_prio(self._rtnl_cls)
+
+ @priority.setter
+ def priority(self, value):
+ capi.rtnl_cls_set_prio(self._rtnl_cls, int(value))
+
+ @property
+ def protocol(self):
+ return capi.rtnl_cls_get_protocol(self._rtnl_cls)
+
+ @protocol.setter
+ def protocol(self, value):
+ capi.rtnl_cls_set_protocol(self._rtnl_cls, int(value))
+
+ @property
+ def childs(self):
+ return []
+
+ def format(self, details=False, _stats=False, nodev=False,
+ noparent=False, indent=''):
+ """Return class as formatted text"""
+ fmt = util.MyFormatter(self, indent)
+
+ buf = fmt.format(self.brief('classifier', nodev, noparent))
+ buf += fmt.format(' {t|priority} {t|protocol}')
+
+ if details:
+ buf += fmt.nl('\t' + self.details())
+
+ return buf
+
+_qdisc_cache = QdiscCache()
+
+def get_qdisc(ifindex, handle=None, parent=None):
+ l = []
+
+ _qdisc_cache.refill()
+
+ for qdisc in _qdisc_cache:
+ if qdisc.ifindex != ifindex:
+ continue
+ if (handle is not None) and (qdisc.handle != handle):
+ continue
+ if (parent is not None) and (qdisc.parent != parent):
+ continue
+ l.append(qdisc)
+
+ return l
+
+_class_cache = {}
+
+def get_class(ifindex, parent, handle=None):
+ l = []
+
+ try:
+ cache = _class_cache[ifindex]
+ except KeyError:
+ cache = TcClassCache(ifindex)
+ _class_cache[ifindex] = cache
+
+ cache.refill()
+
+ for cl in cache:
+ if (parent is not None) and (cl.parent != parent):
+ continue
+ if (handle is not None) and (cl.handle != handle):
+ continue
+ l.append(cl)
+
+ return l
+
+_cls_cache = {}
+
+def get_cls(ifindex, parent, handle=None):
+
+ chain = _cls_cache.get(ifindex, dict())
+
+ try:
+ cache = chain[parent]
+ except KeyError:
+ cache = ClassifierCache(ifindex, parent)
+ chain[parent] = cache
+
+ cache.refill()
+
+ if handle is None:
+ return [ cls for cls in cache ]
+
+ return [ cls for cls in cache if cls.handle == handle ]
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/util.py b/ap/lib/libnl/libnl-3.2.25/python/netlink/util.py
new file mode 100644
index 0000000..22ed5cf
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/util.py
@@ -0,0 +1,175 @@
+#
+# Utilities
+#
+# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
+#
+
+"""utility module for netlink
+
+"""
+
+from __future__ import absolute_import
+
+from . import core as netlink
+from . import capi as capi
+from string import Formatter
+import types
+
+__version__ = '1.0'
+
+#rename into colored_output
+def _color(t, c):
+ return '{esc}[{color}m{text}{esc}[0m'.format(esc=b'\x1b'.decode(), color=c, text=t)
+
+def black(t):
+ return _color(t, 30)
+
+def red(t):
+ return _color(t, 31)
+
+def green(t):
+ return _color(t, 32)
+
+def yellow(t):
+ return _color(t, 33)
+
+def blue(t):
+ return _color(t, 34)
+
+def magenta(t):
+ return _color(t, 35)
+
+def cyan(t):
+ return _color(t, 36)
+
+def white(t):
+ return _color(t, 37)
+
+def bold(t):
+ return _color(t, 1)
+
+def kw(t):
+ return yellow(t)
+
+def num(t):
+ return str(t)
+
+def string(t):
+ return t
+
+def addr(t):
+ return str(t)
+
+def bad(t):
+ return red(t)
+
+def good(t):
+ return green(t)
+
+def title(t):
+ return t
+
+def boolean(t):
+ return str(t)
+
+def handle(t):
+ return str(t)
+
+class MyFormatter(Formatter):
+ def __init__(self, obj, indent=''):
+ self._obj = obj
+ self._indent = indent
+
+ def _nlattr(self, key):
+ value = getattr(self._obj.__class__, key)
+ if not isinstance(value, property):
+ raise ValueError('Invalid formatting string {0}'.format(key))
+
+ d = getattr(value.fget, 'formatinfo', dict())
+
+ # value = value.fget() is exactly the same
+ value = getattr(self._obj, key)
+
+ if 'fmt' in d:
+ value = d['fmt'](value)
+
+ title_ = d.get('title', None)
+
+ return title_, str(value)
+
+ def get_value(self, key, args, kwds):
+ # Let default get_value() handle ints
+ if not isinstance(key, str):
+ return Formatter.get_value(self, key, args, kwds)
+
+ # HACK, we allow defining strings via fields to allow
+ # conversions
+ if key[:2] == 's|':
+ return key[2:]
+
+ if key[:2] == 't|':
+ # title mode ("TITLE ATTR")
+ include_title = True
+ elif key[:2] == 'a|':
+ # plain attribute mode ("ATTR")
+ include_title = False
+ else:
+ # No special field, have default get_value() get it
+ return Formatter.get_value(self, key, args, kwds)
+
+ key = key[2:]
+ (title_, value) = self._nlattr(key)
+
+ if include_title:
+ if not title_:
+ title_ = key # fall back to key as title
+ value = '{0} {1}'.format(kw(title_), value)
+
+ return value
+
+ def convert_field(self, value, conversion):
+ if conversion == 'r':
+ return repr(value)
+ elif conversion == 's':
+ return str(value)
+ elif conversion == 'k':
+ return kw(value)
+ elif conversion == 'b':
+ return bold(value)
+ elif conversion is None:
+ return value
+
+ raise ValueError('Unknown converion specifier {0!s}'.format(conversion))
+
+ def nl(self, format_string=''):
+ return '\n' + self._indent + self.format(format_string)
+
+NL_BYTE_RATE = 0
+NL_BIT_RATE = 1
+
+class Rate(object):
+ def __init__(self, rate, mode=NL_BYTE_RATE):
+ self._rate = rate
+ self._mode = mode
+
+ def __str__(self):
+ return capi.nl_rate2str(self._rate, self._mode, 32)[1]
+
+ def __int__(self):
+ return self._rate
+
+ def __cmp__(self, other):
+ return int(self) - int(other)
+
+class Size(object):
+ def __init__(self, size):
+ self._size = size
+
+ def __str__(self):
+ return capi.nl_size2str(self._size, 32)[0]
+
+ def __int__(self):
+ return self._size
+
+ def __cmp__(self, other):
+ return int(self) - int(other)
diff --git a/ap/lib/libnl/libnl-3.2.25/python/netlink/utils.h b/ap/lib/libnl/libnl-3.2.25/python/netlink/utils.h
new file mode 100644
index 0000000..7836c30
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/python/netlink/utils.h
@@ -0,0 +1,41 @@
+struct list_head {
+ struct list_head *next;
+};
+
+#define LIST_HEAD(name) \
+ struct list_head name = { &(name) }
+
+static inline int list_empty(const struct list_head *head)
+{
+ return head->next == head;
+}
+
+static inline void list_add(struct list_head *new, struct list_head *head)
+{
+ new->next = head->next;
+ head->next = new;
+}
+
+static inline void list_del(struct list_head *entry, struct list_head *prev)
+{
+ prev->next = entry->next;
+ entry->next = entry;
+}
+
+#define list_for_each_safe(pos, n, head) \
+ for (n = (head), pos = (head)->next; pos != (head); \
+ n = pos, pos = n->next)
+
+#undef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
+#ifdef DEBUG
+#define pynl_dbg(fmt, ...) \
+ fprintf(stderr, "%s: " fmt, __func__, __VA_ARGS__)
+#else
+#define pynl_dbg(fmt, ...)
+#endif