diff --git a/OAT.xml b/OAT.xml
index 9cbf948..7e3a5ee 100644
--- a/OAT.xml
+++ b/OAT.xml
@@ -1,83 +1,108 @@
-
-
-
-
-
- COPYING
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ COPYING
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index 509292a..bcd3fff 100644
--- a/README.md
+++ b/README.md
@@ -1,31 +1,31 @@
# libnl
#### Introduction & Software Architecture
-- [Refer to the official documentation](https://www.infradead.org/~tgr/libnl/)
-#### Usage Guidelines
+- [Refer to Official Documentation](https://www.infradead.org/~tgr/libnl/)
-- [Refer to the official API documentation](https://www.infradead.org/~tgr/libnl/doc/api/group__cb.html)
+#### Usage Instructions
-#### Generates Header File
+- [Refer to Official API Documentation](https://www.infradead.org/~tgr/libnl/doc/api/group__cb.html)
-The following patches is carried by the openEuler:libnl3 open source library:
+#### Patch Details
+
+`solve-oh-compile-problem3_11_0.patch` applies the OHOS adaptation patch and archives the patch (with conflicts resolved) to `archive/patches/` for reuse in subsequent version upgrades.
+
+#### Build and Upgrade
+
+This repository adopts the "pre-prepared code environment" approach: the `libnl/` source tree has already been decompressed, configured, patched, and its flex/bison syntax files pre-generated and committed to the repository. During the build phase, compilation is handled directly by `BUILD.gn`, which does not depend on autotools/flex/bison and does not execute scripts during the `gn gen` phase. When upgrading libnl, please run `prepare.sh` and refer to [docs/UPGRADE_GUIDE.md](docs/UPGRADE_GUIDE.md).
+#### Contributing
-The following patches are added to solve the compilation problem under the OpenHarmony project:
+[How to Contribute](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/参与贡献.md)
-solve-oh-compile-problem3_11_0.patch
+[Commit Message Specifications](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83)
-#### Contribution
-[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/参与贡献.md)
-
-[Commit message spec](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83)
-
-#### Repositories Involved
+#### Related Repositories
[third_party_wpa_supplicant](https://gitee.com/openharmony/third_party_wpa_supplicant)
[drivers_peripheral](https://gitee.com/openharmony/drivers_peripheral)
-
diff --git a/README_ZH.md b/README_ZH.md
index a4b4677..2bce560 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -10,11 +10,16 @@
#### patch包说明
-以下patch包为openEuler:libnl3开源库本身携带
+solve-oh-compile-problem3_11_0.patch 应用 OHOS 适配 patch,并把(解决冲突后的)
+patch 归档到archive/patches/ 供后续版本升级复用
+#### 构建与升级
+
+本仓库采用“代码环境提前准备”方式:`libnl/` 源码树已完成解压、configure、
+打 patch 及 flex/bison 语法文件预生成并入库,构建期由 `BUILD.gn` 直接编译,
+不依赖 autotools/flex/bison,也不在 `gn gen` 阶段执行脚本。升级 libnl 时请运行
+`prepare.sh` 并参考 [docs/UPGRADE_GUIDE.md](docs/UPGRADE_GUIDE.md)。
-以下patch包为解决在OpenHarmony工程下编译存在的问题自行添加
-solve-oh-compile-problem3_11_0.patch
#### 参与贡献
diff --git a/archive/libnl-3.11.0.sha256sums b/archive/libnl-3.11.0.sha256sums
new file mode 100644
index 0000000..1b6d934
--- /dev/null
+++ b/archive/libnl-3.11.0.sha256sums
@@ -0,0 +1 @@
+871d8f9f05b86dab080988bb994748384c1416a5d03de1f9f5e811f265094b04 libnl3_11_0.tar.gz
diff --git a/solve-oh-compile-problem3_11_0.patch b/archive/patches/solve-oh-compile-problem3_11_0.patch
similarity index 100%
rename from solve-oh-compile-problem3_11_0.patch
rename to archive/patches/solve-oh-compile-problem3_11_0.patch
diff --git a/docs/UPGRADE_GUIDE.md b/docs/UPGRADE_GUIDE.md
new file mode 100644
index 0000000..f6dd92a
--- /dev/null
+++ b/docs/UPGRADE_GUIDE.md
@@ -0,0 +1,151 @@
+# libnl 升级指导
+
+本仓库采用 **代码环境提前准备** 的方式集成 libnl:上游源码已经过
+解压、`configure`、flex/bison 语法文件预生成、以及应用 OpenHarmony 适配 patch,
+结果直接入库到 `libnl/` 目录。因此日常构建只需 `gn`/`ninja` 直接
+编译 `BUILD.gn`,**不依赖** autotools / configure / flex / bison 等主机工具,
+也不在 `gn gen` 阶段执行任何脚本。
+
+> 历史背景:旧方案在每次 `gn gen` 时通过 `BUILD.gn` 的 `exec_script("install.sh")`
+> 重复解压 tarball 并运行 `autogen.sh` + `configure`,缓慢且强依赖主机环境。
+> 现已由 `prepare.sh`(仅升级时手动运行)替代。
+
+## 仓库内容约定
+
+- `libnl/`:已准备好的源码树(含 `include/config.h`、`include/netlink/version.h`
+ 以及预生成的语法文件 `lib/route/{pktloc_grammar,pktloc_syntax}.{c,h}`、
+ `lib/route/cls/{ematch_grammar,ematch_syntax}.{c,h}`)。直接被 `BUILD.gn` 编译。
+- `prepare.sh`:分三阶段的环境准备脚本(升级时手动运行,构建期不调用)。
+- `solve-oh-compile-problem3_11_0.patch`:当前生效的 OpenHarmony 适配 patch。
+- `archive/patches/`:历史各版本(解决冲突后的)适配 patch 归档,供后续升级参考复用。
+- `archive/libnl-.sha256sums`:**整个上游 tar 包**的 SHA256 校验和(标准
+ `sha256sum` 单行格式、记录规范包名),随上游基线 commit 入库,供整包可信校验。
+- `COPYING`:LGPL v2.1 许可文件。
+- 上游 tarball **不入库**;上游版本/地址记录在 `README.OpenSource`(其元数据结构
+ 保持不变,**不**在其中记录 SHA256)。源码可信校验改由上述 `*.sha256sums`
+ 整包校验和 + git「上游基线 commit」提供。
+
+## 升级流程:三个独立 commit
+
+为清晰区分 **上游原始代码 / 构建环境产物 / OHOS 适配** 三类变更,每次升级按
+`upstream → build → patch` 三个阶段进行,**每个阶段各提交一次独立 commit**。
+这样 `git diff` 在三个 commit 之间分别只显示一类变更,溯源清晰、便于审计与回溯。
+
+以从 `3.11.0` 升级到新版本 `` 为例:
+
+### 0. 准备:更新脚本变量与版本元信息
+
+- 编辑 `prepare.sh` 顶部变量:`LIBNL_VERSION`、`UPSTREAM_URL`、`EXTRACTED_DIR`
+ (若上游归档顶层目录名变化)。
+- 更新 `README.OpenSource` 的 `Version Number` 与 `Upstream URL`
+ (**不**新增 SHA256 字段,保持其元数据结构不变)。
+- 更新 `bundle.json` 的 `version`(如适用)。
+
+### 1. commit 1 —— 纯上游源码基线(可信溯源)
+
+```sh
+# 方式一:使用本地已下载 tarball;方式二:省略路径,从 Upstream URL 下载
+./prepare.sh upstream /path/to/libnl-.tar.gz
+```
+
+该阶段会清空 `libnl/` 并解压**未经任何修改**的上游源码树(不含 config.h、
+不含语法生成物、不含 OHOS 改动)。脚本会:
+
+- 对**整个上游 tar 包**计算 SHA256,写入 `archive/libnl-.sha256sums`
+ (标准 `sha256sum` 单行格式、记录规范包名),随本 commit 入库。
+- 该整包校验和可用于:
+ ```sh
+ # 将上游 tar 包按规范名(如 libnl3_11_0.tar.gz)放到 archive/ 下后校验
+ ( cd archive && sha256sum -c libnl-.sha256sums )
+ ```
+ 或直接把该值与**上游社区发布的 sha256sum 文件**比对,确认 tar 包可信。
+ > 说明:校验对象是**整包 tar.gz**,与上游社区通常发布的校验形式一致;因此
+ > 无需逐文件计算,也不受入库后 configure/patch 改动的影响。
+
+- 提交:
+ ```sh
+ git add libnl/ archive/libnl-.sha256sums README.OpenSource
+ git commit -m "Import libnl upstream"
+ ```
+
+### 2. commit 2 —— 构建环境产物(configure + 语法文件)
+
+```sh
+./prepare.sh build
+```
+
+该阶段运行 `autogen.sh` + `configure`(产出 `config.h`/`version.h`)、flex/bison
+预生成 8 个语法文件、清理 autotools 中间产物,并自动调整 `libnl/.gitignore`
+使上述生成物可入库。
+
+- 本 commit 的 diff 仅为「新增 config.h + version.h + 8 个语法文件 + .gitignore 调整」,
+ 不含任何 OHOS 源码改动。
+- 提交:
+ ```sh
+ git add libnl/
+ git commit -m "libnl build env (configure + grammars)"
+ ```
+
+### 3. commit 3 —— OHOS 适配 patch
+
+```sh
+./prepare.sh patch
+```
+
+该阶段应用 `solve-oh-compile-problem3_11_0.patch`,并把(解决冲突后的)patch
+归档到 `archive/patches/solve-oh-compile-problem-.patch`。
+
+- **若 patch 冲突**:脚本会报错中止。请手动解决冲突、更新根目录的
+ `solve-oh-compile-problem*.patch`(或依据上游变更重做),再重新运行
+ `./prepare.sh patch`。当前 patch 涉及的文件(升级后重点检查是否仍兼容):
+ - `lib/utils.c`、`lib/route/mdb.c`、`lib/route/neigh.c`、`lib/route/link/bridge.c`
+ - `include/base/nl-base-utils.h`
+ - `include/config.h`(交叉编译值修正:`HAVE_STRERROR_L`、
+ `HAVE_DECL_GETPROTOBYNAME_R`、`HAVE_DECL_GETPROTOBYNUMBER_R` 置 0)
+ - `include/nl-priv-dynamic-core/nl-core.h`、`src/lib/utils.c`
+- 本 commit 的 diff 仅为「OHOS 对上游源码的适配改动 + 归档 patch」。
+- 提交:
+ ```sh
+ git add libnl/ archive/patches/
+ git commit -m "libnl OHOS adaptation patch"
+ ```
+
+> 提示:`upstream`/`build`/`patch` 操作的文件集互不相交,`build` 与 `patch` 顺序
+> 理论上可换;但务必保持 `configure`(在 build 阶段)早于 `patch`,因为 patch 要
+> 修正 configure 生成的 `config.h` 交叉编译值。
+
+### 4. 同步 `BUILD.gn` 的 `sources` 列表
+
+若上游新增/删除/重命名了 `lib/`、`src/lib/` 下的 `.c` 文件,需相应增删 `BUILD.gn`
+中 `sources` 条目。语法文件(`pktloc_*`、`ematch_*`)已作为预生成源直接列入
+`sources`,无需 `action()`。此改动可并入 commit 3 或单独提交。
+
+### 5. 构建验证
+
+```sh
+./build.sh --product-name --build-target libnl_share
+```
+
+验证要点:
+
+- `gn gen` 阶段不再执行任何脚本(无 `install.sh` / autotools 调用)。
+- 即使主机 **未安装** flex / bison / autoconf,也能成功编译出 `libnl_share` 动态库。
+
+## 一次性快速搭建(非升级场景)
+
+若只是想在本地一次性重建已准备好的源码树(不关心三 commit 拆分):
+
+```sh
+./prepare.sh all /path/to/libnl-3.11.0.tar.gz
+```
+
+## 设计要点(为何这样做)
+
+- `configure` 产物中,GN 构建实际只需要 `include/config.h` 与
+ `include/netlink/version.h` 两个文件;其余 Makefile / libtool / `.pc` 等
+ 对 GN 构建无用,故 `build` 阶段在生成后即清理,保持源码树精简、
+ 避免泄漏主机路径。
+- `config.h` 由 `configure` 在主机生成后,再由 patch 修正为交叉编译正确值,
+ 因此 **顺序必须是先 `configure` 后 `patch`**。
+- 三阶段对应三 commit,使「上游代码」「构建产物」「OHOS 适配」在版本历史中
+ 天然解耦:审计上游变更只看 commit 1,审计 OHOS 改动只看 commit 3。
diff --git a/install.sh b/install.sh
deleted file mode 100755
index faaea07..0000000
--- a/install.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation version 2.1
-# of the License.
-#
-# Copyright(c) 2023 Huawei Device Co., Ltd.
-
-set -e
-cd $1
-touch test.lock
-(
- flock -x 180
-if [ -d "libnl" ];then
- rm -rf libnl
-fi
-tar xvf libnl-libnl3_11_0.tar.gz
-mv libnl-libnl3_11_0 libnl
-cd $1/libnl
-./autogen.sh
-./configure
-patch -p1 < $1/solve-oh-compile-problem3_11_0.patch --fuzz=0 --no-backup-if-mismatch
-exit 0
-)180>test.lock
diff --git a/libnl-3.7.0.tar.gz b/libnl-3.7.0.tar.gz
deleted file mode 100644
index f7ab177..0000000
Binary files a/libnl-3.7.0.tar.gz and /dev/null differ
diff --git a/libnl-libnl3_11_0.tar.gz b/libnl-libnl3_11_0.tar.gz
deleted file mode 100644
index bb71dc4..0000000
Binary files a/libnl-libnl3_11_0.tar.gz and /dev/null differ
diff --git a/libnl/.clang-format b/libnl/.clang-format
new file mode 100644
index 0000000..ad32417
--- /dev/null
+++ b/libnl/.clang-format
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# clang-format configuration file. Intended for clang-format >= 11.
+#
+# For more information, see:
+#
+# Documentation/process/clang-format.rst
+# https://clang.llvm.org/docs/ClangFormat.html
+# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
+#
+---
+AccessModifierOffset: -4
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands: true
+AlignTrailingComments: false
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+ AfterClass: false
+ AfterControlStatement: false
+ AfterEnum: false
+ AfterFunction: true
+ AfterNamespace: true
+ AfterObjCDeclaration: false
+ AfterStruct: false
+ AfterUnion: false
+ AfterExternBlock: false
+ BeforeCatch: false
+ BeforeElse: false
+ IndentBraces: false
+ SplitEmptyFunction: true
+ SplitEmptyRecord: true
+ SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom
+BreakBeforeInheritanceComma: false
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: false
+ColumnLimit: 80
+CommentPragmas: '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 8
+ContinuationIndentWidth: 8
+Cpp11BracedListStyle: false
+DerivePointerAlignment: false
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: false
+
+# Taken from:
+# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ tools/ \
+# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
+# | LC_ALL=C sort -u
+ForEachMacros:
+ - 'list_for_each_safe'
+ - 'nl_list_for_each_entry'
+ - 'nl_list_for_each_entry_safe'
+ - 'nla_for_each_attr'
+ - 'nla_for_each_nested'
+ - 'nlmsg_for_each'
+ - 'nlmsg_for_each_attr'
+ - 'nlmsg_for_each_msg'
+
+IncludeBlocks: Preserve
+IncludeCategories:
+ - Regex: '.*'
+ Priority: 1
+IncludeIsMainRegex: '(Test)?$'
+IndentCaseLabels: false
+IndentGotoLabels: false
+IndentPPDirectives: None
+IndentWidth: 8
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 8
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+
+# Taken from git's rules
+PenaltyBreakAssignment: 10
+PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakComment: 10
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakString: 10
+PenaltyExcessCharacter: 100
+PenaltyReturnTypeOnItsOwnLine: 60
+
+PointerAlignment: Right
+ReflowComments: false
+SortIncludes: false
+SortUsingDeclarations: false
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatementsExceptForEachMacros
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: false
+SpacesInContainerLiterals: false
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Cpp03
+TabWidth: 8
+UseTab: Always
+...
diff --git a/libnl/.flake8 b/libnl/.flake8
new file mode 100644
index 0000000..afddf49
--- /dev/null
+++ b/libnl/.flake8
@@ -0,0 +1,7 @@
+[flake8]
+extend-ignore =
+ E203
+ E501
+filename =
+ *.py
+ *.py.in
diff --git a/libnl/.git-blame-ignore-revs b/libnl/.git-blame-ignore-revs
new file mode 100644
index 0000000..a5b6f4c
--- /dev/null
+++ b/libnl/.git-blame-ignore-revs
@@ -0,0 +1,7 @@
+# List of commits that did automated reformatting. You can ignore them
+# during git-blame with `--ignore-rev` or `--ignore-revs-file`.
+#
+# $ git config --add 'blame.ignoreRevsFile' '.git-blame-ignore-revs'
+#
+3c753e3c94b01c63bf99b2709f4780e2df4608eb
+53da4712439dfd1ccdfeb8d4ca3027082a826e29
diff --git a/libnl/.github/workflows/ci.yml b/libnl/.github/workflows/ci.yml
new file mode 100644
index 0000000..6ad5fd2
--- /dev/null
+++ b/libnl/.github/workflows/ci.yml
@@ -0,0 +1,223 @@
+name: libnl3-ci
+
+on:
+ push:
+ pull_request:
+
+env:
+ NLTST_IN_CI: 1
+
+jobs:
+ clang-format:
+ runs-on: ubuntu-latest
+ container:
+ image: fedora:40
+ steps:
+ - name: Install packages
+ run: |
+ sudo dnf install -y \
+ clang-tools-extra \
+ git
+
+ - name: Check out repository code
+ uses: actions/checkout@v3
+
+ - name: Setup git
+ run: |
+ git config --global --add safe.directory "$PWD"
+
+ - name: Formatting with clang-format
+ run: |
+ clang-format --version
+ ./tools/clang-format.sh -n
+
+ ci:
+ strategy:
+ matrix:
+ include:
+ - cc: gcc
+ - cc: clang
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Install packages
+ run: |
+ sudo apt-get update
+ sudo apt-get -y --no-install-recommends install \
+ check \
+ valgrind \
+ libtool-bin
+
+ - name: Check out repository code
+ uses: actions/checkout@v3
+
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.x
+
+ - name: Lint Python
+ if: ${{ matrix.cc == 'gcc' }}
+ run: |
+ python3 -m pip install flake8
+ flake8 . --count --show-source --statistics
+
+ - name: Code formatting with Python black
+ if: ${{ matrix.cc == 'gcc' }}
+ run: |
+ python3 -m pip install black==22.12.0
+ black --check .
+
+ - name: Build
+ run: |
+ set -x
+
+ export CC="${{ matrix.cc }}"
+ export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -std=gnu11 -fexceptions"
+ CONFIGURE_ARGS=
+ if [ "$CC" = "clang" ]; then
+ CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
+ export LDFLAGS="-Wl,--no-undefined-version,--fatal-warnings"
+ CONFIGURE_ARGS="--enable-debug=no"
+ else
+ export LDFLAGS="-Wl,--no-undefined-version"
+ fi
+
+ ./autogen.sh
+ ./configure $CONFIGURE_ARGS
+ make -j 15
+ shell: bash
+
+ - name: Build Unit Tests
+ run: |
+ make -j 15 check-build
+
+ - name: Run Unit Tests
+ run: |
+ set -x
+ export NLTST_SEED_RAND=
+ for i in `seq 1 5`; do
+ tests/check-direct
+ tests/check-all
+ make -j 15 check || (cat ./test-suite.log; false)
+ done
+
+ - name: Run Unit Tests w/Valgrind
+ run: |
+ set -x
+ export NLTST_SEED_RAND=
+ CK_FORK=no libtool --mode=execute valgrind --error-exitcode=66 --leak-check=full -s --show-leak-kinds=all ./tests/check-direct
+ CK_FORK=no libtool --mode=execute valgrind --error-exitcode=66 --leak-check=full -s --show-leak-kinds=all ./tests/check-all
+ shell: bash
+
+ - name: Install packages for Release
+ run: |
+ python3 -m pip install \
+ asciidoc \
+ graphviz \
+ pygments
+ sudo apt-get -y --no-install-recommends install \
+ doxygen \
+ graphviz \
+ mscgen \
+ source-highlight
+
+ - name: Build Release
+ run: |
+ set -x
+ git clean -fdx
+ export CC="${{ matrix.cc }}"
+ NO_GPG_SIGN=1 ./tools/build_release.sh BuildAll
+
+ - name: Build out-of-tree and disable-static
+ run: |
+ set -x
+ git clean -fdx
+ export CC="${{ matrix.cc }}"
+ export CFLAGS="-Werror -std=gnu11 -fexceptions"
+ if [ "$CC" = "clang" ]; then
+ CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
+ fi
+
+ ./autogen.sh
+ mkdir build
+ cd build
+ ../configure --disable-static
+ make -j 15
+ make -j 15 check-build
+ export NLTST_SEED_RAND=
+ make -j 15 check || (cat ./test-suite.log; false)
+
+ - name: Link with mold
+ run: |
+ sudo apt-get -y --no-install-recommends install \
+ mold
+ git clean -fdx
+ export LDFLAGS="-fuse-ld=mold -Wl,--fatal-warnings"
+ ./autogen.sh
+ ./configure
+ make -j 15 V=1
+
+ - run: echo "🍏 This job's status is ${{ job.status }}."
+
+ ci-alpine:
+ runs-on: ubuntu-latest
+ container:
+ image: alpine:latest
+ steps:
+ - name: Install packages
+ run: |
+ apk add \
+ autoconf \
+ automake \
+ bash \
+ bison \
+ check-dev \
+ flex \
+ gcc \
+ git \
+ libtool \
+ linux-headers \
+ make \
+ musl-dev \
+ pkgconfig
+
+ - name: Check out repository code
+ uses: actions/checkout@v3
+
+ - name: Setup git
+ run: |
+ git config --global --add safe.directory "$PWD"
+
+ - name: Build
+ run: |
+ set -x
+
+ export CC="${{ matrix.cc }}"
+ export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -std=gnu11 -fexceptions"
+ if [ "$CC" = "clang" ]; then
+ CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
+ export LDFLAGS="-Wl,--no-undefined-version,--fatal-warnings"
+ else
+ export LDFLAGS="-Wl,--no-undefined-version"
+ fi
+
+ ./autogen.sh
+ ./configure
+ make -j 15
+
+ - name: Build Unit Tests
+ run: |
+ make -j 15 check-build
+
+ - name: Run Unit Tests
+ run: |
+ set -x
+ export NLTST_SEED_RAND=
+ for i in `seq 1 5`; do
+ tests/check-direct
+ # unshare() does not work (EPERM). This test currently cannot pass
+ # (odd).
+ # tests/check-all
+ # make -j 15 check || (cat ./test-suite.log; false)
+ done
diff --git a/libnl/.gitignore b/libnl/.gitignore
new file mode 100644
index 0000000..cb825cd
--- /dev/null
+++ b/libnl/.gitignore
@@ -0,0 +1,152 @@
+*~
+.deps
+.libs
+.dirstamp
+*.la
+*.lo
+*.o
+*.swp
+Makefile
+Makefile.in
+defs.h.in
+defs.h.in~
+cscope.*
+test-suite.log
+
+/*.pc
+/aclocal.m4
+/autom4te.cache
+/build-aux/
+/config.*
+/configure
+/doc/*.html
+/doc/Doxyfile
+/doc/aclocal.m4
+/doc/api/*.css
+/doc/api/*.dot
+/doc/api/*.html
+/doc/api/*.js
+/doc/api/*.map
+/doc/api/*.md5
+/doc/api/*.png
+/doc/api/*.tag
+/doc/api/_formula*
+/doc/api/doxygen.svg
+/doc/api/formula.repository
+/doc/api/jquery.js
+/doc/asciidoc.tmp
+/doc/autom4te.cache/
+/doc/build-aux/
+/doc/config.*
+/doc/configure
+/doc/images/*.odg
+/doc/images/asciidoc__*.png
+/doc/images/core__*
+/doc/libnl.dict
+/include/config.h
+/include/config.h.in
+/include/netlink/version.h
+/include/stamp-h1
+/lib/defs.h
+/lib/lex.yy.c
+/lib/libnl-*.so*
+/lib/libnl.so*
+/lib/route/cls/ematch_grammar.[ch]
+/lib/route/cls/ematch_syntax.[ch]
+/lib/route/pktloc_grammar.c
+/lib/route/pktloc_grammar.h
+/lib/route/pktloc_syntax.c
+/lib/route/pktloc_syntax.h
+/lib/stamp-h1
+/libnl-1.pc
+/libtool
+/m4/libtool.m4
+/m4/lt*.m4
+/python/**/capi*
+/python/build/
+/python/setup.py
+/src/genl-ctrl-list
+/src/idiag-socket-details
+/src/nf-ct-add
+/src/nf-ct-events
+/src/nf-ct-list
+/src/nf-exp-add
+/src/nf-exp-delete
+/src/nf-exp-list
+/src/nf-log
+/src/nf-monitor
+/src/nf-queue
+/src/nl-addr-add
+/src/nl-addr-delete
+/src/nl-addr-list
+/src/nl-class-add
+/src/nl-class-delete
+/src/nl-class-list
+/src/nl-classid-lookup
+/src/nl-cls-add
+/src/nl-cls-delete
+/src/nl-cls-list
+/src/nl-fib-lookup
+/src/nl-link-enslave
+/src/nl-link-ifindex2name
+/src/nl-link-list
+/src/nl-link-name2ifindex
+/src/nl-link-release
+/src/nl-link-set
+/src/nl-link-stats
+/src/nl-list-caches
+/src/nl-list-sockets
+/src/nl-monitor
+/src/nl-neigh-add
+/src/nl-neigh-delete
+/src/nl-neigh-list
+/src/nl-neightbl-list
+/src/nl-nh-list
+/src/nl-pktloc-lookup
+/src/nl-qdisc-add
+/src/nl-qdisc-delete
+/src/nl-qdisc-list
+/src/nl-route-add
+/src/nl-route-delete
+/src/nl-route-get
+/src/nl-route-list
+/src/nl-rule-list
+/src/nl-tctree-list
+/src/nl-util-addr
+/tags
+/tests/check-all
+/tests/check-all.log
+/tests/check-all.trs
+/tests/check-direct
+/tests/check-direct.log
+/tests/check-direct.trs
+/tests/test-*.log
+/tests/test-*.trs
+/tests/test-cache-mngr
+/tests/test-complex-HTB-with-hash-filters
+/tests/test-create-bond
+/tests/test-create-bridge
+/tests/test-create-geneve
+/tests/test-create-ifb
+/tests/test-create-ip6tnl
+/tests/test-create-ipgre
+/tests/test-create-ipgretap
+/tests/test-create-ipip
+/tests/test-create-ipvlan
+/tests/test-create-ipvti
+/tests/test-create-macsec
+/tests/test-create-macvlan
+/tests/test-create-macvtap
+/tests/test-create-sit
+/tests/test-create-veth
+/tests/test-create-vlan
+/tests/test-create-vrf
+/tests/test-create-vxlan
+/tests/test-create-xfrmi
+/tests/test-delete-link
+/tests/test-genl
+/tests/test-loopback-up-down
+/tests/test-nf-cache-mngr
+/tests/test-socket-creation
+/tests/test-suite.log
+/tests/test-u32-filter-with-actions
diff --git a/libnl/.indent.pro b/libnl/.indent.pro
new file mode 100644
index 0000000..ee5d177
--- /dev/null
+++ b/libnl/.indent.pro
@@ -0,0 +1 @@
+-linux -il0 -cs -lp -cbi0
diff --git a/libnl/COPYING b/libnl/COPYING
new file mode 100644
index 0000000..4362b49
--- /dev/null
+++ b/libnl/COPYING
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/libnl/ChangeLog b/libnl/ChangeLog
new file mode 100644
index 0000000..3d93d1c
--- /dev/null
+++ b/libnl/ChangeLog
@@ -0,0 +1,336 @@
+ChangeLog discontinued, git history can be found here:
+https://github.com/thom311/libnl
+
+Summary of Changes from 1.0-pre6 to 1.0-pre7
+================================================
+ Thomas Graf
+ o Generic netlink support
+ o Route Addition/Deletion
+ o Added nl_cache_subset()
+ o Have nl_object_clone() make real clones without
+ sharing any data.
+ o Remove old nl_object_alloc() not based on a object
+ operations to avoid bugs due to missing init.
+ o Added nl-list-caches utility
+ o Removed nlmsg_build_no_hdr(), duplicate
+ o Reworked message interface
+ o Fixed nlmsg_put() and genlmsg_put() to correctly reserve
+ tail room for user specific headers.
+ o Added nl_cache_move()
+ o Renamed nl_cache_delete() to nl_cache_remove() (no API break)
+ o Fixed reference counting while objects stay in caches.
+ o Object marking
+ o Moved attribute mask for objects into generic structure
+ o nl-list-caches: List available dump procedures
+ o Use PAGE_SIZE as initial buffer size when reading from
+ netlink socket
+ o Double buffer size when recv() returns MSG_TRUNC
+ o Replaced filter object operation with new compare operation
+ capable of listing differences between two objects
+ o Added nl_object_identical() to check if two objects are
+ identical from a uniqueness point of view
+ o Added nl_object_diff() returning a bitmask of differences in
+ attributes
+ o Added nl_object_attr_list() generating a list of attribute
+ name the object has assigned
+ o Cache updates based on event notifications, code based on
+ Patrick McHardy's patches
+ o Cache Manager
+ o Added NL_AUTO_PID, NL_AUTO_SEQ for convenience
+ o Disable MSG_PEEK by default and provide nl_socket_enable_msg_peek()
+ o Fixed nl_recvmsgs() to return 0 when interrupted via NL_STOP or
+ NL_SKIP
+ o Fixed nl_recvmsgs() to stop reading after parsing if not in the
+ middle of a multipart message.
+ o Fixed nl_recvmsgs() to not stop after receiving an ACK
+ o Fixed nl_recvmsgs() to not blindly discard remaining messages
+ if a NLMSG_DONE message is received.
+
+ Petr Gotthard
+ Siemens AG Oesterreich
+ o Fix u32 to properly handle multiple keys
+ o rtnl_htb_set_(r|c)buffer()
+ o Fixed MTU handling in HTB class, problem pointed out
+ by Edouard Thuleau
+
+ Zilvinas Valinskas
+ o Fix wrong msg_namelen in nl_recv()
+ o Fix memory leak in flnl_request_put()
+
+ Helmut Schaa
+ o Fix for using libnl from within C++
+
+ Patrick McHardy
+ o *_alloc_cache(): Only refill cache if handle is provided
+
+ James Oakley
+ o Fix rtnl_link_set_arptype() typo
+
+ Philip Craig
+ o Change address family type from char to int
+ o Fix the error handling when the build fails.
+ o add nl_cache_mngr_get_fd()
+ o add netfilter support
+ o add netfilter conntrack support
+ o add netfilter log support
+
+Summary of Changes from 1.0-pre5 to 1.0-pre6
+================================================
+ Christopher Aillon
+ o Use $(libdir) instead of $(prefix)/lib for 64bit awesomeness.
+
+ Thomas Graf
+ o Extend nl_msg to include source address, destination address
+ and the protocol being used.
+ o Make nl_send*() take a nl_msg instead of a nlmsghdr (API BREAK)
+ o Change callbacks to take a nl_msg instead of source address
+ and nlmsghdr (API BREAK)
+ o caches must specify the protocol they're hooked up from now on
+ if they intend to be associated with message types.
+ o cache_mngt_associate now takes the protocol besides the message
+ type to allow for multiple protocols to be supported (API BREAK)
+ o overwrite destination address in nl_send() when specified in the
+ message itself, allows for unbound addressing.
+ o Support for netlink based fib_lookup()
+ o Documentation fixes
+ o Fix double nlmsg_free() in nl_recvmsgs() while receiving
+ a multipart message and the read was interrupted.
+ o Change cache operations to store names for message types.
+ o Provide interface to convert message type to character string.
+ o Add dp_dump_msgtype to prefix each dumped element with a
+ pretty printed message type.
+ o netlink fib lookup support
+ o nl_recvmsgs() debugging
+ o use nl_cachemngt_type2name() when pretty printing netlink header
+ o Routing protocol translations.
+ o Routing metric translations.
+ o Revised route dumping
+ o Nexthop flag translations.
+ o Add support for IFF_DORMANT
+
+ Petr Gotthard
+ Siemens AG Oesterreich
+ o Fix access to obj after freeing it
+ o Fix u32 selector access after realloc()
+ o Fix missing out-of-memory error handling in various places
+ o Enhance nl-monitor to have group selection selectable and
+ demonstrate usage of select()
+ o Don't ignore IFF_RUNNING any longer
+ o fw classifier support
+
+ Patrick McHardy
+ o Fix conflicting types for __u64
+ o Fix printf format string warnings
+ o Fix object cloning
+ o Deal with structure padding in nl_object_clone
+ o Fix nl_addr leak
+ o Set ce_msgtype in all parsed objects
+ o Fix addr flag filter
+ o Fix RTNLGRP definitions (was based on broken kernel version)
+ o Export nl_get_errno()
+ o Add function to get/set peer pid
+ o Add IFF_LOWER_UP
+ o Add/export some missing accessor functions
+ o print /0 prefix in nl_addr2str()
+ o Fix invalid free in nl_addr_parse for AF_UNSPEC addresses
+ o Use __str2flags instead of __str2type in rtnl_link_str2flags()
+ o Make sure object and filter types match in nl_object_match()
+ o Add support for credential passing over netlink sockets (API BREAK)
+ o Add support for custom dump callbacks
+ o Add NL_DUMP_ENV format
+
+ Michael Biebl
+ "Alex V. Myltsev"
+ o Makefile fixes
+
+
+Summary of Changes from 1.0-pre4 to 1.0-pre5
+================================================
+ Thomas Graf
+ o Use minimized local copies for , ,
+ and to avoid compile troubles with
+ applications including
+ Reported by Christopher Aillon.
+
+Summary of Changes from 1.0-pre3 to 1.0-pre4
+================================================
+ Thomas Graf
+ o Fix wrong rtnl_addr_set_prefixlen() external declaration,
+ reported by Dan Williams.
+ o Fix nl_addr_parse() to not change the original string
+ for prefixes.
+ o Do not build documentation per default, but have the user
+ issue 'make gendoc'
+ o Assume neighbours to be permanent, set NUD_PERMANENT if not
+ specified otherwise.
+
+Summary of Changes from 1.0-pre2 to 1.0-pre3
+================================================
+ Thomas Graf
+ o Fix SFQ parser to allocate qdisc options.
+ o Fix rule statistics dumping to not call itself.
+ o Complete Netem qdisc interface.
+ o Add rtnl_*_put() and rtnl_*_free() to increase readability.
+ o Cleanup of nl-* tools
+ o Fix inclusion guards of route/neightbl.h
+ o Fix nl_connect() to only modify rx/tx socket buffers if not
+ already modified by the user.
+ o Fix wrong nl_handle_alloc() prototype.
+ o Fix typo in route/addr.c causing label to be marked as
+ local address.
+ o Use ~0UL as default prefix length instead of 0.
+ o Fix neighbour message parser to correctly store core.
+ attributes and provide them again.
+ o Fix neighbour message parser to correctly guess address family.
+ to make it compatible with nl_addr_parse() and ether llc
+ addresses.
+ o Add rtnl_route_table2str(), rtnl_route_str2table().
+ o Add nl_cache_nitems_filter() to find out if a filter produces
+ any matches.
+ o Remove rtnl_rule_set_(dst|src)_str() (obsolete).
+ o Remove scope and protocol field of routing rule.
+ o Complete routing rules module.
+ o Move realms translations from route to rtnl module.
+
+Summary of Changes from 1.0-pre1 to 1.0-pre2
+================================================
+ Thomas Graf
+ o More API documentation
+ o Added flags argument to rtnl_addr_(add|build_add_request)().
+ o Added rtnl_addr_(set|get)_multicast().
+ o Moved scope translations routines from route/route.c to
+ route/rtnl.c, required by other modules as well.
+ o Removed old rtattr bits from rtnetlink-kernel.h
+ o Customized libnl.css for doxygen documentation
+ o Removed non-reentrant translation routines, only bloating
+ the code and too risky.
+ o Fixed wrong version number from 1.0-pre1.
+ o Re-enabled unfinished policer module.
+ o Reworked TBF module, automatic caluclation of transmit times,
+ limit setable via latency, automatic cell size calculation,
+ options TLV generation. (untested)
+ o Renamed nl_xmittime() to rtnl_tc_calc_txtime().
+ o Renamde nl_build_rtable() to rtnl_tc_build_rate_table()
+
+ Petr Gotthard ,
+ Siemens AG Oesterreich
+ o Fix symlinks to libnl library files to be moveable
+ o Fix extern struct prototypes meant to be static.
+ o Add empty install target to src/Makefile
+
+ Simon Stelling
+ o Use LIBDIR instead of $(prefix)/lib for users to allow librariers
+ into $(prefix)/lib64.
+
+Summary of Changes from 0.5.0 to 1.0-pre1
+================================================
+ Thomas Graf
+ o Uncountable number of changes, rewrite of certain modules,
+ several major API breakages
+
+ Petr Gotthard ,
+ Siemens AG Oesterreich
+ o added class_build, rtnl_class_build_add_request, rtnl_class_add
+ o added HTB (Hierarchical Token Bucket) class support
+ o added nl_xmittime, nl_build_rtable
+ o added nl_data_append to realloc a nl_data structure
+ o added rtnl_rcopy_ratespec as reverse to rtnl_copy_ratespec
+ o fixed byte order conversion of rtnl_filter.protocol
+ o SuSE and Fedora Linux compile fixes
+ o fixed u32 classifier support
+ o added rtnl_u32_set_handle, rtnl_u32_set_classid, rtnl_u32_set_flags
+ and several rtnl_u32_add_key_... operations to u32 classifier
+
+Summary of Changes from 0.4.4 to 0.5.0
+================================================
+ Thomas Graf
+ o API documentation
+ o nl_cache_filter to manually filter on a object
+ o partial routing support
+ o routing rules support
+ o Properly set address family when setting addresses
+ o debug flag and some rare messages, more to come
+ o make error message verboseness configurable
+ o tc fixes to wait for ack
+ o cleanup and adaption of address code to latest internal API
+ o various cleanups
+ o dozens of API breakages (better now than later)
+
+ Daniel Hottinger
+ o arch 64bit printf length modifier fixes
+
+ Baruch Even ,
+ Mediatrix Telecom, inc.
+ o address support
+
+Summary of changes from 0.4.3 to 0.4.4
+================================================
+ Thomas Graf :
+ o overall cleanups for better code quality
+ o replace dump_(brief|full|with_stats) ops with
+ dump[NL_DUMP_MAX] array to allow further additions without
+ breaking the ABI.
+ o add of send_ack callback, called whenever when oppenent
+ asks for an ACK.
+ o make nl_parse_rtattr initialize the tb buffer like in the
+ kernel, caller must no longer take care of it.
+ o remove nl_addrnattr (obsolete)
+ o fixed nl_msg_append_raw to correctly calculate length
+ for raw data not aligned to NLMSG_ALIGN
+ o fix memory leak in nl_recv in case of errors
+ o correctly check sequence numbers if more than one message
+ was sent out before the answer is being received.
+ o add workaround for buggy netlink applications not properly
+ setting NLM_F_MULTI.
+
+Summary of changes from 0.4.2 to 0.4.3
+================================================
+
+ Thomas Graf :
+ o use parser_param in nl_cache_parse
+ o EGP: dump nfilters attribute
+ o allow retrieving of filters attached to classes via
+ FILTER_CACHE_PARENT(C) cache argument
+ o filter message building API
+
+Summary of changes from 0.4.1 to 0.4.2
+================================================
+
+ Baruch Even :
+ o memory leak fix in nl_parse_rtattr
+ o reset padding to 0 when appending raw data to a nl_msg
+ o avoid overwriting nlmsg ptr when buffer extending fails
+ o typo fixes
+ o create symlinks libnl.so.0 and libnl.so
+
+ Thomas Graf :
+ o EGP classifier support
+ o avoid null pointer in printf call
+ o added nl_cache_parse to put nl_msg's into a cache
+ o added rtnl_filter_build to build a nl_msg filter message
+ o correctly install header files
+ o nl_msg_payload/nl_msg_payloadlen to access nl_msg payload
+ o nl_parse_nested macro to simplify nested TLV parsing
+ o NL_ERROR_ASSERT compile flag to assert(0) on errors
+ o rta alignment fix in nl_msg_append_tlv
+ o added nl_msg_parse_rtattr as shortcut for nl_parse_rtattr
+ for nl_msg API
+ o added nl_parse_nested for nested TLVs
+ o added RTA_ARRAY_ELEMS macro to calculate array length
+ for array TLVs
+ o added nl_wait_for_ack to wait for the next ack
+ o added rtnl_link_build_change_request(...)
+ o added rtnl_neigh_build_*_request
+ o converted neighbour code to use nl_wait_for_ack
+ o cb_recvmsgs_ow callback to overwrite internal calls to
+ nl_recvmsgs_def
+ o cb_seq_check callback to overwrite default sequence checking
+ o added nl_parser_param as argument for message parsers including
+ a callback to be called upon successful parsing of a message.
+ Removes the requirement of having all parsed messages to be added
+ to a cache.
+ o added cb_recv_ow and nl_send_ow callbacks to overwrite internal
+ calls to nl_recv and nl_send.
+
+ Jamal Hadi Salim
+ o Linux 2.4 compile fixes
diff --git a/libnl/Makefile.am b/libnl/Makefile.am
new file mode 100644
index 0000000..227fa56
--- /dev/null
+++ b/libnl/Makefile.am
@@ -0,0 +1,1213 @@
+# -*- Makefile -*-
+
+ACLOCAL_AMFLAGS = -I m4
+
+lib_LTLIBRARIES =
+noinst_LTLIBRARIES =
+check_LTLIBRARIES =
+
+check_PROGRAMS =
+check_programs =
+check_local =
+check_build =
+
+bin_PROGRAMS =
+sbin_PROGRAMS =
+noinst_PROGRAMS =
+
+TESTS =
+
+CLEANFILES =
+EXTRA_DIST =
+
+DISTCHECK_CONFIGURE_FLAGS = \
+ --disable-dependency-tracking
+
+pkgconfig_DATA = \
+ libnl-3.0.pc \
+ libnl-genl-3.0.pc \
+ libnl-idiag-3.0.pc \
+ libnl-nf-3.0.pc \
+ libnl-route-3.0.pc \
+ libnl-xfrm-3.0.pc \
+ $(NULL)
+
+warn_cppflags = \
+ -Wall \
+ -Wextra \
+ \
+ -Wdeclaration-after-statement \
+ -Wmissing-prototypes \
+ -Wpointer-arith \
+ -Wvla \
+ \
+ -Wno-unused-parameter \
+ $(NULL)
+
+defines_cppflags = \
+ -D_NL_SYSCONFDIR_LIBNL=\"$(sysconfdir)/libnl\" \
+ -D_NL_PKGLIBDIR=\"$(pkglibdir)\" \
+ $(NULL)
+
+###############################################################################
+
+libnlincludedir = $(includedir)/libnl@MAJ_VERSION@
+
+libnlinclude_netlinkdir = $(libnlincludedir)/netlink
+libnlinclude_netlink_HEADERS = \
+ include/netlink/addr.h \
+ include/netlink/attr.h \
+ include/netlink/cache-api.h \
+ include/netlink/cache.h \
+ include/netlink/data.h \
+ include/netlink/errno.h \
+ include/netlink/handlers.h \
+ include/netlink/hash.h \
+ include/netlink/hashtable.h \
+ include/netlink/list.h \
+ include/netlink/msg.h \
+ include/netlink/netlink-compat.h \
+ include/netlink/netlink-kernel.h \
+ include/netlink/netlink.h \
+ include/netlink/object-api.h \
+ include/netlink/object.h \
+ include/netlink/socket.h \
+ include/netlink/types.h \
+ include/netlink/utils.h \
+ include/netlink/version.h \
+ $(NULL)
+libnlinclude_netlink_fib_lookupdir = $(libnlincludedir)/netlink/fib_lookup
+libnlinclude_netlink_fib_lookup_HEADERS = \
+ include/netlink/fib_lookup/lookup.h \
+ include/netlink/fib_lookup/request.h \
+ $(NULL)
+libnlinclude_netlink_genldir = $(libnlincludedir)/netlink/genl
+libnlinclude_netlink_genl_HEADERS = \
+ include/netlink/genl/ctrl.h \
+ include/netlink/genl/family.h \
+ include/netlink/genl/genl.h \
+ include/netlink/genl/mngt.h \
+ $(NULL)
+libnlinclude_netlink_idiagdir = $(libnlincludedir)/netlink/idiag
+libnlinclude_netlink_idiag_HEADERS = \
+ include/netlink/idiag/idiagnl.h \
+ include/netlink/idiag/meminfo.h \
+ include/netlink/idiag/msg.h \
+ include/netlink/idiag/req.h \
+ include/netlink/idiag/vegasinfo.h \
+ $(NULL)
+libnlinclude_netlink_netfilterdir = $(libnlincludedir)/netlink/netfilter
+libnlinclude_netlink_netfilter_HEADERS = \
+ include/netlink/netfilter/ct.h \
+ include/netlink/netfilter/exp.h \
+ include/netlink/netfilter/log.h \
+ include/netlink/netfilter/log_msg.h \
+ include/netlink/netfilter/netfilter.h \
+ include/netlink/netfilter/nfnl.h \
+ include/netlink/netfilter/queue.h \
+ include/netlink/netfilter/queue_msg.h \
+ $(NULL)
+libnlinclude_netlink_routedir = $(libnlincludedir)/netlink/route
+libnlinclude_netlink_route_HEADERS = \
+ include/netlink/route/action.h \
+ include/netlink/route/addr.h \
+ include/netlink/route/class.h \
+ include/netlink/route/classifier.h \
+ include/netlink/route/link.h \
+ include/netlink/route/mdb.h \
+ include/netlink/route/neighbour.h \
+ include/netlink/route/neightbl.h \
+ include/netlink/route/netconf.h \
+ include/netlink/route/nexthop.h \
+ include/netlink/route/nh.h \
+ include/netlink/route/pktloc.h \
+ include/netlink/route/qdisc.h \
+ include/netlink/route/route.h \
+ include/netlink/route/rtnl.h \
+ include/netlink/route/rule.h \
+ include/netlink/route/tc-api.h \
+ include/netlink/route/tc.h \
+ $(NULL)
+libnlinclude_netlink_route_actdir = $(libnlincludedir)/netlink/route/act
+libnlinclude_netlink_route_act_HEADERS = \
+ include/netlink/route/act/gact.h \
+ include/netlink/route/act/mirred.h \
+ include/netlink/route/act/nat.h \
+ include/netlink/route/act/skbedit.h \
+ include/netlink/route/act/vlan.h \
+ $(NULL)
+libnlinclude_netlink_route_clsdir = $(libnlincludedir)/netlink/route/cls
+libnlinclude_netlink_route_cls_HEADERS = \
+ include/netlink/route/cls/basic.h \
+ include/netlink/route/cls/cgroup.h \
+ include/netlink/route/cls/ematch.h \
+ include/netlink/route/cls/flower.h \
+ include/netlink/route/cls/fw.h \
+ include/netlink/route/cls/matchall.h \
+ include/netlink/route/cls/police.h \
+ include/netlink/route/cls/u32.h \
+ $(NULL)
+libnlinclude_netlink_route_cls_ematchdir = $(libnlincludedir)/netlink/route/cls/ematch
+libnlinclude_netlink_route_cls_ematch_HEADERS = \
+ include/netlink/route/cls/ematch/cmp.h \
+ include/netlink/route/cls/ematch/meta.h \
+ include/netlink/route/cls/ematch/nbyte.h \
+ include/netlink/route/cls/ematch/text.h \
+ $(NULL)
+libnlinclude_netlink_route_linkdir = $(libnlincludedir)/netlink/route/link
+libnlinclude_netlink_route_link_HEADERS = \
+ include/netlink/route/link/api.h \
+ include/netlink/route/link/bonding.h \
+ include/netlink/route/link/bridge_info.h \
+ include/netlink/route/link/bridge.h \
+ include/netlink/route/link/can.h \
+ include/netlink/route/link/geneve.h \
+ include/netlink/route/link/inet.h \
+ include/netlink/route/link/inet6.h \
+ include/netlink/route/link/info-api.h \
+ include/netlink/route/link/ip6gre.h \
+ include/netlink/route/link/ip6tnl.h \
+ include/netlink/route/link/ip6vti.h \
+ include/netlink/route/link/ipgre.h \
+ include/netlink/route/link/ipip.h \
+ include/netlink/route/link/ipvlan.h \
+ include/netlink/route/link/ipvti.h \
+ include/netlink/route/link/macsec.h \
+ include/netlink/route/link/macvlan.h \
+ include/netlink/route/link/macvtap.h \
+ include/netlink/route/link/ppp.h \
+ include/netlink/route/link/sit.h \
+ include/netlink/route/link/sriov.h \
+ include/netlink/route/link/team.h \
+ include/netlink/route/link/veth.h \
+ include/netlink/route/link/vlan.h \
+ include/netlink/route/link/vrf.h \
+ include/netlink/route/link/vxlan.h \
+ include/netlink/route/link/xfrmi.h \
+ $(NULL)
+libnlinclude_netlink_route_qdiscdir = $(libnlincludedir)/netlink/route/qdisc
+libnlinclude_netlink_route_qdisc_HEADERS = \
+ include/netlink/route/qdisc/cbq.h \
+ include/netlink/route/qdisc/dsmark.h \
+ include/netlink/route/qdisc/fifo.h \
+ include/netlink/route/qdisc/fq_codel.h \
+ include/netlink/route/qdisc/hfsc.h \
+ include/netlink/route/qdisc/htb.h \
+ include/netlink/route/qdisc/mqprio.h \
+ include/netlink/route/qdisc/netem.h \
+ include/netlink/route/qdisc/plug.h \
+ include/netlink/route/qdisc/prio.h \
+ include/netlink/route/qdisc/red.h \
+ include/netlink/route/qdisc/sfq.h \
+ include/netlink/route/qdisc/tbf.h \
+ $(NULL)
+libnlinclude_netlink_xfrmdir = $(libnlincludedir)/netlink/xfrm
+libnlinclude_netlink_xfrm_HEADERS = \
+ include/netlink/xfrm/ae.h \
+ include/netlink/xfrm/lifetime.h \
+ include/netlink/xfrm/sa.h \
+ include/netlink/xfrm/selector.h \
+ include/netlink/xfrm/sp.h \
+ include/netlink/xfrm/template.h \
+ $(NULL)
+
+if ENABLE_CLI
+libnlinclude_netlink_clidir = $(libnlincludedir)/netlink/cli
+libnlinclude_netlink_cli_HEADERS = \
+ include/netlink/cli/addr.h \
+ include/netlink/cli/class.h \
+ include/netlink/cli/cls.h \
+ include/netlink/cli/ct.h \
+ include/netlink/cli/exp.h \
+ include/netlink/cli/link.h \
+ include/netlink/cli/mdb.h \
+ include/netlink/cli/neigh.h \
+ include/netlink/cli/nh.h \
+ include/netlink/cli/qdisc.h \
+ include/netlink/cli/route.h \
+ include/netlink/cli/rule.h \
+ include/netlink/cli/tc.h \
+ include/netlink/cli/utils.h \
+ $(NULL)
+endif
+
+public_headers = \
+ $(libnlinclude_netlink_HEADERS) \
+ $(libnlinclude_netlink_fib_lookup_HEADERS) \
+ $(libnlinclude_netlink_genl_HEADERS) \
+ $(libnlinclude_netlink_idiag_HEADERS) \
+ $(libnlinclude_netlink_netfilter_HEADERS) \
+ $(libnlinclude_netlink_route_HEADERS) \
+ $(libnlinclude_netlink_route_act_HEADERS) \
+ $(libnlinclude_netlink_route_cls_HEADERS) \
+ $(libnlinclude_netlink_route_cls_ematch_HEADERS) \
+ $(libnlinclude_netlink_route_link_HEADERS) \
+ $(libnlinclude_netlink_route_qdisc_HEADERS) \
+ $(libnlinclude_netlink_xfrm_HEADERS) \
+ $(libnlinclude_netlink_cli_HEADERS) \
+ $(NULL)
+
+noinst_HEADERS = \
+ include/base/nl-base-utils.h \
+ include/linux-private/linux/atm.h \
+ include/linux-private/linux/atmapi.h \
+ include/linux-private/linux/atmioc.h \
+ include/linux-private/linux/atmsap.h \
+ include/linux-private/linux/byteorder/little_endian.h \
+ include/linux-private/linux/can/netlink.h \
+ include/linux-private/linux/const.h \
+ include/linux-private/linux/errno.h \
+ include/linux-private/linux/ethtool.h \
+ include/linux-private/linux/falloc.h \
+ include/linux-private/linux/fib_rules.h \
+ include/linux-private/linux/gen_stats.h \
+ include/linux-private/linux/genetlink.h \
+ include/linux-private/linux/hdlc/ioctl.h \
+ include/linux-private/linux/if.h \
+ include/linux-private/linux/if_addr.h \
+ include/linux-private/linux/if_arp.h \
+ include/linux-private/linux/if_bridge.h \
+ include/linux-private/linux/if_ether.h \
+ include/linux-private/linux/if_link.h \
+ include/linux-private/linux/if_macsec.h \
+ include/linux-private/linux/if_packet.h \
+ include/linux-private/linux/if_tunnel.h \
+ include/linux-private/linux/if_vlan.h \
+ include/linux-private/linux/in.h \
+ include/linux-private/linux/in6.h \
+ include/linux-private/linux/in_route.h \
+ include/linux-private/linux/inet_diag.h \
+ include/linux-private/linux/ioctl.h \
+ include/linux-private/linux/ip.h \
+ include/linux-private/linux/ipv6.h \
+ include/linux-private/linux/libc-compat.h \
+ include/linux-private/linux/limits.h \
+ include/linux-private/linux/lwtunnel.h \
+ include/linux-private/linux/mpls.h \
+ include/linux-private/linux/mpls_iptunnel.h \
+ include/linux-private/linux/neighbour.h \
+ include/linux-private/linux/netconf.h \
+ include/linux-private/linux/netdevice.h \
+ include/linux-private/linux/netfilter.h \
+ include/linux-private/linux/netfilter/nf_conntrack_common.h \
+ include/linux-private/linux/netfilter/nf_conntrack_tcp.h \
+ include/linux-private/linux/netfilter/nfnetlink.h \
+ include/linux-private/linux/netfilter/nfnetlink_compat.h \
+ include/linux-private/linux/netfilter/nfnetlink_conntrack.h \
+ include/linux-private/linux/netfilter/nfnetlink_log.h \
+ include/linux-private/linux/netfilter/nfnetlink_queue.h \
+ include/linux-private/linux/netlink.h \
+ include/linux-private/linux/nexthop.h \
+ include/linux-private/linux/pkt_cls.h \
+ include/linux-private/linux/pkt_sched.h \
+ include/linux-private/linux/posix_types.h \
+ include/linux-private/linux/rtnetlink.h \
+ include/linux-private/linux/seg6.h \
+ include/linux-private/linux/seg6_hmac.h \
+ include/linux-private/linux/seg6_iptunnel.h \
+ include/linux-private/linux/seg6_local.h \
+ include/linux-private/linux/snmp.h \
+ include/linux-private/linux/sock_diag.h \
+ include/linux-private/linux/socket.h \
+ include/linux-private/linux/stddef.h \
+ include/linux-private/linux/swab.h \
+ include/linux-private/linux/taskstats.h \
+ include/linux-private/linux/tc_act/tc_gact.h \
+ include/linux-private/linux/tc_act/tc_mirred.h \
+ include/linux-private/linux/tc_act/tc_nat.h \
+ include/linux-private/linux/tc_act/tc_skbedit.h \
+ include/linux-private/linux/tc_act/tc_vlan.h \
+ include/linux-private/linux/tc_ematch/tc_em_cmp.h \
+ include/linux-private/linux/tc_ematch/tc_em_meta.h \
+ include/linux-private/linux/tc_ematch/tc_em_nbyte.h \
+ include/linux-private/linux/tc_ematch/tc_em_text.h \
+ include/linux-private/linux/types.h \
+ include/linux-private/linux/version.h \
+ include/linux-private/linux/veth.h \
+ include/linux-private/linux/xfrm.h \
+ include/nl-aux-core/nl-core.h \
+ include/nl-aux-route/nl-route.h \
+ include/nl-aux-xfrm/nl-xfrm.h \
+ include/nl-default.h \
+ include/nl-priv-dynamic-core/cache-api.h \
+ include/nl-priv-dynamic-core/nl-core.h \
+ include/nl-priv-dynamic-core/object-api.h \
+ include/nl-priv-dynamic-route/nl-priv-dynamic-route.h \
+ include/nl-priv-static-route/nl-priv-static-route.h \
+ $(NULL)
+
+###############################################################################
+
+# Hack to avoid using ylwrap. It does not function correctly in combination
+# with --header-file=
+
+lib/route/pktloc_grammar.h: lib/route/pktloc_grammar.c
+ @true
+
+lib/route/pktloc_grammar.c: lib/route/pktloc_grammar.l lib/route/.dirstamp
+ $(AM_V_GEN) $(FLEX) --header-file=lib/route/pktloc_grammar.h $(LFLAGS) -o $@ $<
+
+lib/route/pktloc_syntax.h: lib/route/pktloc_syntax.c
+ @true
+
+lib/route/pktloc_syntax.c: lib/route/pktloc_syntax.y lib/route/.dirstamp
+ $(AM_V_GEN) $(YACC) -d $(YFLAGS) -o $@ $<
+
+lib/route/cls/ematch_grammar.h: lib/route/cls/ematch_grammar.c
+ @true
+
+lib/route/cls/ematch_grammar.c: lib/route/cls/ematch_grammar.l lib/route/cls/.dirstamp
+ $(AM_V_GEN) $(FLEX) --header-file=lib/route/cls/ematch_grammar.h $(LFLAGS) -o $@ $<
+
+lib/route/cls/ematch_syntax.h: lib/route/cls/ematch_syntax.c
+ @true
+
+lib/route/cls/ematch_syntax.c: lib/route/cls/ematch_syntax.y lib/route/cls/.dirstamp
+ $(AM_V_GEN) $(YACC) -d $(YFLAGS) -o $@ $<
+
+grammar_files_sources = \
+ lib/route/cls/ematch_grammar.c \
+ lib/route/cls/ematch_syntax.c \
+ lib/route/pktloc_grammar.c \
+ lib/route/pktloc_syntax.c \
+ $(NULL)
+
+grammar_files_headers = $(grammar_files_sources:%.c=%.h)
+
+CLEANFILES += \
+ $(grammar_files_sources) \
+ $(grammar_files_headers)
+
+EXTRA_DIST += \
+ lib/route/cls/ematch_grammar.l \
+ lib/route/cls/ematch_syntax.y \
+ lib/route/pktloc_grammar.l \
+ lib/route/pktloc_syntax.y \
+ $(NULL)
+
+###############################################################################
+
+default_includes = \
+ -I$(srcdir)/include/linux-private \
+ -I$(srcdir)/include \
+ -I$(builddir)/include \
+ $(NULL)
+
+lib_cppflags = \
+ $(warn_cppflags) \
+ $(defines_cppflags) \
+ $(default_includes) \
+ $(NULL)
+
+lib_LTLIBRARIES += lib/libnl-3.la
+
+lib_libnl_3_la_SOURCES = \
+ lib/addr.c \
+ lib/attr.c \
+ lib/cache.c \
+ lib/cache_mngr.c \
+ lib/cache_mngt.c \
+ lib/data.c \
+ lib/error.c \
+ lib/handlers.c \
+ lib/hash.c \
+ lib/hashtable.c \
+ lib/mpls.c \
+ lib/mpls.h \
+ lib/msg.c \
+ lib/nl-core.h \
+ lib/nl.c \
+ lib/object.c \
+ lib/socket.c \
+ lib/utils.c \
+ lib/version.c \
+ $(NULL)
+EXTRA_lib_libnl_3_la_DEPENDENCIES = \
+ libnl-3.sym
+lib_libnl_3_la_CPPFLAGS = \
+ $(lib_cppflags)
+lib_libnl_3_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -Wl,--version-script=$(srcdir)/libnl-3.sym
+
+lib_LTLIBRARIES += lib/libnl-route-3.la
+
+lib_libnl_route_3_la_SOURCES = \
+ lib/fib_lookup/lookup.c \
+ lib/fib_lookup/request.c \
+ lib/route/act.c \
+ lib/route/act/gact.c \
+ lib/route/act/mirred.c \
+ lib/route/act/nat.c \
+ lib/route/act/skbedit.c \
+ lib/route/act/vlan.c \
+ lib/route/addr.c \
+ lib/route/class.c \
+ lib/route/classid.c \
+ lib/route/cls.c \
+ lib/route/cls/basic.c \
+ lib/route/cls/cgroup.c \
+ lib/route/cls/ematch.c \
+ lib/route/cls/ematch/cmp.c \
+ lib/route/cls/ematch/container.c \
+ lib/route/cls/ematch/meta.c \
+ lib/route/cls/ematch/nbyte.c \
+ lib/route/cls/ematch/text.c \
+ lib/route/cls/flower.c \
+ lib/route/cls/fw.c \
+ lib/route/cls/mall.c \
+ lib/route/cls/police.c \
+ lib/route/cls/u32.c \
+ lib/route/link-sriov.h \
+ lib/route/link.c \
+ lib/route/link/api.c \
+ lib/route/link/bonding.c \
+ lib/route/link/bridge.c \
+ lib/route/link/bridge_info.c \
+ lib/route/link/can.c \
+ lib/route/link/dummy.c \
+ lib/route/link/geneve.c \
+ lib/route/link/ifb.c \
+ lib/route/link/inet.c \
+ lib/route/link/inet6.c \
+ lib/route/link/ip6gre.c \
+ lib/route/link/ip6tnl.c \
+ lib/route/link/ip6vti.c \
+ lib/route/link/ipgre.c \
+ lib/route/link/ipip.c \
+ lib/route/link/ipvlan.c \
+ lib/route/link/ipvti.c \
+ lib/route/link/link-api.h \
+ lib/route/link/macsec.c \
+ lib/route/link/macvlan.c \
+ lib/route/link/ppp.c \
+ lib/route/link/sit.c \
+ lib/route/link/sriov.c \
+ lib/route/link/team.c \
+ lib/route/link/veth.c \
+ lib/route/link/vlan.c \
+ lib/route/link/vrf.c \
+ lib/route/link/vxlan.c \
+ lib/route/link/xfrmi.c \
+ lib/route/mdb.c \
+ lib/route/neigh.c \
+ lib/route/neightbl.c \
+ lib/route/netconf.c \
+ lib/route/nexthop-encap.h \
+ lib/route/nexthop.c \
+ lib/route/nexthop_encap.c \
+ lib/route/nh.c \
+ lib/route/nh_encap_mpls.c \
+ lib/route/nl-route.h \
+ lib/route/pktloc.c \
+ lib/route/qdisc.c \
+ lib/route/qdisc/blackhole.c \
+ lib/route/qdisc/cbq.c \
+ lib/route/qdisc/dsmark.c \
+ lib/route/qdisc/fifo.c \
+ lib/route/qdisc/fq_codel.c \
+ lib/route/qdisc/hfsc.c \
+ lib/route/qdisc/htb.c \
+ lib/route/qdisc/ingress.c \
+ lib/route/qdisc/mqprio.c \
+ lib/route/qdisc/netem.c \
+ lib/route/qdisc/plug.c \
+ lib/route/qdisc/prio.c \
+ lib/route/qdisc/red.c \
+ lib/route/qdisc/sfq.c \
+ lib/route/qdisc/tbf.c \
+ lib/route/route.c \
+ lib/route/route_obj.c \
+ lib/route/route_utils.c \
+ lib/route/rtnl.c \
+ lib/route/rule.c \
+ lib/route/tc-api.h \
+ lib/route/tc.c \
+ $(NULL)
+nodist_lib_libnl_route_3_la_SOURCES = \
+ $(grammar_files_sources)
+EXTRA_lib_libnl_route_3_la_DEPENDENCIES = \
+ libnl-route-3.sym
+lib_libnl_route_3_la_CPPFLAGS = \
+ $(lib_cppflags) \
+ -I$(srcdir)/lib/route \
+ -I$(builddir)/lib/route \
+ -I$(builddir)/lib/route/cls \
+ $(NULL)
+lib_libnl_route_3_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -Wl,--version-script=$(srcdir)/libnl-route-3.sym
+lib_libnl_route_3_la_LIBADD = \
+ lib/libnl-3.la
+
+$(lib_libnl_route_3_la_OBJECTS): $(grammar_files_headers)
+
+lib_LTLIBRARIES += lib/libnl-idiag-3.la
+
+lib_libnl_idiag_3_la_SOURCES = \
+ lib/idiag/idiag.c \
+ lib/idiag/idiag_meminfo_obj.c \
+ lib/idiag/idiag_msg_obj.c \
+ lib/idiag/idiag_req_obj.c \
+ lib/idiag/idiag_vegasinfo_obj.c \
+ lib/idiag/nl-idiag.h \
+ $(NULL)
+EXTRA_lib_libnl_idiag_3_la_DEPENDENCIES = \
+ libnl-idiag-3.sym
+lib_libnl_idiag_3_la_CPPFLAGS = \
+ $(lib_cppflags)
+lib_libnl_idiag_3_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -Wl,--version-script=$(srcdir)/libnl-idiag-3.sym
+lib_libnl_idiag_3_la_LIBADD = \
+ lib/libnl-3.la
+
+lib_LTLIBRARIES += lib/libnl-genl-3.la
+
+lib_libnl_genl_3_la_SOURCES = \
+ lib/genl/ctrl.c \
+ lib/genl/family.c \
+ lib/genl/genl.c \
+ lib/genl/mngt.c \
+ lib/genl/nl-genl.h \
+ $(NULL)
+EXTRA_lib_libnl_genl_3_la_DEPENDENCIES = \
+ libnl-genl-3.sym
+lib_libnl_genl_3_la_CPPFLAGS = \
+ $(lib_cppflags)
+lib_libnl_genl_3_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -Wl,--version-script=$(srcdir)/libnl-genl-3.sym
+lib_libnl_genl_3_la_LIBADD = \
+ lib/libnl-3.la
+
+lib_LTLIBRARIES += lib/libnl-nf-3.la
+
+lib_libnl_nf_3_la_SOURCES = \
+ lib/netfilter/ct.c \
+ lib/netfilter/ct_obj.c \
+ lib/netfilter/exp.c \
+ lib/netfilter/exp_obj.c \
+ lib/netfilter/log.c \
+ lib/netfilter/log_msg.c \
+ lib/netfilter/log_msg_obj.c \
+ lib/netfilter/log_obj.c \
+ lib/netfilter/netfilter.c \
+ lib/netfilter/nfnl.c \
+ lib/netfilter/nl-netfilter.h \
+ lib/netfilter/queue.c \
+ lib/netfilter/queue_msg.c \
+ lib/netfilter/queue_msg_obj.c \
+ lib/netfilter/queue_obj.c \
+ $(NULL)
+lib_libnl_nf_3_la_CPPFLAGS = \
+ $(lib_cppflags)
+EXTRA_lib_libnl_nf_3_la_DEPENDENCIES = \
+ libnl-nf-3.sym
+lib_libnl_nf_3_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -Wl,--version-script=$(srcdir)/libnl-nf-3.sym
+lib_libnl_nf_3_la_LIBADD = \
+ lib/libnl-3.la \
+ lib/libnl-route-3.la
+
+lib_LTLIBRARIES += lib/libnl-xfrm-3.la
+
+lib_libnl_xfrm_3_la_SOURCES = \
+ lib/xfrm/ae.c \
+ lib/xfrm/lifetime.c \
+ lib/xfrm/nl-xfrm.h \
+ lib/xfrm/sa.c \
+ lib/xfrm/selector.c \
+ lib/xfrm/sp.c \
+ lib/xfrm/template.c \
+ $(NULL)
+lib_libnl_xfrm_3_la_CPPFLAGS = \
+ $(lib_cppflags)
+lib_libnl_xfrm_3_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -Wl,--version-script=$(srcdir)/libnl-xfrm-3.sym
+EXTRA_lib_libnl_xfrm_3_la_DEPENDENCIES = \
+ libnl-xfrm-3.sym
+lib_libnl_xfrm_3_la_LIBADD = \
+ lib/libnl-3.la
+
+lib_cli_ltlibraries_cls = \
+ lib/cli/cls/basic.la \
+ lib/cli/cls/cgroup.la \
+ $(NULL)
+lib_cli_ltlibraries_qdisc = \
+ lib/cli/qdisc/bfifo.la \
+ lib/cli/qdisc/blackhole.la \
+ lib/cli/qdisc/fq_codel.la \
+ lib/cli/qdisc/hfsc.la \
+ lib/cli/qdisc/htb.la \
+ lib/cli/qdisc/ingress.la \
+ lib/cli/qdisc/pfifo.la \
+ lib/cli/qdisc/plug.la \
+ $(NULL)
+
+if ENABLE_CLI
+pkglib_clsdir = $(pkglibdir)/cli/cls
+pkglib_qdiscdir = $(pkglibdir)/cli/qdisc
+pkglib_cls_LTLIBRARIES = $(lib_cli_ltlibraries_cls)
+pkglib_qdisc_LTLIBRARIES = $(lib_cli_ltlibraries_qdisc)
+else
+check_LTLIBRARIES += \
+ $(lib_cli_ltlibraries_cls) \
+ $(lib_cli_ltlibraries_qdisc)
+endif
+
+lib_cli_ldflags = \
+ -module -avoid-version
+
+lib_cli_cls_basic_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_cls_basic_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_cls_cgroup_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_cls_cgroup_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_bfifo_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_bfifo_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_blackhole_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_blackhole_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_fq_codel_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_fq_codel_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_hfsc_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_hfsc_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_htb_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_htb_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_ingress_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_ingress_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_pfifo_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_pfifo_la_LDFLAGS = $(lib_cli_ldflags)
+lib_cli_qdisc_plug_la_CPPFLAGS = $(lib_cppflags)
+lib_cli_qdisc_plug_la_LDFLAGS = $(lib_cli_ldflags)
+
+###############################################################################
+
+src_lib_ldflags =
+
+if ENABLE_CLI
+lib_LTLIBRARIES += src/lib/libnl-cli-3.la
+src_lib_ldflags += -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+else
+check_LTLIBRARIES += src/lib/libnl-cli-3.la
+endif
+
+src_lib_libnl_cli_3_la_SOURCES = \
+ src/lib/addr.c \
+ src/lib/class.c \
+ src/lib/cls.c \
+ src/lib/ct.c \
+ src/lib/exp.c \
+ src/lib/link.c \
+ src/lib/neigh.c \
+ src/lib/nh.c \
+ src/lib/qdisc.c \
+ src/lib/route.c \
+ src/lib/rule.c \
+ src/lib/tc.c \
+ src/lib/utils.c \
+ $(NULL)
+EXTRA_src_lib_libnl_cli_3_la_DEPENDENCIES = \
+ libnl-cli-3.sym
+src_lib_libnl_cli_3_la_CPPFLAGS = \
+ $(warn_cppflags) \
+ $(defines_cppflags) \
+ $(default_includes) \
+ $(NULL)
+src_lib_libnl_cli_3_la_LDFLAGS = \
+ $(src_lib_ldflags) \
+ -Wl,--version-script=$(srcdir)/libnl-cli-3.sym
+src_lib_libnl_cli_3_la_LIBADD = \
+ lib/libnl-3.la \
+ lib/libnl-route-3.la \
+ lib/libnl-nf-3.la \
+ lib/libnl-genl-3.la \
+ -ldl \
+ $(NULL)
+
+###############################################################################
+
+src_cppflags = \
+ $(warn_cppflags) \
+ $(defines_cppflags) \
+ $(default_includes) \
+ $(NULL)
+
+src_ldadd = \
+ src/lib/libnl-cli-3.la \
+ lib/libnl-3.la \
+ lib/libnl-nf-3.la \
+ lib/libnl-genl-3.la \
+ lib/libnl-route-3.la \
+ lib/libnl-idiag-3.la \
+ $(NULL)
+
+cli_programs = \
+ src/genl-ctrl-list \
+ src/idiag-socket-details \
+ src/nf-ct-add \
+ src/nf-ct-events \
+ src/nf-ct-list \
+ src/nf-exp-add \
+ src/nf-exp-delete \
+ src/nf-exp-list \
+ src/nf-log \
+ src/nf-monitor \
+ src/nf-queue \
+ src/nl-addr-add \
+ src/nl-addr-delete \
+ src/nl-addr-list \
+ src/nl-class-add \
+ src/nl-class-delete \
+ src/nl-class-list \
+ src/nl-classid-lookup \
+ src/nl-cls-add \
+ src/nl-cls-delete \
+ src/nl-cls-list \
+ src/nl-fib-lookup \
+ src/nl-link-enslave \
+ src/nl-link-ifindex2name \
+ src/nl-link-list \
+ src/nl-link-name2ifindex \
+ src/nl-link-release \
+ src/nl-link-set \
+ src/nl-link-stats \
+ src/nl-list-caches \
+ src/nl-list-sockets \
+ src/nl-monitor \
+ src/nl-neigh-add \
+ src/nl-neigh-delete \
+ src/nl-neigh-list \
+ src/nl-neightbl-list \
+ src/nl-nh-list \
+ src/nl-pktloc-lookup \
+ src/nl-qdisc-add \
+ src/nl-qdisc-delete \
+ src/nl-qdisc-list \
+ src/nl-route-add \
+ src/nl-route-delete \
+ src/nl-route-get \
+ src/nl-route-list \
+ src/nl-rule-list \
+ src/nl-tctree-list \
+ src/nl-util-addr \
+ $(NULL)
+
+if ENABLE_CLI
+if ENABLE_CLI_INSTALL_BIN
+bin_PROGRAMS += $(cli_programs)
+else
+if ENABLE_CLI_INSTALL_SBIN
+sbin_PROGRAMS += $(cli_programs)
+else
+noinst_PROGRAMS += $(cli_programs)
+endif
+endif
+else
+check_PROGRAMS += $(cli_programs)
+endif
+
+src_genl_ctrl_list_CPPFLAGS = $(src_cppflags)
+src_genl_ctrl_list_LDADD = $(src_ldadd)
+src_idiag_socket_details_CPPFLAGS = $(src_cppflags)
+src_idiag_socket_details_LDADD = $(src_ldadd)
+src_nf_ct_add_CPPFLAGS = $(src_cppflags)
+src_nf_ct_add_LDADD = $(src_ldadd)
+src_nf_ct_events_CPPFLAGS = $(src_cppflags)
+src_nf_ct_events_LDADD = $(src_ldadd)
+src_nf_ct_list_CPPFLAGS = $(src_cppflags)
+src_nf_ct_list_LDADD = $(src_ldadd)
+src_nf_exp_add_CPPFLAGS = $(src_cppflags)
+src_nf_exp_add_LDADD = $(src_ldadd)
+src_nf_exp_delete_CPPFLAGS = $(src_cppflags)
+src_nf_exp_delete_LDADD = $(src_ldadd)
+src_nf_exp_list_CPPFLAGS = $(src_cppflags)
+src_nf_exp_list_LDADD = $(src_ldadd)
+src_nf_log_CPPFLAGS = $(src_cppflags)
+src_nf_log_LDADD = $(src_ldadd)
+src_nf_monitor_CPPFLAGS = $(src_cppflags)
+src_nf_monitor_LDADD = $(src_ldadd)
+src_nf_queue_CPPFLAGS = $(src_cppflags)
+src_nf_queue_LDADD = $(src_ldadd)
+src_nl_addr_add_CPPFLAGS = $(src_cppflags)
+src_nl_addr_add_LDADD = $(src_ldadd)
+src_nl_addr_delete_CPPFLAGS = $(src_cppflags)
+src_nl_addr_delete_LDADD = $(src_ldadd)
+src_nl_addr_list_CPPFLAGS = $(src_cppflags)
+src_nl_addr_list_LDADD = $(src_ldadd)
+src_nl_class_add_CPPFLAGS = $(src_cppflags)
+src_nl_class_add_LDADD = $(src_ldadd)
+src_nl_class_delete_CPPFLAGS = $(src_cppflags)
+src_nl_class_delete_LDADD = $(src_ldadd)
+src_nl_class_list_CPPFLAGS = $(src_cppflags)
+src_nl_class_list_LDADD = $(src_ldadd)
+src_nl_classid_lookup_CPPFLAGS = $(src_cppflags)
+src_nl_classid_lookup_LDADD = $(src_ldadd)
+src_nl_cls_add_CPPFLAGS = $(src_cppflags)
+src_nl_cls_add_LDADD = $(src_ldadd)
+src_nl_cls_delete_CPPFLAGS = $(src_cppflags)
+src_nl_cls_delete_LDADD = $(src_ldadd)
+src_nl_cls_list_CPPFLAGS = $(src_cppflags)
+src_nl_cls_list_LDADD = $(src_ldadd)
+src_nl_fib_lookup_CPPFLAGS = $(src_cppflags)
+src_nl_fib_lookup_LDADD = $(src_ldadd)
+src_nl_link_enslave_CPPFLAGS = $(src_cppflags)
+src_nl_link_enslave_LDADD = $(src_ldadd)
+src_nl_link_ifindex2name_CPPFLAGS = $(src_cppflags)
+src_nl_link_ifindex2name_LDADD = $(src_ldadd)
+src_nl_link_list_CPPFLAGS = $(src_cppflags)
+src_nl_link_list_LDADD = $(src_ldadd)
+src_nl_link_name2ifindex_CPPFLAGS = $(src_cppflags)
+src_nl_link_name2ifindex_LDADD = $(src_ldadd)
+src_nl_link_release_CPPFLAGS = $(src_cppflags)
+src_nl_link_release_LDADD = $(src_ldadd)
+src_nl_link_set_CPPFLAGS = $(src_cppflags)
+src_nl_link_set_LDADD = $(src_ldadd)
+src_nl_link_stats_CPPFLAGS = $(src_cppflags)
+src_nl_link_stats_LDADD = $(src_ldadd)
+src_nl_list_caches_CPPFLAGS = $(src_cppflags)
+src_nl_list_caches_LDADD = $(src_ldadd)
+src_nl_list_sockets_CPPFLAGS = $(src_cppflags)
+src_nl_list_sockets_LDADD = $(src_ldadd)
+src_nl_monitor_CPPFLAGS = $(src_cppflags)
+src_nl_monitor_LDADD = $(src_ldadd)
+src_nl_neigh_add_CPPFLAGS = $(src_cppflags)
+src_nl_neigh_add_LDADD = $(src_ldadd)
+src_nl_neigh_delete_CPPFLAGS = $(src_cppflags)
+src_nl_neigh_delete_LDADD = $(src_ldadd)
+src_nl_neigh_list_CPPFLAGS = $(src_cppflags)
+src_nl_neigh_list_LDADD = $(src_ldadd)
+src_nl_neightbl_list_CPPFLAGS = $(src_cppflags)
+src_nl_neightbl_list_LDADD = $(src_ldadd)
+src_nl_nh_list_CPPFLAGS = $(src_cppflags)
+src_nl_nh_list_LDADD = $(src_ldadd)
+src_nl_pktloc_lookup_CPPFLAGS = $(src_cppflags)
+src_nl_pktloc_lookup_LDADD = $(src_ldadd)
+src_nl_qdisc_add_CPPFLAGS = $(src_cppflags)
+src_nl_qdisc_add_LDADD = $(src_ldadd)
+src_nl_qdisc_delete_CPPFLAGS = $(src_cppflags)
+src_nl_qdisc_delete_LDADD = $(src_ldadd)
+src_nl_qdisc_list_CPPFLAGS = $(src_cppflags)
+src_nl_qdisc_list_LDADD = $(src_ldadd)
+src_nl_route_add_CPPFLAGS = $(src_cppflags)
+src_nl_route_add_LDADD = $(src_ldadd)
+src_nl_route_delete_CPPFLAGS = $(src_cppflags)
+src_nl_route_delete_LDADD = $(src_ldadd)
+src_nl_route_get_CPPFLAGS = $(src_cppflags)
+src_nl_route_get_LDADD = $(src_ldadd)
+src_nl_route_list_CPPFLAGS = $(src_cppflags)
+src_nl_route_list_LDADD = $(src_ldadd)
+src_nl_rule_list_CPPFLAGS = $(src_cppflags)
+src_nl_rule_list_LDADD = $(src_ldadd)
+src_nl_tctree_list_CPPFLAGS = $(src_cppflags)
+src_nl_tctree_list_LDADD = $(src_ldadd)
+src_nl_util_addr_CPPFLAGS = $(src_cppflags)
+src_nl_util_addr_LDADD = $(src_ldadd)
+
+###############################################################################
+
+tests_cppflags = \
+ $(warn_cppflags) \
+ $(defines_cppflags) \
+ $(default_includes) \
+ $(NULL)
+
+tests_ldadd = \
+ lib/libnl-3.la \
+ lib/libnl-nf-3.la \
+ lib/libnl-genl-3.la \
+ lib/libnl-route-3.la \
+ $(NULL)
+
+if WITH_CHECK
+check_LTLIBRARIES += tests/libnl-test-util.la
+endif
+
+tests_libnl_test_util_la_SOURCES = \
+ tests/nl-test-util.h \
+ tests/nl-test-util.c \
+ $(NULL)
+tests_libnl_test_util_la_CPPFLAGS = \
+ $(tests_cppflags) \
+ $(CHECK_CFLAGS) \
+ $(NULL)
+tests_libnl_test_util_la_LIBADD = \
+ $(tests_ldadd) \
+ $(CHECK_LIBS) \
+ $(NULL)
+
+check_PROGRAMS += \
+ tests/test-complex-HTB-with-hash-filters \
+ tests/test-create-bond \
+ tests/test-create-bridge \
+ tests/test-create-geneve \
+ tests/test-create-ifb \
+ tests/test-create-ip6tnl \
+ tests/test-create-ipgre \
+ tests/test-create-ipgretap \
+ tests/test-create-ipip \
+ tests/test-create-ipvlan \
+ tests/test-create-ipvti \
+ tests/test-create-macsec \
+ tests/test-create-macvlan \
+ tests/test-create-macvtap \
+ tests/test-create-sit \
+ tests/test-create-veth \
+ tests/test-create-vlan \
+ tests/test-create-vrf \
+ tests/test-create-vxlan \
+ tests/test-create-xfrmi \
+ tests/test-delete-link \
+ tests/test-loopback-up-down \
+ tests/test-socket-creation \
+ tests/test-u32-filter-with-actions \
+ $(NULL)
+
+tests_test_complex_HTB_with_hash_filters_CPPFLAGS = $(tests_cppflags)
+tests_test_complex_HTB_with_hash_filters_LDADD = $(tests_ldadd)
+tests_test_create_bond_CPPFLAGS = $(tests_cppflags)
+tests_test_create_bond_LDADD = $(tests_ldadd)
+tests_test_create_bridge_CPPFLAGS = $(tests_cppflags)
+tests_test_create_bridge_LDADD = $(tests_ldadd)
+tests_test_create_geneve_CPPFLAGS = $(tests_cppflags)
+tests_test_create_geneve_LDADD = $(tests_ldadd)
+tests_test_create_ifb_CPPFLAGS = $(tests_cppflags)
+tests_test_create_ifb_LDADD = $(tests_ldadd)
+tests_test_create_ip6tnl_CPPFLAGS = $(tests_cppflags)
+tests_test_create_ip6tnl_LDADD = $(tests_ldadd)
+tests_test_create_ipgre_CPPFLAGS = $(tests_cppflags)
+tests_test_create_ipgre_LDADD = $(tests_ldadd)
+tests_test_create_ipgretap_CPPFLAGS = $(tests_cppflags)
+tests_test_create_ipgretap_LDADD = $(tests_ldadd)
+tests_test_create_ipip_CPPFLAGS = $(tests_cppflags)
+tests_test_create_ipip_LDADD = $(tests_ldadd)
+tests_test_create_ipvlan_CPPFLAGS = $(tests_cppflags)
+tests_test_create_ipvlan_LDADD = $(tests_ldadd)
+tests_test_create_ipvti_CPPFLAGS = $(tests_cppflags)
+tests_test_create_ipvti_LDADD = $(tests_ldadd)
+tests_test_create_macsec_CPPFLAGS = $(tests_cppflags)
+tests_test_create_macsec_LDADD = $(tests_ldadd)
+tests_test_create_macvlan_CPPFLAGS = $(tests_cppflags)
+tests_test_create_macvlan_LDADD = $(tests_ldadd)
+tests_test_create_macvtap_CPPFLAGS = $(tests_cppflags)
+tests_test_create_macvtap_LDADD = $(tests_ldadd)
+tests_test_create_sit_CPPFLAGS = $(tests_cppflags)
+tests_test_create_sit_LDADD = $(tests_ldadd)
+tests_test_create_veth_CPPFLAGS = $(tests_cppflags)
+tests_test_create_veth_LDADD = $(tests_ldadd)
+tests_test_create_vlan_CPPFLAGS = $(tests_cppflags)
+tests_test_create_vlan_LDADD = $(tests_ldadd)
+tests_test_create_vrf_CPPFLAGS = $(tests_cppflags)
+tests_test_create_vrf_LDADD = $(tests_ldadd)
+tests_test_create_vxlan_CPPFLAGS = $(tests_cppflags)
+tests_test_create_vxlan_LDADD = $(tests_ldadd)
+tests_test_create_xfrmi_CPPFLAGS = $(tests_cppflags)
+tests_test_create_xfrmi_LDADD = $(tests_ldadd)
+tests_test_delete_link_CPPFLAGS = $(tests_cppflags)
+tests_test_delete_link_LDADD = $(tests_ldadd)
+tests_test_loopback_up_down_CPPFLAGS = $(tests_cppflags)
+tests_test_loopback_up_down_LDADD = $(tests_ldadd)
+tests_test_socket_creation_CPPFLAGS = $(tests_cppflags)
+tests_test_socket_creation_LDADD = $(tests_ldadd)
+tests_test_u32_filter_with_actions_CPPFLAGS = $(tests_cppflags)
+tests_test_u32_filter_with_actions_LDADD = $(tests_ldadd)
+
+check_PROGRAMS += \
+ tests/test-cache-mngr \
+ tests/test-genl \
+ tests/test-nf-cache-mngr \
+ $(NULL)
+
+tests_cli_ldadd = \
+ $(tests_ldadd) \
+ src/lib/libnl-cli-3.la \
+ $(NULL)
+
+tests_test_cache_mngr_CPPFLAGS = $(tests_cppflags)
+tests_test_cache_mngr_LDADD = $(tests_cli_ldadd)
+tests_test_genl_CPPFLAGS = $(tests_cppflags)
+tests_test_genl_LDADD = $(tests_cli_ldadd)
+tests_test_nf_cache_mngr_CPPFLAGS = $(tests_cppflags)
+tests_test_nf_cache_mngr_LDADD = $(tests_cli_ldadd)
+
+
+if WITH_CHECK
+check_programs += tests/check-all
+endif
+
+tests_check_all_SOURCES = \
+ tests/check-all.c \
+ tests/cksuite-all-addr.c \
+ tests/cksuite-all-attr.c \
+ tests/cksuite-all-ematch-tree-clone.c \
+ tests/cksuite-all-netns.c \
+ tests/cksuite-all.h \
+ $(NULL)
+
+tests_check_all_CPPFLAGS = \
+ $(tests_cppflags) \
+ $(CHECK_CFLAGS)
+
+tests_check_all_LDADD = \
+ $(tests_ldadd) \
+ tests/libnl-test-util.la \
+ $(CHECK_LIBS) \
+ $(NULL)
+
+if WITH_CHECK
+if ENABLE_STATIC
+check_programs += tests/check-direct
+endif
+endif
+
+tests_check_direct_SOURCES = \
+ tests/check-direct.c \
+ $(NULL)
+
+tests_check_direct_CPPFLAGS = \
+ $(tests_cppflags) \
+ $(CHECK_CFLAGS) \
+ $(NULL)
+
+tests_check_direct_LDFLAGS = \
+ -static \
+ $(NULL)
+
+tests_check_direct_LDADD = \
+ $(tests_ldadd) \
+ tests/libnl-test-util.la \
+ $(CHECK_LIBS) \
+ $(NULL)
+
+###############################################################################
+
+dist_man8_MANS = \
+ man/genl-ctrl-list.8 \
+ man/nl-classid-lookup.8 \
+ man/nl-pktloc-lookup.8 \
+ man/nl-qdisc-add.8 \
+ man/nl-qdisc-delete.8 \
+ man/nl-qdisc-list.8 \
+ $(NULL)
+
+###############################################################################
+
+python-build:
+ cd "$(srcdir)/python"; \
+ python setup.py build
+
+.PHONY: python-build
+
+EXTRA_DIST += \
+ python/README \
+ \
+ python/doc/conf.py \
+ python/doc/core.rst \
+ python/doc/index.rst \
+ python/doc/route_addr.rst \
+ python/doc/route.rst \
+ \
+ python/examples/iface.py \
+ python/examples/nl80211.py \
+ python/examples/wiphy.py \
+ \
+ python/netlink/capi.i \
+ python/netlink/__init__.py \
+ python/netlink/core.py \
+ python/netlink/util.py \
+ python/netlink/utils.h \
+ \
+ python/netlink/genl/capi.i \
+ python/netlink/genl/__init__.py \
+ \
+ python/netlink/route/capi.i \
+ python/netlink/route/__init__.py \
+ python/netlink/route/address.py \
+ python/netlink/route/link.py \
+ python/netlink/route/tc.py \
+ python/netlink/route/links/__init__.py \
+ python/netlink/route/links/dummy.py \
+ python/netlink/route/links/inet.py \
+ python/netlink/route/links/vlan.py \
+ python/netlink/route/qdisc/__init__.py \
+ python/netlink/route/qdisc/htb.py \
+ \
+ python/tests/test-create-bridge.py
+
+###############################################################################
+
+%.build-headers-test.c: %
+ mkdir -p "$(dir $@)"
+ printf "#include <$$(echo "$<" | sed 's|.*\\nint main(void) { return 0; }" > $@
+
+%.build-headers-test.o: %.build-headers-test.c
+ $(CC) -Wall -Werror -D_NL_NO_WARN_DEPRECATED_HEADER -I$(srcdir)/include -I$(builddir)/include -c -o $@ $<
+
+BUILD_HEADERS_OBJS = $(patsubst %,%.build-headers-test.o,$(public_headers))
+
+# Test whether the public headers are all self-contained and can be build.
+# This test is not hooked up as `make check`.
+check-build-headers: $(BUILD_HEADERS_OBJS)
+
+CLEANFILES += $(BUILD_HEADERS_OBJS)
+
+check_build += check-build-headers
+
+###############################################################################
+
+if HAS_CXX
+%.build-headers-test-cxx.cpp: %
+ mkdir -p "$(dir $@)"
+ printf "#include \n#include <$$(echo "$<" | sed 's|.*\\nint main(void) { return 0; }" > $@
+
+%.build-headers-test-cxx.o: %.build-headers-test-cxx.cpp %.build-headers-test.o
+ $(CXX) -Wall -Werror -D_NL_NO_WARN_DEPRECATED_HEADER -I$(srcdir)/include -I$(builddir)/include -c -o $@ $<
+
+BUILD_HEADERS_OBJS_CXX = $(patsubst %,%.build-headers-test-cxx.o,$(public_headers))
+
+CLEANFILES += $(BUILD_HEADERS_OBJS_CXX)
+
+check-build-headers-cxx: $(BUILD_HEADERS_OBJS_CXX)
+
+check_build += check-build-headers-cxx
+endif
+
+###############################################################################
+
+check-local: $(check_build) $(check_local)
+
+.PHONY: $(check_local)
+
+check_PROGRAMS += $(check_programs)
+TESTS += $(check_programs)
+
+if ENABLE_CLI
+pkgconfig_DATA += libnl-cli-3.0.pc
+endif
+
+pkgsysconfdir = $(sysconfdir)/libnl
+pkgsysconf_DATA = \
+ etc/pktloc \
+ etc/classid
+
+EXTRA_DIST += \
+ $(pkgsysconf_DATA) \
+ libnl-3.sym \
+ libnl-cli-3.sym \
+ libnl-genl-3.sym \
+ libnl-idiag-3.sym \
+ libnl-nf-3.sym \
+ libnl-route-3.sym \
+ libnl-xfrm-3.sym \
+ $(NULL)
+
+###############################################################################
+
+check-build: all $(check_PROGRAMS) $(check_LTLIBRARIES) $(check_build)
+
+check-progs: check-build
+
+.PHONY: check-progs check-build
+
+###############################################################################
diff --git a/libnl/autogen.sh b/libnl/autogen.sh
new file mode 100755
index 0000000..b0e2fde
--- /dev/null
+++ b/libnl/autogen.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -e
+
+die() {
+ echo "$@" >&2
+ exit 1
+}
+
+BASEDIR="$(dirname "$0")"
+
+cd "$BASEDIR" || die "Could not change into base directory $BASEDIR"
+
+autoreconf -fi || die "Error during autoreconf"
+rm -rf autom4te.cache
+
+doc/autogen.sh || die "Error during doc/autogen.sh"
diff --git a/libnl/configure.ac b/libnl/configure.ac
new file mode 100644
index 0000000..1556ea4
--- /dev/null
+++ b/libnl/configure.ac
@@ -0,0 +1,185 @@
+# SPDX-License-Identifier: LGPL-2.1-only
+
+#
+# Copyright (c) 2003-2013 Thomas Graf
+#
+
+# copied from glib
+m4_define([libnl_major_version], [3])
+m4_define([libnl_minor_version], [11])
+m4_define([libnl_micro_version], [0])
+m4_define([libnl_git_sha], [m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
+
+
+# The following explanation may help to understand the above rules a bit
+# better: consider that there are three possible kinds of reactions from
+# users of your library to changes in a shared library:
+#
+# 1. Programs using the previous version may use the new version as drop-in
+# replacement, and programs using the new version can also work with the
+# previous one. In other words, no recompiling nor relinking is needed.
+# In this case, bump revision only, don't touch current nor age.
+#
+# 2. Programs using the previous version may use the new version as drop-in
+# replacement, but programs using the new version may use APIs not
+# present in the previous one. In other words, a program linking against
+# the new version may fail with “unresolved symbols” if linking against
+# the old version at runtime: set revision to 0, bump current and age.
+#
+# 3. Programs may need to be changed, recompiled, relinked in order to use
+# the new version. Bump current, set revision and age to 0.
+
+m4_define([libnl_lt_current], [226])
+m4_define([libnl_lt_revision], [0])
+m4_define([libnl_lt_age], [26])
+
+m4_define([libnl_version],
+ [libnl_major_version.libnl_minor_version.libnl_micro_version])
+
+AC_INIT([libnl],[libnl_version],[],[],[http://www.infradead.org/~tgr/libnl/])
+AC_CONFIG_HEADERS([include/config.h])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+
+MAJ_VERSION=libnl_major_version
+AC_SUBST(MAJ_VERSION)
+MIN_VERSION=libnl_minor_version
+AC_SUBST(MIN_VERSION)
+MIC_VERSION=libnl_micro_version
+AC_SUBST(MIC_VERSION)
+LIBNL_GIT_SHA=libnl_git_sha
+LIBNL_VERSION=libnl_version
+AC_SUBST(LIBNL_VERSION)
+
+LT_CURRENT=libnl_lt_current
+AC_SUBST(LT_CURRENT)
+LT_REVISION=libnl_lt_revision
+AC_SUBST(LT_REVISION)
+LT_AGE=libnl_lt_age
+AC_SUBST(LT_AGE)
+
+AC_USE_SYSTEM_EXTENSIONS
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_INSTALL
+LT_INIT
+AC_PROG_MKDIR_P
+AC_CHECK_PROGS(FLEX, 'flex')
+AC_CHECK_PROGS(YACC, 'bison -y')
+
+AC_C_CONST
+AC_C_INLINE
+
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#ifndef __cplusplus
+ #error "broken C++"
+ #endif]])],,
+ [CXX=;])
+AC_LANG_POP([C++])
+AM_CONDITIONAL([HAS_CXX], [test "x$CXX" != x])
+
+PKG_CHECK_MODULES([CHECK], [check >= 0.9.0],
+ [has_check="yes"],
+ [AC_MSG_WARN([*** Disabling building of unit tests])
+ has_check="no"])
+AM_CONDITIONAL(WITH_CHECK, [test "$has_check" = 'yes'])
+
+AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
+ [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
+ [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
+AC_SUBST([pkgconfigdir])
+
+AC_ARG_ENABLE([cli],
+ AS_HELP_STRING([--enable-cli=yes|no|no-inst|bin|sbin], [Whether to build command line interface utils. Defaults to 'yes' which is a synonym for 'bin'. 'no-inst' means only build, not installing. 'bin'/'sbin' means installing to bin/sbin directory]),
+ [enable_cli="$enableval"], [enable_cli="yes"])
+if test "$enable_cli" != "no" &&
+ test "$enable_cli" != "no-inst" &&
+ test "$enable_cli" != "sbin"; then
+ enable_cli="bin"
+fi
+AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" != "no"])
+AM_CONDITIONAL([ENABLE_CLI_INSTALL_BIN], [test "$enable_cli" = "bin"])
+AM_CONDITIONAL([ENABLE_CLI_INSTALL_SBIN], [test "$enable_cli" = "sbin"])
+
+AC_CHECK_HEADERS(dlfcn.h, [], [])
+
+AC_ARG_ENABLE([pthreads],
+ AS_HELP_STRING([--disable-pthreads], [Disable pthreads support]),
+ [enable_pthreads="$enableval"], [enable_pthreads="yes"])
+AM_CONDITIONAL([DISABLE_PTHREADS], [test "$enable_pthreads" = "no"])
+if test "x$enable_pthreads" = "xno"; then
+ AC_DEFINE([DISABLE_PTHREADS], [1], [Define to 1 to disable pthreads])
+else
+ AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required]))
+fi
+
+AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" != "no"])
+
+AC_ARG_ENABLE([debug],
+ AS_HELP_STRING([--disable-debug], [Do not include debugging statements]),
+ [enable_debug="$enableval"], [enable_debug="yes"])
+if test "$enable_debug" = "yes"; then
+ AC_DEFINE([NL_DEBUG], [1], [Define to 1 to enable debugging])
+else
+ enable_debug=no
+ AC_DEFINE([NL_DEBUG], [0], [Define to 1 to enable debugging])
+fi
+
+AC_CONFIG_SUBDIRS([doc])
+
+AC_CHECK_FUNCS([strerror_l])
+
+AC_CHECK_DECLS([getprotobyname_r, getprotobynumber_r], [], [], [[
+ #include
+]])
+
+AC_CONFIG_FILES([
+Makefile
+libnl-3.0.pc
+libnl-route-3.0.pc
+libnl-genl-3.0.pc
+libnl-nf-3.0.pc
+libnl-cli-3.0.pc
+libnl-xfrm-3.0.pc
+libnl-idiag-3.0.pc
+python/setup.py
+include/netlink/version.h
+])
+
+ac_errcount=0
+if test -z "$YACC"; then
+ AC_MSG_WARN(bison not found. Please install before continuing.)
+ ac_errcount=$((ac_errcount + 1))
+fi
+if test -z "$FLEX"; then
+ AC_MSG_WARN(flex not found. Please install before continuing.)
+ ac_errcount=$((ac_errcount + 1))
+fi
+if test $ac_errcount -gt 0; then
+ AC_MSG_ERROR(Required packages are missing. Please install them and rerun ./configure)
+fi
+
+AC_OUTPUT
+
+CXX_MSG="none"
+if test "x$CXX" != x ; then
+ CXX_MSG="[$CXX]"
+fi
+
+echo
+echo "libnl $LIBNL_VERSION configuration${LIBNL_GIT_SHA:+ (git:$LIBNL_GIT_SHA)}:"
+echo " --enable-pthreads=$enable_pthreads"
+echo " --enable-static=$enable_static"
+echo
+echo " --enable-debug=$enable_debug"
+echo " --enable-cli=$enable_cli"
+echo
+echo " check: $has_check"
+echo " CXX: $CXX_MSG (only used for tests)"
+echo
diff --git a/libnl/doc/AUTHORS b/libnl/doc/AUTHORS
new file mode 100644
index 0000000..26e3cb4
--- /dev/null
+++ b/libnl/doc/AUTHORS
@@ -0,0 +1 @@
+Thomas Graf
diff --git a/libnl/doc/COPYING b/libnl/doc/COPYING
new file mode 100644
index 0000000..f288702
--- /dev/null
+++ b/libnl/doc/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/libnl/doc/Doxyfile.in b/libnl/doc/Doxyfile.in
new file mode 100644
index 0000000..0c4fcc4
--- /dev/null
+++ b/libnl/doc/Doxyfile.in
@@ -0,0 +1,1806 @@
+# Doxyfile 1.8.1.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME = libnl
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = @PACKAGE_VERSION@
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = NO
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES = arg=\param \
+ "ref_asciidoc{3}=\3" \
+ "ref_core{2}=\ref_asciidoc{core,\1,\2 (Netlink Core Library Development Guide)}" \
+ "ref_route{2}=\ref_asciidoc{route,\1,\2 (Netlink Routing Development Guide)}" \
+ "ref_idiagnl{2}=\ref_asciidoc{idiag,\1,\2 (Netlink Inet Diag Development Guide)}" \
+ "core_doc{2}=\ref_core{\1,\2}" \
+ "route_doc{2}=\ref_route{\1,\2}" \
+ "idiagnl_doc{2}=\ref_idiagnl{\1,\2}" \
+ "callback=\par Callback Invocation:\n" \
+ "lowlevel=\copydoc low_level_api"
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = YES
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = NO
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command , where is the value of
+# the FILE_VERSION_FILTER tag, and is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE = DoxygenLayout.xml
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = NO
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = @top_srcdir@/../lib \
+ @top_srcdir@/../src/lib \
+ @top_srcdir@/../include/netlink \
+ @top_srcdir@/../src \
+ @top_srcdir@/../doc/src
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS = *.c \
+ *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE = SCCS
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = @top_srcdir@/src
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command , where
+# is the value of the INPUT_FILTER tag, and is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX = nl_
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = api
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET = @srcdir@/libnl.css
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+#
+# Qt Help Project / Custom Filters.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+#
+# Qt Help Project / Filter Attributes.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.infradead.libnl
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE = 1
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 205
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES = NO
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE = api/libnl.tag
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = YES
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME = FreeSans.ttf
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = YES
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 100
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/libnl/doc/DoxygenLayout.xml b/libnl/doc/DoxygenLayout.xml
new file mode 100644
index 0000000..589d0f1
--- /dev/null
+++ b/libnl/doc/DoxygenLayout.xml
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libnl/doc/Makefile.am b/libnl/doc/Makefile.am
new file mode 100644
index 0000000..67ae1fc
--- /dev/null
+++ b/libnl/doc/Makefile.am
@@ -0,0 +1,80 @@
+# -*- Makefile -*-
+
+.PHONY: gendoc api_ref asciidoc
+
+ASCIIDOCOPTS = \
+ -a pygments \
+ -a language=c \
+ -a icons \
+ -a toc2 \
+ -a numbered \
+ -a imagesdir="./images/" \
+ -a iconsdir="./images/icons" \
+ -a stylesdir="$(abs_srcdir)/stylesheets/"
+
+EXTRA_DIST = \
+ core.txt \
+ core.html \
+ route.txt \
+ route.html \
+ index.txt \
+ index.html \
+ libnl.css \
+ stylesheets \
+ images \
+ api
+
+dist-hook:
+ rm -f $(distdir)/aclocal.m4
+ rm -f $(distdir)/configure
+ rm -f $(distdir)/configure.in
+ rm -rf $(distdir)/m4
+ rm -f $(distdir)/README
+ rm -f $(distdir)/missing
+ rm -f $(distdir)/Doxyfile.in
+ rm -f $(distdir)/Makefile.am
+ rm -f $(distdir)/Makefile.in
+
+link_doc:
+if LINK_DOC
+ ./gen-tags.sh > libnl.dict
+else
+ @echo "Warning: Linking to API reference is disabled, check configure output"
+endif
+
+
+%.html: %.txt link_doc
+if HAVE_ASCIIDOC
+ ./resolve-asciidoc-refs.py $< > asciidoc.tmp
+ asciidoc $(ASCIIDOCOPTS) -o $@ asciidoc.tmp
+if LINK_DOC
+ ./doxygen-link.py libnl.dict $@ > asciidoc.tmp
+ mv asciidoc.tmp $@
+endif
+else
+ @echo "Warning: Building of asciidoc files is disabled, check autoconf logs"
+endif
+
+asciidoc: core.html route.html index.html
+
+api_ref:
+ doxygen Doxyfile;
+
+gendoc:
+if GENERATE_DOC
+if HAVE_DOXYGEN
+ $(MAKE) api_ref
+else
+ @echo "Warning: Building of API reference (doxygen) is disabled, check autoconf logs"
+endif
+if HAVE_ASCIIDOC
+ $(MAKE) asciidoc
+else
+ @echo "Warning: Building of asciidoc files is disabled, check autoconf logs"
+endif
+else
+ @echo "Warning: Building of documentation disabled by user or autoconf"
+endif
+
+clean-local:
+ rm -f api/* libnl.dict *.html
diff --git a/libnl/doc/README b/libnl/doc/README
new file mode 100644
index 0000000..dbca8f5
--- /dev/null
+++ b/libnl/doc/README
@@ -0,0 +1,13 @@
+Requirements to build documentation
+
+mscgen
+ http://www.mcternan.me.uk/mscgen/
+
+mscgen-filter-1.2
+ https://github.com/hwmaier/asciidoc-mscgen-filter
+
+asciidoc > 8.6.x
+doxygen > 1.8.0
+
+Building the documentation:
+make gendoc
diff --git a/libnl/doc/api/.gitignore b/libnl/doc/api/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/libnl/doc/autogen.sh b/libnl/doc/autogen.sh
new file mode 100755
index 0000000..a147e93
--- /dev/null
+++ b/libnl/doc/autogen.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+BASEDIR="$(dirname "$0")"
+
+cd "$BASEDIR" || die "Could not change into base directory $BASEDIR"
+
+autoreconf -fi
+rm -rf autom4te.cache
diff --git a/libnl/doc/configure.ac b/libnl/doc/configure.ac
new file mode 100644
index 0000000..3317d62
--- /dev/null
+++ b/libnl/doc/configure.ac
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: LGPL-2.1-only
+#
+# Copyright (c) 2003-2013 Thomas Graf
+#
+
+AC_INIT(libnl-doc, [3.11.0], [http://www.infradead.org/~tgr/libnl/])
+AC_CONFIG_MACRO_DIR([../m4])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([foreign])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
+
+#
+# Generating the documentation
+#
+AC_ARG_ENABLE([doc],
+ AS_HELP_STRING([--disable-doc], [Do not generate documentation]),
+ [generate_doc="$enableval"], [generate_doc=auto])
+
+if test "x$generate_doc" != "xno"; then
+ AC_PROG_SED
+ AC_PROG_EGREP
+
+ AC_CHECK_PROG(HAVE_PYTHON, [python], yes, no)
+ if test "x$HAVE_PYTHON" = "xno" -a "x$generate_doc" = "xyes"; then
+ AC_MSG_ERROR([*** python binary required to generate documentation])
+ fi
+
+ AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], yes, no)
+ if test "x$HAVE_DOXYGEN" = "xno" -a "x$generate_doc" = "xyes"; then
+ AC_MSG_ERROR([*** doxygen package required to generate documentation])
+ fi
+
+ AC_CHECK_PROG(HAVE_DOT, [dot], yes, no)
+ if test "x$HAVE_DOT" = "xno"; then
+ if test "x$generate_doc" = "xyes"; then
+ AC_MSG_ERROR([*** graphviz package required to generate documentation])
+ else
+ AC_MSG_WARN([*** graphviz not found, disabling building of API reference])
+ HAVE_DOXYGEN=no
+ fi
+ fi
+
+ AC_CHECK_PROG(HAVE_ASCIIDOC, [asciidoc], yes, no)
+ if test "x$HAVE_ASCIIDOC" = "xno"; then
+ if test "x$generate_doc" = "xyes"; then
+ AC_MSG_ERROR([*** asciidoc package required to generate documentation])
+ else
+ AC_MSG_WARN([*** asciidoc not found, disabling building of guides])
+ fi
+ fi
+
+ AC_CHECK_PROG(HAVE_SOURCE_HIGHLIGHT, [source-highlight], yes, no)
+ if test "x$HAVE_SOURCE_HIGHLIGHT" = "xno"; then
+ if test "x$generate_doc" = "xyes"; then
+ AC_MSG_ERROR([*** source-highlight required to generate documentation])
+ else
+ AC_MSG_WARN([*** source-highlight not found, disabling building of guides])
+ HAVE_ASCIIDOC=no
+ fi
+ fi
+
+ AC_CHECK_PROG(HAVE_MSCGEN, [mscgen], yes, no)
+ if test "x$HAVE_MSCGEN" = "xno"; then
+ AC_MSG_WARN([*** mscgen not found, get it at http://www.mcternan.me.uk/mscgen/])
+ if test "x$generate_doc" = "xyes"; then
+ AC_MSG_ERROR([*** mscgen package required to generate documentation])
+ else
+ AC_MSG_WARN([*** Disabling building of guides])
+ HAVE_ASCIIDOC=no
+ HAVE_DOXYGEN=no
+ fi
+ fi
+
+ AC_CHECK_PROG(HAVE_PYGMENTIZE, [pygmentize], yes, no)
+ if test "x$HAVE_PYGMENTIZE" = "xno"; then
+ if test "x$generate_doc" = "xyes"; then
+ AC_MSG_ERROR([*** pygmentize package required to generate documentation])
+ else
+ AC_MSG_WARN([*** Disabling building of guides])
+ HAVE_ASCIIDOC=no
+ fi
+ fi
+
+ link_doc=yes
+ if test "x$HAVE_DOXYGEN" = "xno"; then
+ AC_MSG_WARN([*** Disabling API linking due to missing doxygen package])
+ link_doc=no
+ fi
+fi
+
+AM_CONDITIONAL([LINK_DOC], [test "x$link_doc" = "xyes"])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$HAVE_DOXYGEN" = "xyes"])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "x$HAVE_ASCIIDOC" = "xyes"])
+
+AM_CONDITIONAL([GENERATE_DOC], [test "x$generate_doc" != "xno"])
+
+AC_CONFIG_FILES([
+Doxyfile
+Makefile
+])
+
+AC_OUTPUT
diff --git a/libnl/doc/core.txt b/libnl/doc/core.txt
new file mode 100644
index 0000000..56d8749
--- /dev/null
+++ b/libnl/doc/core.txt
@@ -0,0 +1,3017 @@
+////
+ vim.syntax: asciidoc
+
+ Copyright (c) 2011 Thomas Graf
+////
+
+Netlink Library (libnl)
+=======================
+Thomas Graf
+3.2, May 9 2011:
+:numbered:
+
+== Introduction
+
+The core library contains the fundamentals required to communicate
+over netlink sockets. It deals with connecting and disconnecting of
+sockets, sending and receiving of data, construction and parsing of
+messages, provides a customizable receiving state machine, and
+provides an abstract data type framework which eases the implementation
+of object based netlink protocols where objects are added, removed, or
+modified using a netlink based protocol.
+
+.Library Hierarchy
+
+The suite is split into multiple libraries:
+
+image:library_overview.png["Library Hierarchy"]
+
+link:core.html[Netlink Library] (libnl)::
+Socket handling, sending and receiving, message construction and parsing, ...
+
+link:route.html[Routing Family Library] (libnl-route)::
+Adresses, links, neighbours, routing, traffic control, neighbour tables, ...
+
+Netfilter Library (libnl-nf)::
+Connection tracking, logging, queueing
+
+Generic Netlink Library (libnl-genl)::
+Controller API, family and command registration
+
+
+=== How To Read This Documentation
+
+The libraries provide a broad set of APIs of which most applications only
+require a small subset of it. Depending on the type of application, some
+users may only be interested in the low level netlink messaging API while
+others wish to make heavy use of the high level API.
+
+In any case it is recommended to get familiar with the netlink protocol
+first.
+
+- <>
+
+The low level APIs are described in:
+
+- <>
+- <>
+
+
+=== Linking to this Library
+
+.Checking the presence of the library using autoconf
+
+Projects using autoconf may use +PKG_CHECK_MODULES()+ to check if
+a specific version of libnl is available on the system. The example
+below also shows how to retrieve the +CFLAGS+ and linking dependencies
+required to link against the library.
+
+The following example shows how to check for a specific version of libnl. If
+found, it extends the `CFLAGS` and `LIBS` variable appropriately:
+
+[source]
+----
+PKG_CHECK_MODULES(LIBNL3, libnl-3.0 >= 3.1, [have_libnl3=yes], [have_libnl3=no])
+if (test "${have_libnl3}" = "yes"); then
+ CFLAGS+="$LIBNL3_CFLAGS"
+ LIBS+="$LIBNL3_LIBS"
+fi
+----
+
+NOTE: The pkgconfig file is named +libnl-3.0.pc+ for historic reasons, it also
+ covers library versions >= 3.1.
+
+.Header Files
+
+The main header file is ``. Additional headers may need to
+be included in your sources depending on the subsystems and components your
+program makes use of.
+
+[source,c]
+-----
+#include
+#include
+#include
+-----
+
+.Version Dependent Code
+
+If your code wishes to be capable to link against multiple versions of libnl
+you may have direct the compiler to only include portions on the code depending
+on the version of libnl that it is compiled against.
+
+[source,c]
+-----
+#include
+
+#if LIBNL_VER_NUM >= LIBNL_VER(3,1)
+ /* include code if compiled with libnl version >= 3.1 */
+#endif
+-----
+
+.Linking
+-----
+$ gcc myprogram.c -o myprogram $(pkgconfig --cflags --libs libnl-3.0)
+-----
+
+=== Debugging
+
+The library has been compiled with debugging statements enabled it will
+print debug information to +stderr+ if the environment variable +NLDBG+
+is set to > 0.
+
+-----
+$ NLDBG=2 ./myprogram
+-----
+
+.Debugging Levels
+[options="header", width="80%", cols="1,5", align="center"]
+|===============================================================
+| Level | Description
+| 0 | Debugging disabled (default)
+| 1 | Warnings, important events and notifications
+| 2 | More or less important debugging messages
+| 3 | Repetitive events causing a flood of debugging messages
+| 4 | Even less important messages
+|===============================================================
+
+.Debugging the Netlink Protocol
+
+It is often useful to peek into the stream of netlink messages exchanged
+with other sockets. Setting the environment variable +NLCB=debug+ will
+cause the debugging message handlers to be used which in turn print the
+netlink messages exchanged in a human readable format to to +stderr+:
+
+-----
+$ NLCB=debug ./myprogram
+-- Debug: Sent Message:
+-------------------------- BEGIN NETLINK MESSAGE ---------------------------
+ [HEADER] 16 octets
+ .nlmsg_len = 20
+ .nlmsg_type = 18
+ .nlmsg_flags = 773
+ .nlmsg_seq = 1301410712
+ .nlmsg_pid = 20014
+ [PAYLOAD] 16 octets
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+--------------------------- END NETLINK MESSAGE ---------------------------
+-- Debug: Received Message:
+-------------------------- BEGIN NETLINK MESSAGE ---------------------------
+ [HEADER] 16 octets
+ .nlmsg_len = 996
+ .nlmsg_type = 16
+ .nlmsg_flags = 2
+ .nlmsg_seq = 1301410712
+ .nlmsg_pid = 20014
+ [PAYLOAD] 16 octets
+ 00 00 04 03 01 00 00 00 49 00 01 00 00 00 00 00 ........I.......
+ [ATTR 03] 3 octets
+ 6c 6f 00 lo.
+ [PADDING] 1 octets
+ 00 .
+ [ATTR 13] 4 octets
+ 00 00 00 00 ....
+ [ATTR 16] 1 octets
+ 00 .
+ [PADDING] 3 octets
+ 00 00 00 ...
+ [ATTR 17] 1 octets
+ 00 .
+ [...]
+--------------------------- END NETLINK MESSAGE ---------------------------
+
+-----
+
+[[core_netlink_fundamentals]]
+== Netlink Protocol Fundamentals
+
+The netlink protocol is a socket based IPC mechanism used for
+communication between userspace processes and the kernel or between
+userspace processes themselves. The netlink protocol is based on BSD
+sockets and uses the +AF_NETLINK+ address family. Every netlink
+protocol uses its own protocol number (e.g. +NETLINK_ROUTE+,
++NETLINK_NETFILTER+, etc). Its addressing schema is based on a 32 bit
+port number, formerly referred to as PID, which uniquely identifies
+each peer.
+
+[[core_addressing]]
+=== Addressing
+
+The netlink address (port) consists of a 32bit integer. Port 0 (zero)
+is reserved for the kernel and refers to the kernel side socket of each
+netlink protocol family. Other port numbers usually refer to user space
+owned sockets, although this is not enforced.
+
+NOTE: In the beginning, it was common practice to use the process
+ identifier (PID) as the local port number. This became unpractical
+ with the introduction of threaded netlink applications and
+ applications requiring multiple sockets. Therefore libnl generates
+ unique port numbers based on the process identifier and adds an
+ offset to it allowing for multiple sockets to be used. The initial
+ socket will still equal to the process identifier for backwards
+ compatibility reasons.
+
+image:addressing.png["Addressing Example"]
+
+The above figure illustrates three applications and the kernel side
+exposing two kernel side sockets. It shows the common netlink use
+cases:
+
+ * User space to kernel
+ * User space to user space
+ * Listening to kernel multicast notifications
+
+.User Space to Kernel
+
+The most common form of netlink usage is for a user space application
+to send requests to the kernel and process the reply which is either
+an error message or a success notification.
+
+["mscgen"]
+--------
+msc {
+ App1,App2,Kernel;
+ App1=>Kernel [label="request (src=11, dst=0)"];
+ App1<=Kernel [label="reply (src=0, dst=11)"];
+ ...;
+ App2=>Kernel [label="request (src=21, dst=0)"];
+ App2<=Kernel [label="reply (src=0, dst=21)"];
+}
+--------
+
+.User Space to User Space
+
+Netlink may also be used as an IPC mechanism to communicate between user
+space applications directly. Communication is not limited to two peers,
+any number of peers may communicate with each other and multicasting
+capabilities allow to reach multiple peers with a single message.
+
+In order for the sockets to be visible to each other, both sockets must
+be created for the same netlink protocol family.
+
+["mscgen"]
+--------
+msc {
+ App2,App3;
+ App2=>App3 [label="request (src=22, dst=31)"];
+ App2<=App3 [label="reply (src=31, dst=22)"];
+ ...;
+}
+--------
+
+.User space listening to kernel notifications
+
+This form of netlink communication is typically found in user space
+daemons that need to act on certain kernel events. Such daemons will
+typically maintain a netlink socket subscribed to a multicast group that
+is used by the kernel to notify interested user space parties about
+specific events.
+
+["mscgen"]
+--------
+msc {
+ Kernel,App3;
+ Kernel=>App3 [label="notification (src=0, group=foo)"];
+ ...;
+}
+--------
+
+Use of multicasting is preferred over direct addressing due to the
+flexibility in exchanging the user space component at any time without
+the kernel noticing.
+
+[[core_msg_format]]
+=== Message Format
+
+A netlink protocol is typically based on messages and consists of the
+netlink message header (+struct nlmsghdr+) plus the payload attached
+to it. The payload can consist of arbitrary data but usually contains
+a fixed size protocol specific header followed by a stream of
+attributes.
+
+.Netlink message header (struct nlmsghdr)
+
+image:nlmsghdr.png[align="center", alt="Netlink Message Header"]
+
+Total Length (32bit)::
+Total length of the message in bytes including the netlink message header.
+
+Message Type (16bit)::
+The message type specifies the type of payload the message is carrying.
+Several standard message types are defined by the netlink protocol.
+Additional message types may be defined by each protocol family. See
+<> for additional information.
+
+Message Flags (16bit)::
+The message flags may be used to modify the behaviour of a message type.
+See section <> for a list of standard message flags.
+
+Sequence Number (32bit)::
+The sequence number is optional and may be used to allow referring to
+a previous message, e.g. an error message can refer to the original
+request causing the error.
+
+Port Number (32bit)::
+The port number specifies the peer to which the message should be delivered
+to. If not specified, the message will be delivered to the first matching
+kernel side socket of the same protocol family.
+
+[[core_msg_types]]
+=== Message Types
+
+Netlink differs between requests, notifications, and replies. Requests
+are messages which have the +NLM_F_REQUEST+ flag set and are meant to
+request an action from the receiver. A request is typically sent from
+a userspace process to the kernel. While not strictly enforced, requests
+should carry a sequence number incremented for each request sent.
+
+Depending on the nature of the request, the receiver may reply to the
+request with another netlink message. The sequence number of a reply
+must match the sequence number of the request it relates to.
+
+Notifications are of informal nature and no reply is expected, therefore
+the sequence number is typically set to 0.
+
+["mscgen"]
+--------
+msc {
+ A,B;
+ A=>B [label="GET (seq=1, NLM_F_REQUEST)"];
+ A<=B [label="PUT (seq=1)"];
+ ...;
+ A<=B [label="NOTIFY (seq=0)"];
+}
+--------
+
+
+The type of message is primarly identified by its 16 bit message type set
+in the message header. The following standard message types are defined:
+
+- +NLMSG_NOOP+ - No operation, message must be discarded
+- +NLMSG_ERROR+ - Error message or ACK, see <>
+ respectively <>
+- +NLMSG_DONE+ - End of multipart sequence, see <>
+- +NLMSG_OVERRUN+ - Overrun notification (Error)
+
+Every netlink protocol is free to define own message types. Note that
+message type values +< NLMSG_MIN_TYPE (0x10)+ are reserved and may
+not be used.
+
+It is common practice to use own message types to implement RPC schemas.
+Suppose the goal of the netlink protocol you are implementing is allow
+configuration of a particular network device, therefore you want to
+provide read/write access to various configuration options. The typical
+"netlink way" of doing this would be to define two message types
++MSG_SETCFG+, +MSG_GETCFG+:
+
+[source,c]
+--------
+#define MSG_SETCFG 0x11
+#define MSG_GETCFG 0x12
+--------
+
+Sending a +MSG_GETCFG+ request message will typically trigger a reply
+with the message type +MSG_SETCFG+ containing the current configuration.
+In object oriented terms one would describe this as "the kernel sets
+the local copy of the configuration in userspace".
+
+["mscgen"]
+--------
+msc {
+ A,B;
+ A=>B [label="MSG_GETCFG (seq=1, NLM_F_REQUEST)"];
+ A<=B [label="MSG_SETCFG (seq=1)"];
+}
+--------
+
+The configuration may be changed by sending a +MSG_SETCFG+ which will
+be responded to with either an ACK (see <>)
+or an error message (see <>).
+
+["mscgen"]
+--------
+msc {
+ A,B;
+ A=>B [label="MSG_SETCFG (seq=1, NLM_F_REQUEST, NLM_F_ACK)"];
+ A<=B [label="ACK (seq=1)"];
+}
+--------
+
+Optionally, the kernel may send out notifications for configuration
+changes allowing userspace to listen for changes instead of polling
+frequently. Notifications typically reuse an existing message type
+and rely on the application using a separate socket to differ between
+requests and notifications but you may also specify a separate message
+type.
+
+["mscgen"]
+--------
+msc {
+ A,B;
+ A<=B [label="MSG_SETCFG (seq=0)"];
+}
+--------
+
+[[core_multipart]]
+==== Multipart Messages
+
+Although in theory a netlink message can be up to 4GiB in size. The socket
+buffers are very likely not large enough to hold message of such sizes.
+Therefore it is common to limit messages to one page size (PAGE_SIZE) and
+use the multipart mechanism to split large pieces of data into several
+messages. A multipart message has the flag +NLM_F_MULTI+ set and the
+receiver is expected to continue receiving and parsing until the special
+message type +NLMSG_DONE+ is received.
+
+Multipart messages unlike fragmented ip packets must not be reassembled
+even though it is perfectly legal to do so if the protocols wishes to
+work this way. Often multipart message are used to send lists or trees
+of objects were each multipart message simply carries multiple objects
+allow for each message to be parsed independently.
+
+["mscgen"]
+--------
+msc {
+ A,B;
+ A=>B [label="GET (seq=1, NLM_F_REQUEST)"];
+ A<=B [label="PUT (seq=1, NLM_F_MULTI)"];
+ ...;
+ A<=B [label="PUT (seq=1, NLM_F_MULTI)"];
+ A<=B [label="NLMSG_DONE (seq=1)"];
+}
+--------
+
+[[core_errmsg]]
+==== Error Message
+
+Error messages can be sent in response to a request. Error messages must
+use the standard message type +NLMSG_ERROR+. The payload consists of a
+error code and the original netlink mesage header of the request.
+
+image:nlmsgerr.png["Netlink Errror Message header"]
+
+Error messages should set the sequence number to the sequence number
+of the request which caused the error.
+
+["mscgen"]
+--------
+msc {
+ A,B;
+ A=>B [label="GET (seq=1, NLM_F_REQUEST)"];
+ A<=B [label="NLMSG_ERROR code=EINVAL (seq=1)"];
+}
+--------
+
+[[core_msg_ack]]
+==== ACKs
+
+A sender can request an ACK message to be sent back for each request
+processed by setting the +NLM_F_ACK+ flag in the request. This is typically
+used to allow the sender to synchronize further processing until the
+request has been processed by the receiver.
+
+["mscgen"]
+--------
+msc {
+ A,B;
+ A=>B [label="GET (seq=1, NLM_F_REQUEST | NLM_F_ACK)"];
+ A<=B [label="ACK (seq=1)"];
+}
+--------
+
+ACK messages also use the message type +NLMSG_ERROR+ and payload
+format but the error code is set to 0.
+
+[[core_msg_flags]]
+==== Message Flags
+
+The following standard flags are defined
+
+[source,c]
+--------
+#define NLM_F_REQUEST 1
+#define NLM_F_MULTI 2
+#define NLM_F_ACK 4
+#define NLM_F_ECHO 8
+--------
+
+- `NLM_F_REQUEST` - Message is a request, see <>.
+- `NLM_F_MULTI` - Multipart message, see <>
+- `NLM_F_ACK` - ACK message requested, see <>.
+- `NLM_F_ECHO` - Request to echo the request.
+
+The flag +NLM_F_ECHO+ is similar to the `NLM_F_ACK` flag. It can be
+used in combination with `NLM_F_REQUEST` and causes a notification
+which is sent as a result of a request to also be sent to the sender
+regardless of whether the sender has subscribed to the corresponding
+multicast group or not. See <>
+
+Additional universal message flags are defined which only apply for
++GET+ requests:
+
+[source,c]
+--------
+#define NLM_F_ROOT 0x100
+#define NLM_F_MATCH 0x200
+#define NLM_F_ATOMIC 0x400
+#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
+--------
+
+- `NLM_F_ROOT` - Return based on root of tree.
+- `NLM_F_MATCH` - Return all matching entries.
+- `NLM_F_ATOMIC` - Obsoleted, once used to request an atomic operation.
+- `NLM_F_DUMP` - Return a list of all objects
+ (`NLM_F_ROOT`|`NLM_F_MATCH`).
+
+Use of these flags is completely optional and many netlink protocols only
+make use of the `NLM_F_DUMP` flag which typically requests the receiver
+to send a list of all objects in the context of the message type as a
+sequence of multipart messages (see <>).
+
+Another set of flags exist related to `NEW` or `SET` requests. These
+flags are mutually exclusive to the `GET` flags:
+
+[source,c]
+--------
+#define NLM_F_REPLACE 0x100
+#define NLM_F_EXCL 0x200
+#define NLM_F_CREATE 0x400
+#define NLM_F_APPEND 0x800
+--------
+
+- `NLM_F_REPLACE` - Replace an existing object if it exists.
+- `NLM_F_EXCL` - Do not update object if it exists already.
+- `NLM_F_CREATE` - Create object if it does not exist yet.
+- `NLM_F_APPEND` - Add object at end of list.
+
+Behaviour of these flags may differ slightly between different netlink
+protocols.
+
+[[core_seq_num]]
+=== Sequence Numbers
+
+Netlink allows the use of sequence numbers to help relate replies to
+requests. It should be noted that unlike in protocols such as TCP
+there is no strict enforcement of the sequence number. The sole purpose
+of sequence numbers is to assist a sender in relating replies to the
+corresponding requests. See <> for more information.
+
+Sequence numbers are managed on a per socket basis, see
+<> for more information on how to use sequence numbers.
+
+[[core_multicast]]
+=== Multicast Groups
+
+TODO
+
+See <>
+
+[[core_sockets]]
+== Netlink Sockets
+
+In order to use the netlink protocol, a netlink socket is required.
+Each socket defines an independent context for sending and receiving of
+messages. An application may make use multiple sockets, e.g. a socket to
+send requests and receive the replies and another socket subscribed to a
+multicast group to receive notifications.
+
+=== Socket structure (struct nl_sock)
+
+The netlink socket and all related attributes including the actual file
+descriptor are represented by +struct nl_sock+.
+
+[source,c]
+--------
+#include
+
+struct nl_sock *nl_socket_alloc(void)
+void nl_socket_free(struct nl_sock *sk)
+--------
+
+The application must allocate an instance of +struct nl_sock+ for each
+netlink socket it wishes to use.
+
+[[core_sk_seq_num]]
+=== Sequence Numbers
+
+The library will automatically take care of sequence number handling
+for the application. A sequence number counter is stored in the
+socket structure which is used and incremented automatically when a
+message needs to be sent which is expected to generate a reply such as
+an error or any other message type that needs to be related to the
+original message.
+
+Alternatively, the counter can be used directly via the function
+nl_socket_use_seq(). It will return the current value of the counter
+and increment it by one afterwards.
+
+[source,c]
+--------
+#include
+
+unsigned int nl_socket_use_seq(struct nl_sock *sk);
+--------
+
+Most applications will not want to deal with sequence number handling
+themselves though. When using nl_send_auto() the sequence number is
+filled in automatically and matched again when a reply is received. See
+section <> for more information.
+
+This behaviour can and must be disabled if the netlink protocol
+implemented does not use a request/reply model, e.g. when a socket is
+used to receive notification messages.
+
+[source,c]
+--------
+#include
+
+void nl_socket_disable_seq_check(struct nl_sock *sk);
+--------
+
+For more information on the theory behind netlink sequence numbers,
+see section <>.
+
+[[core_sk_multicast]]
+=== Multicast Group Subscriptions
+
+Each socket can subscribe to any number of multicast groups of the
+netlink protocol it is connected to. The socket will then receive a
+copy of each message sent to any of the groups. Multicast groups are
+commonly used to implement event notifications.
+
+Prior to kernel 2.6.14 the group subscription was performed using a
+bitmask which limited the number of groups per protocol family to 32.
+This outdated interface can still be accessed via the function
+nl_join_groups() even though it is not recommended for new code.
+
+[source,c]
+--------
+#include
+
+void nl_join_groups(struct nl_sock *sk, int bitmask);
+--------
+
+Starting with 2.6.14 a new method was introduced which supports subscribing
+to an almost infinite number of multicast groups.
+
+[source,c]
+--------
+#include
+
+int nl_socket_add_memberships(struct nl_sock *sk, int group, ...);
+int nl_socket_drop_memberships(struct nl_sock *sk, int group, ...);
+--------
+
+==== Multicast Example
+
+[source,c]
+--------
+#include
+#include
+#include
+
+/*
+ * This function will be called for each valid netlink message received
+ * in nl_recvmsgs_default()
+ */
+static int my_func(struct nl_msg *msg, void *arg)
+{
+ return 0;
+}
+
+struct nl_sock *sk;
+
+/* Allocate a new socket */
+sk = nl_socket_alloc();
+
+/*
+ * Notifications do not use sequence numbers, disable sequence number
+ * checking.
+ */
+nl_socket_disable_seq_check(sk);
+
+/*
+ * Define a callback function, which will be called for each notification
+ * received
+ */
+nl_socket_modify_cb(sk, NL_CB_VALID, NL_CB_CUSTOM, my_func, NULL);
+
+/* Connect to routing netlink protocol */
+nl_connect(sk, NETLINK_ROUTE);
+
+/* Subscribe to link notifications group */
+nl_socket_add_memberships(sk, RTNLGRP_LINK, 0);
+
+/*
+ * Start receiving messages. The function nl_recvmsgs_default() will block
+ * until one or more netlink messages (notification) are received which
+ * will be passed on to my_func().
+ */
+while (1)
+ nl_recvmsgs_default(sock);
+--------
+
+[[core_sk_cb]]
+=== Modifiying Socket Callback Configuration
+
+See <> for more information on
+callback hooks and overwriting capabilities.
+
+Each socket is assigned a callback configuration which controls the
+behaviour of the socket. This is f.e. required to have a separate
+message receive function per socket. It is perfectly legal to share
+callback configurations between sockets though.
+
+The following functions can be used to access and set the callback
+configuration of a socket:
+
+[source,c]
+--------
+#include
+
+struct nl_cb *nl_socket_get_cb(const struct nl_sock *sk);
+void nl_socket_set_cb(struct nl_sock *sk, struct nl_cb *cb);
+--------
+
+Additionally a shortcut exists to modify the callback configuration
+assigned to a socket directly:
+
+[source,c]
+--------
+#include
+
+int nl_socket_modify_cb(struct nl_sock *sk, enum nl_cb_type type, enum nl_cb_kind kind,
+ nl_recvmsg_msg_cb_t func, void *arg);
+--------
+
+.Example:
+[source,c]
+--------
+#include
+
+// Call my_input() for all valid messages received in socket sk
+nl_socket_modify_cb(sk, NL_CB_VALID, NL_CB_CUSTOM, my_input, NULL);
+--------
+
+=== Socket Attributes
+
+.Local Port
+
+The local port number uniquely identifies the socket and is used to
+address it. A unique local port is generated automatically when the
+socket is allocated. It will consist of the Process ID (22 bits) and a
+random number (10 bits) thus allowing up to 1024 sockets per process.
+
+[source,c]
+--------
+#include
+
+uint32_t nl_socket_get_local_port(const struct nl_sock *sk);
+void nl_socket_set_local_port(struct nl_sock *sk, uint32_t port);
+--------
+
+See section <> for more information on port numbers.
+
+CAUTION: Overwriting the local port is possible but you have to ensure
+that the provided value is unique and no other socket in any other
+application is using the same value.
+
+.Peer Port
+
+A peer port can be assigned to the socket which will result in all
+unicast messages sent over the socket to be addresses to the peer. If
+no peer is specified, the message is sent to the kernel which will try
+to automatically bind the socket to a kernel side socket of the same
+netlink protocol family. It is common practice not to bind the socket
+to a peer port as typically only one kernel side socket exists per
+netlink protocol family.
+
+[source,c]
+--------
+#include
+
+uint32_t nl_socket_get_peer_port(const struct nl_sock *sk);
+void nl_socket_set_peer_port(struct nl_sock *sk, uint32_t port);
+--------
+
+See section <> for more information on port numbers.
+
+.File Descriptor
+
+Netlink uses the BSD socket interface, therefore a file descriptor is
+behind each socket and you may use it directly.
+
+[source,c]
+--------
+#include
+
+int nl_socket_get_fd(const struct nl_sock *sk);
+--------
+
+If a socket is used to only receive notifications it usually is best
+to put the socket in non-blocking mode and periodically poll for new
+notifications.
+
+[source,c]
+--------
+#include
+
+int nl_socket_set_nonblocking(const struct nl_sock *sk);
+--------
+
+.Send/Receive Buffer Size
+
+The socket buffer is used to queue netlink messages between sender and
+receiver. The size of these buffers specifies the maximum size you
+will be able to write() to a netlink socket, i.e. it will indirectly
+define the maximum message size. The default is 32KiB.
+
+[source,c]
+--------
+#include
+
+int nl_socket_set_buffer_size(struct nl_sock *sk, int rx, int tx);
+--------
+
+[[core_sk_cred]]
+.Enable/Disable Credentials
+
+TODO
+
+[source,c]
+--------
+#include
+
+int nl_socket_set_passcred(struct nl_sock *sk, int state);
+--------
+
+.Enable/Disable Auto-ACK Mode
+
+The following functions allow to enable/disable Auto-ACK mode on a socket.
+See <> for more information on what implications that has.
+Auto-ACK mode is enabled by default.
+
+[source,c]
+--------
+#include
+
+void nl_socket_enable_auto_ack(struct nl_sock *sk);
+void nl_socket_disable_auto_ack(struct nl_sock *sk);
+--------
+
+.Enable/Disable Message Peeking
+
+If enabled, message peeking causes nl_recv() to try and use MSG_PEEK
+to retrieve the size of the next message received and allocate a
+buffer of that size. Message peeking is enabled by default but can be
+disabled using the following function:
+
+[source,c]
+--------
+#include
+
+void nl_socket_enable_msg_peek(struct nl_sock *sk);
+void nl_socket_disable_msg_peek(struct nl_sock *sk);
+--------
+
+.Enable/Disable Receival of Packet Information
+
+If enabled, each received netlink message from the kernel will include
+an additional struct nl_pktinfo in the control message. The following
+function can be used to enable/disable receival of packet information.
+
+[source,c]
+--------
+#include
+
+int nl_socket_recv_pktinfo(struct nl_sock *sk, int state);
+--------
+
+CAUTION: Processing of NETLINK_PKTINFO has not been implemented yet.
+
+[[core_send_recv]]
+== Sending and Receiving of Messages / Data
+
+[[core_send]]
+=== Sending Messages
+
+The standard method of sending a netlink message over a netlink socket
+is to use the function nl_send_auto(). It will automatically complete
+the netlink message by filling the missing bits and pieces in the
+netlink message header and will deal with addressing based on the
+options and address set in the netlink socket. The message is then
+passed on to nl_send().
+
+If the default sending semantics implemented by nl_send() do not suit
+the application, it may overwrite the sending function nl_send() by
+specifying an own implementation using the function
+nl_cb_overwrite_send().
+
+[source,c]
+--------
+ nl_send_auto(sk, msg)
+ |
+ |-----> nl_complete_msg(sk, msg)
+ |
+ |
+ | Own send function specified via nl_cb_overwrite_send()
+ |- - - - - - - - - - - - - - - - - - - -
+ v v
+ nl_send(sk, msg) send_func()
+--------
+
+.Using nl_send()
+
+If you do not require any of the automatic message completion
+functionality you may use nl_send() directly but beware that any
+internal calls to nl_send_auto() by the library to send netlink
+messages will still use nl_send(). Therefore if you wish to use any
+higher level interfaces and the behaviour of nl_send() is to your
+dislike then you must overwrite the nl_send() function via
+nl_cb_overwrite_send()
+
+The purpose of nl_send() is to embed the netlink message into an iovec
+structure and pass it on to nl_send_iovec().
+
+[source,c]
+--------
+ nl_send(sk, msg)
+ |
+ v
+ nl_send_iovec(sk, msg, iov, iovlen)
+--------
+
+.Using nl_send_iovec()
+
+nl_send_iovec() expects a finalized netlink message and fills out the
+struct msghdr used for addressing. It will first check if the struct
+nl_msg is addressed to a specific peer (see nlmsg_set_dst()). If not,
+it will try to fall back to the peer address specified in the socket
+(see nl_socket_set_peer_port(). Otherwise the message will be sent
+unaddressed and it is left to the kernel to find the correct peer.
+
+nl_send_iovec() also adds credentials if present and enabled
+(see <>).
+
+The message is then passed on to nl_sendmsg().
+
+[source,c]
+--------
+ nl_send_iovec(sk, msg, iov, iovlen)
+ |
+ v
+ nl_sendmsg(sk, msg, msghdr)
+--------
+
+.Using nl_sendmsg()
+
+nl_sendmsg() expects a finalized netlink message and an optional
+struct msghdr containing the peer address. It will copy the local
+address as defined in the socket (see nl_socket_set_local_port()) into
+the netlink message header.
+
+At this point, construction of the message finished and it is ready to
+be sent.
+
+[source,c]
+--------
+ nl_sendmsg(sk, msg, msghdr)
+ |- - - - - - - - - - - - - - - - - - - - v
+ | NL_CB_MSG_OUT()
+ |<- - - - - - - - - - - - - - - - - - - -+
+ v
+ sendmsg()
+--------
+
+Before sending the application has one last chance to modify the
+message. It is passed to the NL_CB_MSG_OUT callback function which
+may inspect or modify the message and return an error code. If this
+error code is NL_OK the message is sent using sendmsg() resulting in
+the number of bytes written being returned. Otherwise the message
+sending process is aborted and the error code specified by the
+callback function is returned. See <> for more information
+on how to set callbacks.
+
+.Sending Raw Data with nl_sendto()
+
+If you wish to send raw data over a netlink socket, the following
+function will pass on any buffer provided to it directly to sendto():
+
+[source,c]
+--------
+#include
+
+int nl_sendto(struct nl_sock *sk, void *buf, size_t size);
+--------
+
+.Sending of Simple Messages
+
+A special interface exists for sending of trivial messages. The function
+expects the netlink message type, optional netlink message flags, and an
+optional data buffer and data length.
+[source,c]
+--------
+#include
+
+int nl_send_simple(struct nl_sock *sk, int type, int flags,
+ void *buf, size_t size);
+--------
+
+The function will construct a netlink message header based on the message
+type and flags provided and append the data buffer as message payload. The
+newly constructed message is sent with nl_send_auto().
+
+The following example will send a netlink request message causing the
+kernel to dump a list of all network links to userspace:
+
+[source,c]
+--------
+#include
+
+struct nl_sock *sk;
+struct rtgenmsg rt_hdr = {
+ .rtgen_family = AF_UNSPEC,
+};
+
+sk = nl_socket_alloc();
+nl_connect(sk, NETLINK_ROUTE);
+
+nl_send_simple(sock, RTM_GETLINK, NLM_F_DUMP, &rt_hdr, sizeof(rt_hdr));
+--------
+
+[[core_recv]]
+=== Receiving Messages
+
+The easiest method to receive netlink messages is to call nl_recvmsgs_default().
+It will receive messages based on the semantics defined in the socket. The
+application may customize these in detail although the default behaviour will
+probably suit most applications.
+
+nl_recvmsgs_default() will also be called internally by the library whenever
+it needs to receive and parse a netlink message.
+
+The function will fetch the callback configuration stored in the socket and
+call nl_recvmsgs():
+
+[source,c]
+--------
+ nl_recvmsgs_default(sk)
+ |
+ | cb = nl_socket_get_cb(sk)
+ v
+ nl_recvmsgs(sk, cb)
+--------
+
+.Using nl_recvmsgs()
+
+nl_recvmsgs() implements the actual receiving loop, it blocks until a
+netlink message has been received unless the socket has been put into
+non-blocking mode.
+
+For the unlikely scenario that certain required receive characteristics
+can not be achieved by fine tuning the internal recvmsgs function using
+the callback configuration (see <>) the application may provide
+a complete own implementation of it and overwrite all calls to nl_recvmsgs()
+with the function nl_cb_overwrite_recvmsgs().
+
+[source,c]
+--------
+ nl_recvmsgs(sk, cb)
+ |
+ | Own recvmsgs function specified via nl_cb_overwrite_recvmsgs()
+ |- - - - - - - - - - - - - - - - - - - -
+ v v
+ internal_recvmsgs() my_recvmsgs()
+--------
+
+[[core_recv_character]]
+.Receive Characteristics
+
+If the application does not provide its own recvmsgs() implementation
+with the function nl_cb_overwrite_recvmsgs() the following characteristics
+apply while receiving data from a netlink socket:
+
+[source,c]
+--------
+ internal_recvmsgs()
+ |
++-------------->| Own recv function specified with nl_cb_overwrite_recv()
+| |- - - - - - - - - - - - - - - -
+| v v
+| nl_recv() my_recv()
+| |<- - - - - - - - - - - - - - -+
+| |<-------------+
+| v | More data to parse? (nlmsg_next())
+| Parse Message |
+| |--------------+
+| v
++------- NLM_F_MULTI set?
+ |
+ v
+ (SUCCESS)
+--------
+
+The function nl_recv() is invoked first to receive data from the
+netlink socket. This function may be overwritten by the application
+by an own implementation using the function nl_cb_overwrite_recv().
+This may be useful if the netlink byte stream is in fact not received
+from a socket directly but is read from a file or another source.
+
+If data has been read, it will be attempted to parse the data. This
+will be done repeatedly until the parser returns NL_STOP, an error was
+returned or all data has been parsed.
+
+In case the last message parsed successfully was a multipart message
+(see <>) and the parser did not
+quit due to either an error or NL_STOP nl_recv() respectively the
+applications own implementation will be called again and the parser
+starts all over.
+
+See <> for information on how to extract valid
+netlink messages from the parser and on how to control the behaviour
+of it.
+
+[[core_parse_character]]
+.Parsing Characteristics
+
+The internal parser is invoked for each netlink message received from
+a netlink socket. It is typically fed by nl_recv() (see
+<>).
+
+The parser will first ensure that the length of the data stream
+provided is sufficient to contain a netlink message header and that
+the message length as specified in the message header does not exceed
+it.
+
+If this criteria is met, a new struct nl_msg is allocated and the
+message is passed on to the the callback function NL_CB_MSG_IN if one
+is set. Like any other callback function, it may return NL_SKIP to
+skip the current message but continue parsing the next message or
+NL_STOP to stop parsing completely.
+
+The next step is to check the sequence number of the message against
+the currently expected sequence number. The application may provide
+its own sequence number checking algorithm by setting the callback
+function NL_CB_SEQ_CHECK to its own implementation. In fact, calling
+nl_socket_disable_seq_check() to disable sequence number checking will
+do nothing more than set the NL_CB_SEQ_CHECK hook to a function which
+always returns NL_OK.
+
+Another callback hook NL_CB_SEND_ACK exists which is called if the
+message has the NLM_F_ACK flag set. Although I am not aware of any
+userspace netlink socket doing this, the application may want to send
+an ACK message back to the sender (see <>).
+
+[source,c]
+--------
+ parse()
+ |
+ v
+ nlmsg_ok() --> Ignore
+ |
+ |- - - - - - - - - - - - - - - v
+ | NL_CB_MSG_IN()
+ |<- - - - - - - - - - - - - - -+
+ |
+ |- - - - - - - - - - - - - - - v
+ Sequence Check NL_CB_SEQ_CHECK()
+ |<- - - - - - - - - - - - - - -+
+ |
+ | Message has NLM_F_ACK set
+ |- - - - - - - - - - - - - - - v
+ | NL_CB_SEND_ACK()
+ |<- - - - - - - - - - - - - - -+
+ |
+ Handle Message Type
+--------
+
+[[core_auto_ack]]
+=== Auto-ACK Mode
+
+TODO
+
+== Message Parsing & Construction
+
+=== Message Format
+
+See <> for an introduction to the netlink
+protocol and its message format.
+
+.Alignment
+
+Most netlink protocols enforce a strict alignment policy for all
+boundaries. The alignment value is defined by NLMSG_ALIGNTO and is
+fixed to 4 bytes. Therefore all netlink message headers, begin of
+payload sections, protocol specific headers, and attribute sections
+must start at an offset which is a multiple of NLMSG_ALIGNTO.
+
+[source,c]
+--------
+#include
+
+int nlmsg_size(int payloadlen);
+int nlmsg_total_size(int payloadlen);
+--------
+
+The library provides a set of function to handle alignment
+requirements automatically. The function nlmsg_total_size() returns
+the total size of a netlink message including the padding to ensure
+the next message header is aligned correctly.
+
+[source,c]
+--------
+ <----------- nlmsg_total_size(len) ------------>
+ <----------- nlmsg_size(len) ------------>
+ +-------------------+- - -+- - - - - - - - +- - -+-------------------+- - -
+ | struct nlmsghdr | Pad | Payload | Pad | struct nlsmghdr |
+ +-------------------+- - -+- - - - - - - - +- - -+-------------------+- - -
+ <---- NLMSG_HDRLEN -----> <- NLMSG_ALIGN(len) -> <---- NLMSG_HDRLEN ---
+--------
+
+If you need to know if padding needs to be added at the end of a
+message, nlmsg_padlen() returns the number of padding bytes that need
+to be added for a specific payload length.
+
+[source,c]
+--------
+#include
+int nlmsg_padlen(int payloadlen);
+--------
+
+=== Parsing a Message
+
+The library offers two different methods of parsing netlink messages.
+It offers a low level interface for applications which want to do all
+the parsing manually. This method is described below. Alternatively
+the library also offers an interface to implement a parser as part of
+a cache operations set which is especially useful when your protocol
+deals with objects of any sort such as network links, routes, etc.
+This high level interface is described in <>.
+
+.Splitting a byte stream into separate messages
+
+What you receive from a netlink socket is typically a stream of
+messages. You will be given a buffer and its length, the buffer may
+contain any number of netlink messages.
+
+The first message header starts at the beginning of message stream.
+Any subsequent message headers are access by calling nlmsg_next() on
+the previous header.
+
+[source,c]
+--------
+#include
+
+struct nlmsghdr *nlmsg_next(struct nlmsghdr *hdr, int *remaining);
+--------
+
+The function nlmsg_next() will automatically substract the size of the
+previous message from the remaining number of bytes.
+
+Please note, there is no indication in the previous message whether
+another message follows or not. You must assume that more messages
+follow until all bytes of the message stream have been processed.
+
+To simplify this, the function nlmsg_ok() exists which returns true if
+another message fits into the remaining number of bytes in the message
+stream. nlmsg_valid_hdr() is similar, it checks whether a specific
+netlink message contains at least a minimum of payload.
+
+[source,c]
+--------
+#include
+
+int nlmsg_valid_hdr(const struct nlmsghdr *hdr, int payloadlen);
+int nlmsg_ok(const struct nlmsghdr *hdr, int remaining);
+--------
+
+A typical use of these functions looks like this:
+
+[source,c]
+--------
+#include
+
+void my_parse(void *stream, int length)
+{
+ struct nlmsghdr *hdr = stream;
+
+ while (nlmsg_ok(hdr, length)) {
+ // Parse message here
+ hdr = nlmsg_next(hdr, &length);
+ }
+}
+--------
+
+CAUTION: nlmsg_ok() only returns true if the *complete* message including
+ the message payload fits into the remaining buffer length. It will
+ return false if only a part of it fits.
+
+The above can also be written using the iterator nlmsg_for_each():
+
+[source,c]
+--------
+#include
+
+struct nlmsghdr *hdr;
+
+nlmsg_for_each(hdr, stream, length) {
+ /* do something with message */
+}
+--------
+
+.Message Payload
+
+The message payload is appended to the message header and is guaranteed
+to start at a multiple of +NLMSG_ALIGNTO+. Padding at the end of the
+message header is added if necessary to ensure this. The function
+nlmsg_data() will calculate the necessary offset based on the message
+and returns a pointer to the start of the message payload.
+
+[source,c]
+--------
+#include
+
+void *nlmsg_data(const struct nlmsghdr *nlh);
+void *nlmsg_tail(const struct nlmsghdr *nlh);
+int nlmsg_datalen(const struct nlmsghdr *nlh);
+--------
+
+The length of the message payload is returned by nlmsg_datalen().
+
+[source,c]
+--------
+ <--- nlmsg_datalen(nlh) --->
+ +-------------------+- - -+----------------------------+- - -+
+ | struct nlmsghdr | Pad | Payload | Pad |
+ +-------------------+- - -+----------------------------+- - -+
+nlmsg_data(nlh) ---------------^ ^
+nlmsg_tail(nlh) --------------------------------------------------^
+--------
+
+The payload may consist of arbitrary data but may have strict alignment
+and formatting rules depending on the actual netlink protocol.
+
+[[core_msg_attr]]
+.Message Attributes
+
+Most netlink protocols use netlink attributes. It not only makes the
+protocol self documenting but also gives flexibility in expanding the
+protocol at a later point. New attributes can be added at any time and
+older attributes can be obsoleted by newer ones without breaking
+binary compatibility of the protocol.
+
+[source,c]
+--------
+ <---------------------- payload ------------------------->
+ <----- hdrlen ----> <- nlmsg_attrlen(nlh, hdrlen) ->
+ +-------------------+- - -+----- ------------+- - -+--------------------------------+- - -+
+ | struct nlmsghdr | Pad | Protocol Header | Pad | Attributes | Pad |
+ +-------------------+- - -+-------------------+- - -+--------------------------------+- - -+
+nlmsg_attrdata(nlh, hdrlen) -----------------------------^
+--------
+
+The function nlmsg_attrdata() returns a pointer to the begin of the
+attributes section. The length of the attributes section is returned
+by the function nlmsg_attrlen().
+
+[source,c]
+--------
+#include
+
+struct nlattr *nlmsg_attrdata(const struct nlmsghdr *hdr, int hdrlen);
+int nlmsg_attrlen(const struct nlmsghdr *hdr, int hdrlen);
+--------
+
+See <> for more information on how to use netlink attributes.
+
+.Parsing a Message the Easy Way
+
+The function nlmsg_parse() validate a complete netlink message in one
+step. If +hdrlen > 0+ it will first call nlmsg_valid_hdr() to check
+if the protocol header fits into the message. If there is more payload
+to parse, it will assume it to be attributes and parse the payload
+accordingly. The function behaves exactly like nla_parse() when
+parsing attributes, see <>.
+
+[source,c]
+--------
+int nlmsg_parse(struct nlmsghdr *hdr, int hdrlen, struct nlattr **attrs,
+ int maxtype, struct nla_policy *policy);
+--------
+
+The function nlmsg_validate() is based on nla_validate() and behaves
+exactly the same as nlmsg_parse() except that it only validates and
+will not fill anarray with pointers to each attribute.
+
+[source,c]
+--------
+int nlmsg_validate(struct nlmsghdr *hdr, int hdrlen, intmaxtype,
+ struct nla_policy *policy);
+--------
+
+See <> for an example and more information on
+attribute parsing.
+
+=== Construction of a Message
+
+See <> for information on the netlink message format
+and alignment requirements.
+
+Message construction is based on struct nl_msg which uses an internal
+buffer to store the actual netlink message. struct nl_msg +does not+
+point to the netlink message header. Use nlmsg_hdr() to retrieve a
+pointer to the netlink message header.
+
+At allocation time, a maximum message size is specified. It defaults
+to a page (PAGE_SIZE). The application constructing the message will
+reserve space out of this maximum message size repeatedly for each
+header or attribute added. This allows construction of messages across
+various layers of code where lower layers do not need to know about
+the space requirements of upper layers.
+
++Why is setting the maximum message size necessary?+ This
+question is often raised in combination with the proposed solution of
+reallocating the message payload buffer on the fly using realloc().
+While it is possible to reallocate the buffer during construction
+using nlmsg_expand() it will make all pointers into the message buffer
+become stale. This breaks usage of nlmsg_hdr(), nla_nest_start(), and
+nla_nest_end() and is therefore not acceptable as default behaviour.
+
+.Allocating struct nl_msg
+
+The first step in constructing a new netlink message it to allocate a
+`struct nl_msg` to hold the message header and payload. Several
+functions exist to simplify various tasks.
+
+[source,c]
+--------
+#include
+
+struct nl_msg *nlmsg_alloc(void);
+void nlmsg_free(struct nl_msg *msg);
+--------
+
+The function nlmsg_alloc() is the default message allocation function.
+It allocates a new message using the default maximum message size which
+equals to one page (PAGE_SIZE). The application can change the default
+size for messages by calling nlmsg_set_default_size():
+
+[source,c]
+--------
+void nlmsg_set_default_size(size_t);
+--------
+
+CAUTION: Calling nlmsg_set_default_size() does not change the maximum
+ message size of already allocated messages.
+
+[source,c]
+--------
+struct nl_msg *nlmsg_alloc_size(size_t max);
+--------
+
+Instead of changing the default message size, the function
+nlmsg_alloc_size() can be used to allocate a message with an individual
+maximum message size.
+
+
+If the netlink message header is already known at allocation time, the
+application may sue nlmsg_inherit(). It will allocate a message using
+the default maximum message size and copy the header into the message.
+Calling nlmsg_inherit with +set+ to NULL is equivalent to calling
+nlmsg_alloc().
+
+[source,c]
+--------
+struct nl_msg *nlmsg_inherit(struct nlmsghdr *hdr);
+--------
+
+Alternatively nlmsg_alloc_simple() takes a netlink message type and
+netlink message flags. It is equivalent to nlmsg_inherit() except that it
+takes the two common header fields as arguments instead of a complete
+header.
+
+[source,c]
+--------
+#include
+
+struct nl_msg *nlmsg_alloc_simple(int nlmsg_type, int flags);
+--------
+
+.Appending the netlink message header
+
+After allocating struct nl_msg, the netlink message header needs to be
+added unless one of the function nlmsg_alloc_simple() or nlmsg_inherit()
+have been used for allocation in which case this step will replace the
+netlink message header already in place.
+
+[source,c]
+--------
+#include
+
+struct nlmsghdr *nlmsg_put(struct nl_msg *msg, uint32_t port, uint32_t seqnr,
+ int nlmsg_type, int payload, int nlmsg_flags);
+--------
+
+The function nlmsg_put() will build a netlink message header out of
++nlmsg_type+, +nlmsg_flags+, +seqnr+, and +port+ and copy it into the
+netlink message. +seqnr+ can be set to +NL_AUTO_SEQ+ to indicate
+that the next possible sequence number should be used automatically.
+To use this feature, the message must be sent using the function
+nl_send_auto(). Like +port+, the argument +seqnr+ can be set to
++NL_AUTO_PORT+ indicating that the local port assigned to the socket
+should be used as source port. This is generally a good idea unless
+you are replying to a request. See <>
+for more information on how to fill the header.
+
+NOTE: The argument +payload+ can be used by the application to reserve
+ room for additional data after the header. A value of > 0 is
+ equivalent to calling +nlmsg_reserve(msg, payload, NLMSG_ALIGNTO)+.
+ See <> for more information on reserving room for
+ data.
+
+.Example
+[source,c]
+--------
+#include
+
+struct nlmsghdr *hdr;
+struct nl_msg *msg;
+struct myhdr {
+ uint32_t foo1, foo2;
+} shdr = { 10, 20 };
+
+/* Allocate a message with the default maximum message size */
+msg = nlmsg_alloc();
+
+/*
+ * Add header with message type MY_MSGTYPE, the flag NLM_F_CREATE,
+ * let library fill port and sequence number, and reserve room for
+ * struct myhdr
+ */
+hdr = nlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, MY_MSGTYPE, sizeof(shdr), NLM_F_CREATE);
+
+/* Copy own header into newly reserved payload section */
+memcpy(nlmsg_data(hdr), &shdr, sizeof(shdr));
+
+/*
+ * The message will now look like this:
+ * +-------------------+- - -+----------------+- - -+
+ * | struct nlmsghdr | Pad | struct myhdr | Pad |
+ * +-------------------+-----+----------------+- - -+
+ * nlh -^ / \
+ * +--------+---------+
+ * | foo1 | foo2 |
+ * +--------+---------+
+ */
+--------
+
+[[core_msg_reserve]]
+.Reserving room at the end of the message
+
+Most functions described later on will automatically take care of
+reserving room for the data that is added to the end of the netlink
+message. In some situations it may be required for the application
+to reserve room directly though.
+
+[source,c]
+--------
+#include
+
+void *nlmsg_reserve(struct nl_msg *msg, size_t len, int pad);
+--------
+
+The function nlmsg_reserve() reserves +len+ bytes at the end of the
+netlink message and returns a pointer to the start of the reserved area.
+The +pad+ argument can be used to request +len+ to be aligned to any
+number of bytes prior to reservation.
+
+The following example requests to reserve a 17 bytes area at the end of
+message aligned to 4 bytes. Therefore a total of 20 bytes will be
+reserved.
+
+[source,c]
+--------
+#include
+
+void *buf = nlmsg_reserve(msg, 17, 4);
+--------
+
+NOTE: `nlmsg_reserve()` will *not* align the start of the buffer. Any
+ alignment requirements must be provided by the owner of the
+ previous message section.
+
+.Appending data at the end of the message
+
+The function `nlmsg_append()` appends `len` bytes at the end of the
+message, padding it if requested and necessary.
+
+[source,c]
+--------
+#include
+
+int nlmsg_append(struct nl_msg *msg, void *data, size_t len, int pad);
+--------
+
+It is equivalent to calling `nlmsg_reserve()` and `memcpy()`ing the
+data into the freshly reserved data section.
+
+NOTE: `nlmsg_append()` will *not* align the start of the data. Any
+ alignment requirements must be provided by the owner of the
+ previous message section.
+
+.Adding attributes to a message
+
+Construction of attributes and addition of attributes to the message is
+covered in section <>.
+
+[[core_attr]]
+== Attributes
+
+Any form of payload should be encoded as netlink attributes whenever
+possible. Use of attributes allows to extend any netlink protocol in
+the future without breaking binary compatibility. F.e. Suppose your
+device may currently be using 32 bit counters for statistics but years
+later the device switches to maintaining 64 bit counters to account
+for faster network hardware. If your protocol is using attributes the
+move to 64 bit counters is trivial and only involves in sending an
+additional attribute containing the 64 bit variants while still
+providing the old legacy 32 bit counters. If your protocol is not using
+attributes you will not be able to switch data types without breaking
+all existing users of the protocol.
+
+The concept of nested attributes also allows for subsystems of your
+protocol to implement and maintain their own attribute schemas. Suppose
+a new generation of network device is introduced which requires a
+completely new set of configuration settings which was unthinkable when
+the netlink protocol was initially designed. Using attributes the new
+generation of devices may define a new attribute and fill it with its
+own new structure of attributes which extend or even obsolete the old
+attributes.
+
+Therefore, _always_ use attributes even if you are almost certain that
+the message format will never ever change in the future.
+
+[[core_attr_format]]
+=== Attribute Format
+
+Netlink attributes allow for any number of data chunks of arbitrary
+length to be attached to a netlink message. See <>
+for more information on where attributes are stored in the message.
+
+The format of the attributes data returned by nlmsg_attrdata() is as
+follows:
+
+[source,c]
+--------
+ <----------- nla_total_size(payload) ----------->
+ <---------- nla_size(payload) ----------->
+ +-----------------+- - -+- - - - - - - - - +- - -+-----------------+- - -
+ | struct nlattr | Pad | Payload | Pad | struct nlattr |
+ +-----------------+- - -+- - - - - - - - - +- - -+-----------------+- - -
+ <---- NLA_HDRLEN -----> <--- NLA_ALIGN(len) ---> <---- NLA_HDRLEN ---
+--------
+
+Every attribute must start at an offset which is a multiple of
++NLA_ALIGNTO+ (4 bytes). If you need to know whether an attribute needs
+to be padded at the end, the function nla_padlen() returns the number
+of padding bytes that will or need to be added.
+
+image:attribute_hdr.png["Netlink Attribute Header"]
+
+Every attribute is encoded with a type and length field, both 16 bits,
+stored in the attribute header (struct nlattr) preceding the attribute
+payload. The length of an attribute is used to calculate the offset to
+the next attribute.
+
+[[core_attr_parse]]
+=== Parsing Attributes
+
+[[core_attr_parse_split]]
+.Splitting an Attributes Stream into Attributes
+
+Although most applications will use one of the functions from the
+nlmsg_parse() family (See <>) an interface exists
+to split the attributes stream manually.
+
+As described in <> the attributes section contains a
+infinite sequence or stream of attributes. The pointer returned by
+nlmsg_attrdata() (See <>) points to the first attribute
+header. Any subsequent attribute is accessed with the function nla_next()
+based on the previous header.
+
+[source,c]
+--------
+#include
+
+struct nlattr *nla_next(const struct nlattr *attr, int *remaining);
+--------
+
+The semantics are equivalent to nlmsg_next() and thus nla_next() will also
+subtract the size of the previous attribute from the remaining number of
+bytes in the attributes stream.
+
+Like messages, attributes do not contain an indicator whether another
+attribute follows or not. The only indication is the number of bytes left
+in the attribute stream. The function nla_ok() exists to determine whether
+another attribute fits into the remaining number of bytes or not.
+
+[source,c]
+--------
+#include
+
+int nla_ok(const struct nlattr *attr, int remaining);
+--------
+
+A typical use of nla_ok() and nla_next() looks like this:
+
+.nla_ok()/nla_next() usage
+[source,c]
+--------
+#include
+#include
+
+struct nlattr *hdr = nlmsg_attrdata(msg, 0);
+int remaining = nlmsg_attrlen(msg, 0);
+
+while (nla_ok(hdr, remaining)) {
+ /* parse attribute here */
+ hdr = nla_next(hdr, &remaining);
+};
+--------
+
+NOTE: `nla_ok()` only returns true if the *complete* attributes
+ including the attribute payload fits into the remaining number
+ of bytes.
+
+.Accessing Attribute Header and Payload
+
+Once the individual attributes have been sorted out by either splitting
+the attributes stream or using another interface the attribute header
+and payload can be accessed.
+
+[source,c]
+--------
+ <- nla_len(hdr) ->
+ +-----------------+- - -+- - - - - - - - - +- - -+
+ | struct nlattr | Pad | Payload | Pad |
+ +-----------------+- - -+- - - - - - - - - +- - -+
+nla_data(hdr) ---------------^
+--------
+
+The functions nla_len() and nla_type() can be used to access the attribute
+header. nla_len() will return the length of the payload not including
+eventual padding bytes. nla_type returns the attribute type.
+
+[source,c]
+--------
+#include
+
+int nla_len(const struct nlattr *hdr);
+int nla_type(const struct nlattr *hdr);
+--------
+
+The function nla_data() will return a pointer to the attribute
+payload. Please note that due to +NLA_ALIGNTO+ being 4 bytes it may
+not be safe to cast and dereference the pointer for any datatype
+larger than 32 bit depending on the architecture the application is
+run on.
+
+[source,c]
+--------
+#include
+
+void *nla_data(const struct nlattr *hdr);
+--------
+
+[NOTE]
+Never rely on the size of a payload being what you expect it to be.
+_Always_ verify the payload size and make sure that it matches your
+expectations. See <>
+
+[[core_attr_validation]]
+.Attribute Validation
+
+When receiving netlink attributes, the receiver has certain expectations
+on how the attributes should look like. These expectations must be
+defined to make sure the sending side meets our expectations. For this
+purpose, an attribute validation interface exists which must be used
+prior to accessing any payload.
+
+All functions providing attribute validation functionality are based
+on struct nla_policy:
+
+[source,c]
+--------
+struct nla_policy {
+ uint16_t type;
+ uint16_t minlen;
+ uint16_t maxlen;
+};
+--------
+
+The +type+ member specifies the datatype of the attribute, e.g.
++NLA_U32+, +NLA_STRING+, +NLA_FLAG+. The default is +NLA_UNSPEC+. The
++minlen+ member defines the minmum payload length of an attribute to
+be considered a valid attribute. The value for +minlen+ is implicit
+for most basic datatypes such as integers or flags. The +maxlen+
+member can be used to define a maximum payload length for an
+attribute to still be considered valid.
+
+NOTE: Specifying a maximum payload length is not recommended when
+ encoding structures in an attribute as it will prevent any
+ extension of the structure in the future. Something that is
+ frequently done in netlink protocols and does not break
+ backwards compatibility.
+
+One of the functions which use struct nla_policy is nla_validate().
+The function expects an array of struct nla_policy and will access the
+array using the attribute type as index. If an attribute type is out
+of bounds the attribute is assumed to be valid. This is intentional
+behaviour to allow older applications not yet aware of recently
+introduced attributes to continue functioning.
+
+[source,c]
+--------
+#include
+
+int nla_validate(struct nlattr *head, int len, int maxtype, struct nla_policy *policy);
+--------
+
+The function nla_validate() returns 0 if all attributes are valid,
+otherwise a validation failure specific error code is returned.
+
+Most applications will rarely use nla_validate() directly but use
+nla_parse() instead which takes care of validation in the same way but
+also parses the the attributes in the same step. See
+<> for an example and more information.
+
+The validation process in detail:
+
+. If attribute type is 0 or exceeds +maxtype+ attribute is
+ considered valid, 0 is returned.
+. If payload length is < +minlen+, +-NLE_ERANGE+ is returned.
+. If +maxlen+ is defined and payload exceeds it, +-NLE_ERANGE+
+ is returned.
+. Datatype specific requirements rules, see <>
+. If all is ok, 0 is returned.
+
+[[core_attr_parse_easy]]
+.Parsing Attributes the Easy Way
+
+Most applications will not want to deal with splitting attribute
+streams themselves as described in <>
+A much easier method is to use nla_parse().
+
+[source,c]
+--------
+#include
+
+int nla_parse(struct nlattr **attrs, int maxtype, struct nlattr *head,
+ int len, struct nla_policy *policy);
+--------
+
+The function nla_parse() will iterate over a stream of attributes,
+validate each attribute as described in <>
+If the validation of all attributes succeeds, a pointer to each attribute
+is stored in the +attrs+ array at `attrs[nla_type(attr)]`.
+
+As an alernative to nla_parse() the function nlmsg_parse() can be used
+to parse the message and its attributes in one step. See
+<> for information on how to use these functions.
+
+.Example:
+
+The following example demonstrates how to parse a netlink message sent
+over a netlink protocol which does not use protocol headers. The example
+does enforce an attribute policy however, the attribute MY_ATTR_FOO must
+be a 32 bit integer, and the attribute MY_ATTR_BAR must be a string with
+a maximum length of 16 characters.
+
+[source,c]
+---------
+#include
+#include
+
+enum {
+ MY_ATTR_FOO = 1,
+ MY_ATTR_BAR,
+ __MY_ATTR_MAX,
+};
+
+#define MY_ATTR_MAX (__MY_ATTR_MAX - 1)
+
+static struct nla_policy my_policy[MY_ATTR_MAX+1] = {
+ [MY_ATTR_FOO] = { .type = NLA_U32 },
+ [MY_ATTR_BAR] = { .type = NLA_STRING,
+ .maxlen = 16 },
+};
+
+void parse_msg(struct nlmsghdr *nlh)
+{
+ struct nlattr *attrs[MY_ATTR_MAX+1];
+
+ if (nlmsg_parse(nlh, 0, attrs, MY_ATTR_MAX, my_policy) < 0)
+ /* error */
+
+ if (attrs[MY_ATTR_FOO]) {
+ /* MY_ATTR_FOO is present in message */
+ printf("value: %u\n", nla_get_u32(attrs[MY_ATTR_FOO]));
+ }
+}
+---------
+
+.Locating a Single Attribute
+
+An application only interested in a single attribute can use one of the
+functions nla_find() or nlmsg_find_attr(). These function will iterate
+over all attributes, search for a matching attribute and return a pointer
+to the corresponding attribute header.
+
+[source,c]
+--------
+#include
+
+struct nlattr *nla_find(struct nlattr *head, int len, int attrtype);
+--------
+
+[source,c]
+--------
+#include
+
+struct nlattr *nlmsg_find_attr(struct nlmsghdr *hdr, int hdrlen, int attrtype);
+--------
+
+NOTE: `nla_find()` and `nlmsg_find_attr()` will *not* search in nested
+ attributes recursively, see <>.
+
+==== Iterating over a Stream of Attributes
+
+In some situations it does not make sense to assign a unique attribute
+type to each attribute in the attribute stream. For example a list may
+be transferred using a stream of attributes and even if the attribute type
+is incremented for each attribute it may not make sense to use the
+nlmsg_parse() or nla_parse() function to fill an array.
+
+Therefore methods exist to iterate over a stream of attributes:
+
+[source,c]
+--------
+#include
+
+nla_for_each_attr(attr, head, len, remaining)
+--------
+
+nla_for_each_attr() is a macro which can be used in front of a code
+block:
+
+[source,c]
+--------
+#include
+
+struct nalttr *nla;
+int rem;
+
+nla_for_each_attr(nla, attrstream, streamlen, rem) {
+ /* validate & parse attribute */
+}
+
+if (rem > 0)
+ /* unparsed attribute data */
+--------
+
+[[core_attr_constr]]
+=== Attribute Construction
+
+The interface to add attributes to a netlink message is based on the
+regular message construction interface. It assumes that the message
+header and an eventual protocol header has been added to the message
+already.
+
+[source,c]
+--------
+struct nlattr *nla_reserve(struct nl_msg *msg, int attrtype, int len);
+--------
+
+The function nla_reserve() adds an attribute header at the end of the
+message and reserves room for +len+ bytes of payload. The function
+returns a pointer to the attribute payload section inside the message.
+Padding is added at the end of the attribute to ensure the next
+attribute is properly aligned.
+
+[source,c]
+--------
+int nla_put(struct nl_msg *msg, int attrtype, int attrlen, const void *data);
+--------
+
+The function nla_put() is based on nla_reserve() but takes an additional
+pointer +data+ pointing to a buffer containing the attribute payload.
+It will copy the buffer into the message automatically.
+
+.Example:
+
+[source,c]
+--------
+struct my_attr_struct {
+ uint32_t a;
+ uint32_t b;
+};
+
+int my_put(struct nl_msg *msg)
+{
+ struct my_attr_struct obj = {
+ .a = 10,
+ .b = 20,
+ };
+
+ return nla_put(msg, ATTR_MY_STRUCT, sizeof(obj), &obj);
+}
+--------
+
+See <> for datatype specific attribute construction
+functions.
+
+.Exception Based Attribute Construction
+
+Like in the kernel API an exception based construction interface is
+provided. The behaviour of the macros is identical to their regular
+function counterparts except that in case of an error, the target
+`nla_put_failure` is jumped.
+
+.Example:
+[source,c]
+--------
+#include
+#include
+
+void construct_attrs(struct nl_msg *msg)
+{
+ NLA_PUT_STRING(msg, MY_ATTR_FOO1, "some text");
+ NLA_PUT_U32(msg, MY_ATTR_FOO1, 0x1010);
+ NLA_PUT_FLAG(msg, MY_ATTR_FOO3, 1);
+
+ return 0;
+
+nla_put_failure:
+ /* NLA_PUT* macros jump here in case of an error */
+ return -EMSGSIZE;
+}
+--------
+
+See <> for more information on the datatype specific
+exception based variants.
+
+[[core_attr_types]]
+=== Attribute Data Types
+
+A number of basic data types have been defined to simplify access and
+validation of attributes. The datatype is not encoded in the
+attribute, therefore the sender and receiver are required to use the
+same definition on what attribute is of what type.
+
+[options="header", cols="1m,5"]
+|================================================
+| Type | Description
+| NLA_UNSPEC | Unspecified attribute
+| NLA_U{8\|16\|32} | Integers
+| NLA_STRING | String
+| NLA_FLAG | Flag
+| NLA_NESTED | Nested attribute
+|================================================
+
+Besides simplified access to the payload of such datatypes, the major
+advantage is the automatic validation of each attribute based on a
+policy. The validation ensures safe access to the payload by checking
+for minimal payload size and can also be used to enforce maximum
+payload size for some datatypes.
+
+==== Integer Attributes
+
+The most frequently used datatypes are integers. Integers come in four
+different sizes:
+[horizontal]
+NLA_U8:: 8bit integer
+NLA_U16:: 16bit integer
+NLA_U32:: 32bit integer
+NLA_U64:: 64bit integer
+
+Note that due to the alignment requirements of attributes the integer
+attribute +NLA_u8+ and +NLA_U16+ will not result in space savings in
+the netlink message. Their use is intended to limit the range of
+values.
+
+.Parsing Integer Attributes
+
+[source,c]
+--------
+#include
+
+uint8_t nla_get_u8(struct nlattr *hdr);
+uint16_t nla_get_u16(struct nlattr *hdr);
+uint32_t nla_get_u32(struct nlattr *hdr);
+uint64_t nla_get_u64(struct nlattr *hdr);
+--------
+
+Example:
+
+[source,c]
+--------
+if (attrs[MY_ATTR_FOO])
+ uint32_t val = nla_get_u32(attrs[MY_ATTR_FOO]);
+--------
+
+.Constructing Integer Attributes
+
+[source,c]
+--------
+#include
+
+int nla_put_u8(struct nl_msg *msg, int attrtype, uint8_t value);
+int nla_put_u16(struct nl_msg *msg, int attrtype, uint16_t value);
+int nla_put_u32(struct nl_msg *msg, int attrtype, uint32_t value);
+int nla_put_u64(struct nl_msg *msg, int attrtype, uint64_t value);
+--------
+
+Exception based:
+
+[source,c]
+--------
+NLA_PUT_U8(msg, attrtype, value)
+NLA_PUT_U16(msg, attrtype, value)
+NLA_PUT_U32(msg, attrtype, value)
+NLA_PUT_U64(msg, attrtype, value)
+--------
+
+.Validation
+
+Use +NLA_U8+, +NLA_U16+, +NLA_U32+, or +NLA_U64+ to define the type of
+integer when filling out a struct nla_policy array. It will
+automatically enforce the correct minimum payload length policy.
+
+Validation does not differ between signed and unsigned integers, only
+the size matters. If the application wishes to enforce particular value
+ranges it must do so itself.
+
+[source,c]
+--------
+static struct nla_policy my_policy[ATTR_MAX+1] = {
+ [ATTR_FOO] = { .type = NLA_U32 },
+ [ATTR_BAR] = { .type = NLA_U8 },
+};
+--------
+
+The above is equivalent to:
+[source,c]
+--------
+static struct nla_policy my_policy[ATTR_MAX+1] = {
+ [ATTR_FOO] = { .minlen = sizeof(uint32_t) },
+ [ATTR_BAR] = { .minlen = sizeof(uint8_t) },
+};
+--------
+
+==== String Attributes
+
+The string datatype represents a NUL termianted character string of
+variable length. It is not intended for binary data streams.
+
+The payload of string attributes can be accessed with the function
+nla_get_string(). nla_strdup() calls strdup() on the payload and returns
+the newly allocated string.
+
+[source,c]
+--------
+#include
+
+char *nla_get_string(struct nlattr *hdr);
+char *nla_strdup(struct nlattr *hdr);
+--------
+
+String attributes are constructed with the function +nla_put_string()+
+respectively +NLA_PUT_STRING()+. The length of the payload will be
+strlen()+1, the trailing NUL byte is included.
+
+[source,c]
+--------
+int nla_put_string(struct nl_msg *msg, int attrtype, const char *data);
+
+NLA_PUT_STRING(msg, attrtype, data)
+--------
+
+For validation purposes the type +NLA_STRING+ can be used in
++struct nla_policy+ definitions. It implies a minimum payload length
+of 1 byte and checks for a trailing NUL byte. Optionally the +maxlen+
+member defines the maximum length of a character string (including the
+trailing NUL byte).
+
+[source,c]
+--------
+static struct nla_policy my_policy[] = {
+ [ATTR_FOO] = { .type = NLA_STRING,
+ .maxlen = IFNAMSIZ },
+};
+--------
+
+==== Flag Attributes
+
+The flag attribute represents a boolean datatype. The presence of the
+attribute implies a value of +true+, the absence of the attribute
+implies the value +false+. Therefore the payload length of flag
+attributes is always 0.
+
+[source,c]
+--------
+int nla_get_flag(struct nlattr *hdr);
+int nla_put_flag(struct nl_msg *msg, int attrtype);
+--------
+
+The type +NLA_FLAG+ is used for validation purposes. It implies a
++maxlen+ value of 0 and thus enforces a maximum payload length of 0.
+
+.Example:
+[source,c]
+--------
+/* nla_put_flag() appends a zero sized attribute to the message. */
+nla_put_flag(msg, ATTR_FLAG);
+
+/* There is no need for a receival function, the presence is the value. */
+if (attrs[ATTR_FLAG])
+ /* flag is present */
+--------
+
+[[core_attr_nested]]
+==== Nested Attributes
+
+As described in <>, attributes can be nested allowing for
+complex tree structures of attributes. It is commonly used to delegate
+the responsibility of a subsection of the message to a subsystem.
+Nested attributes are also commonly used for transmitting list of objects.
+
+When nesting attributes, the nested attributes are included as payload
+of a container attribute.
+
+NOTE: When validating the attributes using nlmsg_validate(),
+ nlmsg_parse(), nla_validate(), or nla_parse() only the
+ attributes on the first level are being validated. None of these
+ functions will validate attributes recursively. Therefore you
+ must explicitly call nla_validate() or use nla_parse_nested()
+ for each level of nested attributes.
+
+The type +NLA_NESTED+ should be used when defining nested attributes
+in a struct nla_policy definition. It will not enforce any minimum
+payload length unless +minlen+ is specified explicitly. This is
+because some netlink protocols implicitly allow empty container
+attributes.
+
+[source,c]
+--------
+static struct nla_policy my_policy[] = {
+ [ATTR_OPTS] = { .type = NLA_NESTED },
+};
+--------
+
+.Parsing of Nested Attributes
+
+The function nla_parse_nested() is used to parse nested attributes.
+Its behaviour is identical to nla_parse() except that it takes a
+struct nlattr as argument and will use the payload as stream of
+attributes.
+
+[source,c]
+--------
+if (attrs[ATTR_OPTS]) {
+ struct nlattr *nested[NESTED_MAX+1];
+ struct nla_policy nested_policy[] = {
+ [NESTED_FOO] = { .type = NLA_U32 },
+ };
+
+ if (nla_parse_nested(nested, NESTED_MAX, attrs[ATTR_OPTS], nested_policy) < 0)
+ /* error */
+
+ if (nested[NESTED_FOO])
+ uint32_t val = nla_get_u32(nested[NESTED_FOO]);
+}
+--------
+
+.Construction of Nested Attributes
+
+Attributes are nested by surrounding them with calls to nla_nest_start()
+and nla_nest_end(). nla_nest_start() will add an attribute header to
+the message but no actual payload. All data added to the message from
+this point on will be part of the container attribute until nla_nest_end()
+is called which "closes" the attribute, correcting its payload length to
+include all data length.
+
+[source,c]
+--------
+int put_opts(struct nl_msg *msg)
+{
+ struct nlattr *opts;
+
+ if (!(opts = nla_nest_start(msg, ATTR_OPTS)))
+ goto nla_put_failure;
+
+ NLA_PUT_U32(msg, NESTED_FOO, 123);
+ NLA_PUT_STRING(msg, NESTED_BAR, "some text");
+
+ nla_nest_end(msg, opts);
+ return 0;
+
+nla_put_failure:
+ nla_nest_cancel(msg, opts);
+ return -EMSGSIZE;
+}
+--------
+
+==== Unspecified Attribute
+
+This is the default attribute type and used when none of the basic
+datatypes is suitable. It represents data of arbitrary type and length.
+
+See <> for a more information on
+a special interface allowing the allocation of abstract address object
+based on netlink attributes which carry some form of network address.
+
+See <> for more information
+on how to allocate abstract data objects based on netlink attributes.
+
+Use the function nla_get() and nla_put() to access the payload and
+construct attributes. See <>
+for an example.
+
+=== Examples
+
+==== Constructing a Netlink Message with Attributes
+
+[source,c]
+--------
+struct nl_msg *build_msg(int ifindex, struct nl_addr *lladdr, int mtu)
+{
+ struct nl_msg *msg;
+ struct nlattr *info, *vlan;
+ struct ifinfomsg ifi = {
+ .ifi_family = AF_INET,
+ .ifi_index = ifindex,
+ };
+
+ /* Allocate a default sized netlink message */
+ if (!(msg = nlmsg_alloc_simple(RTM_SETLINK, 0)))
+ return NULL;
+
+ /* Append the protocol specific header (struct ifinfomsg)*/
+ if (nlmsg_append(msg, &ifi, sizeof(ifi), NLMSG_ALIGNTO) < 0)
+ goto nla_put_failure
+
+ /* Append a 32 bit integer attribute to carry the MTU */
+ NLA_PUT_U32(msg, IFLA_MTU, mtu);
+
+ /* Append an unspecific attribute to carry the link layer address */
+ NLA_PUT_ADDR(msg, IFLA_ADDRESS, lladdr);
+
+ /* Append a container for nested attributes to carry link information */
+ if (!(info = nla_nest_start(msg, IFLA_LINKINFO)))
+ goto nla_put_failure;
+
+ /* Put a string attribute into the container */
+ NLA_PUT_STRING(msg, IFLA_INFO_KIND, "vlan");
+
+ /*
+ * Append another container inside the open container to carry
+ * vlan specific attributes
+ */
+ if (!(vlan = nla_nest_start(msg, IFLA_INFO_DATA)))
+ goto nla_put_failure;
+
+ /* add vlan specific info attributes here... */
+
+ /* Finish nesting the vlan attributes and close the second container. */
+ nla_nest_end(msg, vlan);
+
+ /* Finish nesting the link info attribute and close the first container. */
+ nla_nest_end(msg, info);
+
+ return msg;
+
+nla_put_failure:
+ nlmsg_free(msg);
+ return NULL;
+}
+------
+
+==== Parsing a Netlink Message with Attributes
+
+[source,c]
+--------
+int parse_message(struct nlmsghdr *hdr)
+{
+ /*
+ * The policy defines two attributes: a 32 bit integer and a container
+ * for nested attributes.
+ */
+ struct nla_policy attr_policy[] = {
+ [ATTR_FOO] = { .type = NLA_U32 },
+ [ATTR_BAR] = { .type = NLA_NESTED },
+ };
+ struct nlattr *attrs[ATTR_MAX+1];
+ int err;
+
+ /*
+ * The nlmsg_parse() function will make sure that the message contains
+ * enough payload to hold the header (struct my_hdr), validates any
+ * attributes attached to the messages and stores a pointer to each
+ * attribute in the attrs[] array accessible by attribute type.
+ */
+ if ((err = nlmsg_parse(hdr, sizeof(struct my_hdr), attrs, ATTR_MAX,
+ attr_policy)) < 0)
+ goto errout;
+
+ if (attrs[ATTR_FOO]) {
+ /*
+ * It is safe to directly access the attribute payload without
+ * any further checks since nlmsg_parse() enforced the policy.
+ */
+ uint32_t foo = nla_get_u32(attrs[ATTR_FOO]);
+ }
+
+ if (attrs[ATTR_BAR]) {
+ struct *nested[NESTED_MAX+1];
+
+ /*
+ * Attributes nested in a container can be parsed the same way
+ * as top level attributes.
+ */
+ err = nla_parse_nested(nested, NESTED_MAX, attrs[ATTR_BAR],
+ nested_policy);
+ if (err < 0)
+ goto errout;
+
+ // Process nested attributes here.
+ }
+
+ err = 0;
+errout:
+ return err;
+}
+--------
+
+[[core_cb]]
+== Callback Configurations
+
+Callback hooks and overwriting capabilities are provided in various places
+inside the library to control the behaviour of several functions. All the
+callback and overwrite functions are packed together in struct nl_cb which
+is attached to a netlink socket or passed on to functions directly.
+
+=== Callback Hooks
+
+Callback hooks are spread across the library to provide entry points for
+message processing and to take action upon certain events.
+
+Callback functions may return the following return codes:
+[options="header", cols="1m,4"]
+|========================================================================
+| Return Code | Description
+| NL_OK | Proceed.
+| NL_SKIP | Skip message currently being processed and continue
+ parsing the receive buffer.
+| NL_STOP | Stop parsing and discard all remaining data in the
+ receive buffer.
+|========================================================================
+
+.Default Callback Implementations
+
+The library provides three sets of default callback implementations:
+* +NL_CB_DEFAULT+ This is the default set. It implements the default behaviour.
+ See the table below for more information on the return codes of each
+ function.
+* +NL_CB_VERBOSE+ This set is based on the default set but will cause an
+ error message to be printed to stderr for error messages, invalid
+ messages, message overruns and unhandled valid messages. The
+ +arg+ pointer in nl_cb_set() and nl_cb_err() can be used to
+ provide a FILE * which overwrites stderr.
+* +NL_CB_DEBUG+ This set is intended for debugging purposes. It is
+ based on the verbose set but will decode and dump each message sent
+ or received to the console.
+
+.Message Processing Callbacks
+
+.nl_sendmsg() callback hooks:
+[cols="2m,4e,1m", options="header"]
+|============================================================================
+| Callback ID | Description | Default Return Value
+| NL_CB_MSG_OUT | Each message sent | NL_OK
+|============================================================================
+
+Any function called by NL_CB_MSG_OUT may return a negative error code to
+prevent the message from being sent and the error code being returned.
+
+nl_recvmsgs() callback hooks (ordered by priority):
+[cols="2m,4e,1m", options="header"]
+|============================================================================
+| Callback ID | Description | Default Return Value
+| NL_CB_MSG_IN | Each message received | NL_OK
+| NL_CB_SEQ_CHECK | May overwrite sequence check algo | NL_OK
+| NL_CB_INVALID | Invalid messages | NL_STOP
+| NL_CB_SEND_ACK | Messages with NLM_F_ACK flag set | NL_OK
+| NL_CB_FINISH | Messages of type NLMSG_DONE | NL_STOP
+| NL_CB_SKIPPED | Messages of type NLMSG_NOOP | NL_SKIP
+| NL_CB_OVERRUN | Messages of type NLMSG_OVERRUN | NL_STOP
+| NL_CB_ACK | ACK Messages | NL_STOP
+| NL_CB_VALID | Each valid message | NL_OK
+|============================================================================
+
+Any of these functions may return NL_OK, NL_SKIP, or NL_STOP.
+
+Message processing callback functions are set with nl_cb_set():
+[source,c]
+--------
+#include
+
+int nl_cb_set(struct nl_cb *cb, enum nl_cb_type type, enum nl_cb_kind kind,
+ nl_recvmsg_msg_cb_t func, void *arg);
+
+typedef int (*nl_recvmsg_msg_cb_t)(struct nl_msg *msg, void *arg);
+--------
+
+.Callback for Error Messages
+
+A special function prototype is used for the error message callback hook:
+
+[source,c]
+--------
+#include
+
+int nl_cb_err(struct nl_cb *cb, enum nl_cb_kind kind, nl_recvmsg_err_cb_t func, void *arg);
+
+typedef int(* nl_recvmsg_err_cb_t)(struct sockaddr_nl *nla, struct nlmsgerr *nlerr, void *arg);
+--------
+
+.Example: Setting up a callback set
+[source,c]
+--------
+#include
+
+/* Allocate a callback set and initialize it to the verbose default set */
+struct nl_cb *cb = nl_cb_alloc(NL_CB_VERBOSE);
+
+/* Modify the set to call my_func() for all valid messages */
+nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, my_func, NULL);
+
+/*
+ * Set the error message handler to the verbose default implementation
+ * and direct it to print all errors to the given file descriptor.
+ */
+FILE *file = fopen(...);
+nl_cb_err(cb, NL_CB_VERBOSE, NULL, file);
+--------
+
+=== Overwriting of Internal Functions
+
+When the library needs to send or receive netlink messages in high level
+interfaces it does so by calling its own low level API. In the case the
+default characteristics are not sufficient for the application, it may
+overwrite several internal function calls with own implementations.
+
+.Overwriting recvmsgs()
+
+See <> for more information on
+how and when recvmsgs() is called internally.
+
+[source,c]
+--------
+#include
+
+void nl_cb_overwrite_recvmsgs(struct nl_cb *cb,
+ int (*func)(struct nl_sock *sk, struct nl_cb *cb));
+--------
+
+The following criterias must be met if a recvmsgs() implementation is
+supposed to work with high level interfaces:
+
+- MUST respect the callback configuration +cb+, therefore:
+ - MUST call +NL_CB_VALID+ for all valid messages, passing on
+ - MUST call +NL_CB_ACK+ for all ACK messages
+ - MUST correctly handle multipart messages, calling NL_CB_VALID for
+ each message until a NLMSG_DONE message is received.
+- MUST report error code if a NLMSG_ERROR or NLMSG_OVERRUN mesasge is
+ received.
+
+.Overwriting nl_recv()
+
+Often it is sufficient to overwrite `nl_recv()` which is responsible
+from receiving the actual data from the socket instead of replacing
+the complete `recvmsgs()` logic.
+
+See <> for more
+information on how and when `nl_recv()` is called internally.
+
+[source,c]
+--------
+#include
+
+void nl_cb_overwrite_recv(struct nl_cb *cb,
+ int (*func)(struct nl_sock * sk,
+ struct sockaddr_nl *addr,
+ unsigned char **buf,
+ struct ucred **cred));
+--------
+
+The following criteras must be met for an own `nl_recv()`
+implementation:
+
+ - *MUST* return the number of bytes read or a negative error code if
+ an error occurred. The function may also return 0 to indicate that
+ no data has been read.
+ - *MUST* set `*buf` to a buffer containing the data read. It must be
+ safe for the caller to access the number of bytes read returned as
+ return code.
+ - *MAY* fill out `*addr` with the netlink address of the peer the
+ data has been received from.
+ - *MAY* set `*cred` to a newly allocated struct ucred containing
+ credentials.
+
+.Overwriting nl_send()
+
+See <> for more information on
+how and when nl_send() is called internally.
+
+[source,c]
+--------
+#include
+
+void nl_cb_overwrite_send(struct nl_cb *cb, int (*func)(struct nl_sock *sk,
+ struct nl_msg *msg));
+--------
+
+Own implementations must send the netlink message and return 0 on success
+or a negative error code.
+
+[[core_cache]]
+== Cache System
+
+=== Allocation of Caches
+
+Almost all subsystem provide a function to allocate a new cache
+of some form. The function usually looks like this:
+[source,c]
+--------
+struct nl_cache *