diff options
Diffstat (limited to 'debian')
-rwxr-xr-x | debian/autogen.sh | 11 | ||||
-rw-r--r-- | debian/changelog | 19 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 67 | ||||
-rw-r--r-- | debian/copyright | 40 | ||||
-rw-r--r-- | debian/docs | 1 | ||||
-rw-r--r-- | debian/libmnl-dev.dirs | 2 | ||||
-rw-r--r-- | debian/libmnl-dev.install | 4 | ||||
-rw-r--r-- | debian/libmnl/opt/vyatta/include/libmnl/libmnl.h | 203 | ||||
l--------- | debian/libmnl/opt/vyatta/lib/libmnl.so | 1 | ||||
l--------- | debian/libmnl/opt/vyatta/lib/libmnl.so.0 | 1 | ||||
-rwxr-xr-x | debian/libmnl/opt/vyatta/lib/libmnl.so.0.1.0 | bin | 0 -> 53374 bytes | |||
-rw-r--r-- | debian/libmnl/opt/vyatta/lib/pkgconfig/libmnl.pc | 15 | ||||
-rw-r--r-- | debian/libmnl/usr/share/lintian/overrides/libmnl | 2 | ||||
-rw-r--r-- | debian/libmnl0.dirs | 1 | ||||
-rw-r--r-- | debian/libmnl0.install | 1 | ||||
-rw-r--r-- | debian/lintian | 2 | ||||
-rwxr-xr-x | debian/rules | 11 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | debian/source/options | 2 |
20 files changed, 385 insertions, 0 deletions
diff --git a/debian/autogen.sh b/debian/autogen.sh new file mode 100755 index 0000000..adb6d1c --- /dev/null +++ b/debian/autogen.sh @@ -0,0 +1,11 @@ +#!/bin/sh + + +rm -rf config +rm -f aclocal.m4 config.guess config.status config.sub configure INSTALL + +autoreconf --force --install + +rm -f config.sub config.guess +ln -s /usr/share/misc/config.sub . +ln -s /usr/share/misc/config.guess . diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..74b4ff8 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,19 @@ +libmnl (1.0.3-1) unstable; urgency=low + + * New libmnl package, merge upstream 1.0.3 libmnl changes required by user-space helpers + + -- Anibal Monsalve Salazar <anibal@debian.org> Sat, 01 Jan 2011 18:59:00 +1100 + +libmnl (1.0.1-1) unstable; urgency=low + + * New upstream release + * Upload to unstable + + -- Anibal Monsalve Salazar <anibal@debian.org> Sat, 01 Jan 2011 18:59:00 +1100 + +libmnl (0.0.0~20101124-1) experimental; urgency=low + + * Initial release + Closes: 604757 + + -- Anibal Monsalve Salazar <anibal@debian.org> Wed, 24 Nov 2010 12:14:40 +1100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..4fa8613 --- /dev/null +++ b/debian/control @@ -0,0 +1,67 @@ +Source: libmnl +Priority: extra +Maintainer: Anibal Monsalve Salazar <anibal@debian.org> +Build-Depends: debhelper (>= 7.0.50~), autotools-dev +Standards-Version: 3.9.1 +Section: libs +Homepage: http://netfilter.org/projects/libmnl/ +#Vcs-Git: git://git.debian.org/collab-maint/libmnl.git +#Vcs-Browser: http://git.debian.org/?p=collab-maint/libmnl.git;a=summary + +Package: libmnl-dev +Section: libdevel +Architecture: any +Depends: libmnl0 (= ${binary:Version}), ${misc:Depends} +Description: minimalistic Netlink communication library (devel) + libmnl is a minimalistic user-space library oriented to Netlink developers. + There are a lot of common tasks in parsing, validating, constructing of + both the Netlink header and TLVs that are repetitive and easy to get wrong. + This library aims to provide simple helpers that allows you to re-use code + and to avoid re-inventing the wheel. + . + The main features of this library are: + . + Small: the shared library requires around 30KB for an x86-based computer. + . + Simple: this library avoids complexity and elaborated abstractions that + tend to hide Netlink details. + . + Easy to use: the library simplifies the work for Netlink-wise developers. + It provides functions to make socket handling, message building, + validating, parsing and sequence tracking, easier. + . + Easy to re-use: you can use the library to build your own abstraction + layer on top of this library. + . + Decoupling: the interdependency of the main bricks that compose the + library is reduced, i.e. the library provides many helpers, but the + programmer is not forced to use them. + +Package: libmnl0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: minimalistic Netlink communication library + libmnl is a minimalistic user-space library oriented to Netlink developers. + There are a lot of common tasks in parsing, validating, constructing of + both the Netlink header and TLVs that are repetitive and easy to get wrong. + This library aims to provide simple helpers that allows you to re-use code + and to avoid re-inventing the wheel. + . + The main features of this library are: + . + Small: the shared library requires around 30KB for an x86-based computer. + . + Simple: this library avoids complexity and elaborated abstractions that + tend to hide Netlink details. + . + Easy to use: the library simplifies the work for Netlink-wise developers. + It provides functions to make socket handling, message building, + validating, parsing and sequence tracking, easier. + . + Easy to re-use: you can use the library to build your own abstraction + layer on top of this library. + . + Decoupling: the interdependency of the main bricks that compose the + library is reduced, i.e. the library provides many helpers, but the + programmer is not forced to use them. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..e4a21e4 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,40 @@ +This work was packaged for Debian by: + + Anibal Monsalve Salazar <anibal@debian.org> on Wed, 24 Nov 2010 12:14:40 +1100 + +It was downloaded from: + + http://git.netfilter.org/cgi-bin/gitweb.cgi?p=libmnl.git + +Upstream Author: + + Pablo Neira Ayuso <pablo@netfilter.org> + +Copyright: + + (C) 2008-2010 by Pablo Neira Ayuso <pablo@netfilter.org> + +License: + + This package 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 package 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 General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in "/usr/share/common-licenses/LGPL-2". + +The Debian packaging is: + + Copyright (C) 2010 Anibal Monsalve Salazar <anibal@debian.org> + +and is licensed under the GPL version 2, or (at your option) any later +version. See "/usr/share/common-licenses/GPL-2". diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e845566 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/libmnl-dev.dirs b/debian/libmnl-dev.dirs new file mode 100644 index 0000000..4418816 --- /dev/null +++ b/debian/libmnl-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/debian/libmnl-dev.install b/debian/libmnl-dev.install new file mode 100644 index 0000000..126abbb --- /dev/null +++ b/debian/libmnl-dev.install @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/lib*.so +usr/lib/pkgconfig/* +usr/lib/*.la diff --git a/debian/libmnl/opt/vyatta/include/libmnl/libmnl.h b/debian/libmnl/opt/vyatta/include/libmnl/libmnl.h new file mode 100644 index 0000000..a647fd9 --- /dev/null +++ b/debian/libmnl/opt/vyatta/include/libmnl/libmnl.h @@ -0,0 +1,203 @@ +#ifndef _LIBMNL_H_ +#define _LIBMNL_H_ + +#ifdef __cplusplus +# include <cstdio> +# include <cstdint> +#else +# include <stdbool.h> /* not in C++ */ +# include <stdio.h> +# include <stdint.h> +#endif +#include <unistd.h> +#include <sys/socket.h> /* for sa_family_t */ +#include <linux/netlink.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Netlink socket API + */ + +#define MNL_SOCKET_AUTOPID 0 +#define MNL_SOCKET_BUFFER_SIZE (getpagesize() < 8192L ? getpagesize() : 8192L) + +struct mnl_socket; + +extern struct mnl_socket *mnl_socket_open(int type); +extern int mnl_socket_bind(struct mnl_socket *nl, unsigned int groups, pid_t pid); +extern int mnl_socket_close(struct mnl_socket *nl); +extern int mnl_socket_get_fd(const struct mnl_socket *nl); +extern unsigned int mnl_socket_get_portid(const struct mnl_socket *nl); +extern ssize_t mnl_socket_sendto(const struct mnl_socket *nl, const void *req, size_t siz); +extern ssize_t mnl_socket_recvfrom(const struct mnl_socket *nl, void *buf, size_t siz); +extern int mnl_socket_setsockopt(const struct mnl_socket *nl, int type, void *buf, socklen_t len); +extern int mnl_socket_getsockopt(const struct mnl_socket *nl, int type, void *buf, socklen_t *len); + +/* + * Netlink message API + */ + +#define MNL_ALIGNTO 4 +#define MNL_ALIGN(len) (((len)+MNL_ALIGNTO-1) & ~(MNL_ALIGNTO-1)) +#define MNL_NLMSG_HDRLEN MNL_ALIGN(sizeof(struct nlmsghdr)) + +extern size_t mnl_nlmsg_size(size_t len); +extern size_t mnl_nlmsg_get_payload_len(const struct nlmsghdr *nlh); + +/* Netlink message header builder */ +extern struct nlmsghdr *mnl_nlmsg_put_header(void *buf); +extern void *mnl_nlmsg_put_extra_header(struct nlmsghdr *nlh, size_t size); + +/* Netlink message iterators */ +extern bool mnl_nlmsg_ok(const struct nlmsghdr *nlh, int len); +extern struct nlmsghdr *mnl_nlmsg_next(const struct nlmsghdr *nlh, int *len); + +/* Netlink sequence tracking */ +extern bool mnl_nlmsg_seq_ok(const struct nlmsghdr *nlh, unsigned int seq); + +/* Netlink portID checking */ +extern bool mnl_nlmsg_portid_ok(const struct nlmsghdr *nlh, unsigned int portid); + +/* Netlink message getters */ +extern void *mnl_nlmsg_get_payload(const struct nlmsghdr *nlh); +extern void *mnl_nlmsg_get_payload_offset(const struct nlmsghdr *nlh, size_t offset); +extern void *mnl_nlmsg_get_payload_tail(const struct nlmsghdr *nlh); + +/* Netlink message printer */ +extern void mnl_nlmsg_fprintf(FILE *fd, const void *data, size_t datalen, size_t extra_header_size); + +/* Message batch helpers */ +struct mnl_nlmsg_batch; +extern struct mnl_nlmsg_batch *mnl_nlmsg_batch_start(void *buf, size_t bufsiz); +extern bool mnl_nlmsg_batch_next(struct mnl_nlmsg_batch *b); +extern void mnl_nlmsg_batch_stop(struct mnl_nlmsg_batch *b); +extern size_t mnl_nlmsg_batch_size(struct mnl_nlmsg_batch *b); +extern void mnl_nlmsg_batch_reset(struct mnl_nlmsg_batch *b); +extern void *mnl_nlmsg_batch_head(struct mnl_nlmsg_batch *b); +extern void *mnl_nlmsg_batch_current(struct mnl_nlmsg_batch *b); +extern bool mnl_nlmsg_batch_is_empty(struct mnl_nlmsg_batch *b); + +/* + * Netlink attributes API + */ +#define MNL_ATTR_HDRLEN MNL_ALIGN(sizeof(struct nlattr)) + +/* TLV attribute getters */ +extern uint16_t mnl_attr_get_type(const struct nlattr *attr); +extern uint16_t mnl_attr_get_len(const struct nlattr *attr); +extern uint16_t mnl_attr_get_payload_len(const struct nlattr *attr); +extern void *mnl_attr_get_payload(const struct nlattr *attr); +extern uint8_t mnl_attr_get_u8(const struct nlattr *attr); +extern uint16_t mnl_attr_get_u16(const struct nlattr *attr); +extern uint32_t mnl_attr_get_u32(const struct nlattr *attr); +extern uint64_t mnl_attr_get_u64(const struct nlattr *attr); +extern const char *mnl_attr_get_str(const struct nlattr *attr); + +/* TLV attribute putters */ +extern void mnl_attr_put(struct nlmsghdr *nlh, uint16_t type, size_t len, const void *data); +extern void mnl_attr_put_u8(struct nlmsghdr *nlh, uint16_t type, uint8_t data); +extern void mnl_attr_put_u16(struct nlmsghdr *nlh, uint16_t type, uint16_t data); +extern void mnl_attr_put_u32(struct nlmsghdr *nlh, uint16_t type, uint32_t data); +extern void mnl_attr_put_u64(struct nlmsghdr *nlh, uint16_t type, uint64_t data); +extern void mnl_attr_put_str(struct nlmsghdr *nlh, uint16_t type, const char *data); +extern void mnl_attr_put_strz(struct nlmsghdr *nlh, uint16_t type, const char *data); + +/* TLV attribute putters with buffer boundary checkings */ +extern bool mnl_attr_put_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type, size_t len, const void *data); +extern bool mnl_attr_put_u8_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint8_t data); +extern bool mnl_attr_put_u16_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint16_t data); +extern bool mnl_attr_put_u32_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint32_t data); +extern bool mnl_attr_put_u64_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint64_t data); +extern bool mnl_attr_put_str_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type, const char *data); +extern bool mnl_attr_put_strz_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type, const char *data); + +/* TLV attribute nesting */ +extern struct nlattr *mnl_attr_nest_start(struct nlmsghdr *nlh, uint16_t type); +extern struct nlattr *mnl_attr_nest_start_check(struct nlmsghdr *nlh, size_t buflen, uint16_t type); +extern void mnl_attr_nest_end(struct nlmsghdr *nlh, struct nlattr *start); +extern void mnl_attr_nest_cancel(struct nlmsghdr *nlh, struct nlattr *start); + +/* TLV validation */ +extern int mnl_attr_type_valid(const struct nlattr *attr, uint16_t maxtype); + +enum mnl_attr_data_type { + MNL_TYPE_UNSPEC, + MNL_TYPE_U8, + MNL_TYPE_U16, + MNL_TYPE_U32, + MNL_TYPE_U64, + MNL_TYPE_STRING, + MNL_TYPE_FLAG, + MNL_TYPE_MSECS, + MNL_TYPE_NESTED, + MNL_TYPE_NESTED_COMPAT, + MNL_TYPE_NUL_STRING, + MNL_TYPE_BINARY, + MNL_TYPE_MAX, +}; + +extern int mnl_attr_validate(const struct nlattr *attr, enum mnl_attr_data_type type); +extern int mnl_attr_validate2(const struct nlattr *attr, enum mnl_attr_data_type type, size_t len); + +/* TLV iterators */ +extern bool mnl_attr_ok(const struct nlattr *attr, int len); +extern struct nlattr *mnl_attr_next(const struct nlattr *attr); + +#define mnl_attr_for_each(attr, nlh, offset) \ + for ((attr) = mnl_nlmsg_get_payload_offset((nlh), (offset)); \ + mnl_attr_ok((attr), (char *)mnl_nlmsg_get_payload_tail(nlh) - (char *)(attr)); \ + (attr) = mnl_attr_next(attr)) + +#define mnl_attr_for_each_nested(attr, nest) \ + for ((attr) = mnl_attr_get_payload(nest); \ + mnl_attr_ok((attr), (char *)mnl_attr_get_payload(nest) + mnl_attr_get_payload_len(nest) - (char *)(attr)); \ + (attr) = mnl_attr_next(attr)) + +#define mnl_attr_for_each_payload(payload, payload_size) \ + for ((attr) = (payload); \ + mnl_attr_ok((attr), (char *)(payload) + payload_size - (char *)(attr)); \ + (attr) = mnl_attr_next(attr)) + +/* TLV callback-based attribute parsers */ +typedef int (*mnl_attr_cb_t)(const struct nlattr *attr, void *data); + +extern int mnl_attr_parse(const struct nlmsghdr *nlh, unsigned int offset, mnl_attr_cb_t cb, void *data); +extern int mnl_attr_parse_nested(const struct nlattr *attr, mnl_attr_cb_t cb, void *data); +extern int mnl_attr_parse_payload(const void *payload, size_t payload_len, mnl_attr_cb_t cb, void *data); + +/* + * callback API + */ +#define MNL_CB_ERROR -1 +#define MNL_CB_STOP 0 +#define MNL_CB_OK 1 + +typedef int (*mnl_cb_t)(const struct nlmsghdr *nlh, void *data); + +extern int mnl_cb_run(const void *buf, size_t numbytes, unsigned int seq, + unsigned int portid, mnl_cb_t cb_data, void *data); + +extern int mnl_cb_run2(const void *buf, size_t numbytes, unsigned int seq, + unsigned int portid, mnl_cb_t cb_data, void *data, + mnl_cb_t *cb_ctl_array, unsigned int cb_ctl_array_len); + +/* + * other declarations + */ + +#ifndef SOL_NETLINK +#define SOL_NETLINK 270 +#endif + +#ifndef MNL_ARRAY_SIZE +#define MNL_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/debian/libmnl/opt/vyatta/lib/libmnl.so b/debian/libmnl/opt/vyatta/lib/libmnl.so new file mode 120000 index 0000000..66ebbb3 --- /dev/null +++ b/debian/libmnl/opt/vyatta/lib/libmnl.so @@ -0,0 +1 @@ +libmnl.so.0.1.0
\ No newline at end of file diff --git a/debian/libmnl/opt/vyatta/lib/libmnl.so.0 b/debian/libmnl/opt/vyatta/lib/libmnl.so.0 new file mode 120000 index 0000000..66ebbb3 --- /dev/null +++ b/debian/libmnl/opt/vyatta/lib/libmnl.so.0 @@ -0,0 +1 @@ +libmnl.so.0.1.0
\ No newline at end of file diff --git a/debian/libmnl/opt/vyatta/lib/libmnl.so.0.1.0 b/debian/libmnl/opt/vyatta/lib/libmnl.so.0.1.0 Binary files differnew file mode 100755 index 0000000..8397415 --- /dev/null +++ b/debian/libmnl/opt/vyatta/lib/libmnl.so.0.1.0 diff --git a/debian/libmnl/opt/vyatta/lib/pkgconfig/libmnl.pc b/debian/libmnl/opt/vyatta/lib/pkgconfig/libmnl.pc new file mode 100644 index 0000000..a6a9e47 --- /dev/null +++ b/debian/libmnl/opt/vyatta/lib/pkgconfig/libmnl.pc @@ -0,0 +1,15 @@ +# libmnl pkg-config file + +prefix=/opt/vyatta +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libmnl +Description: Minimalistic Netlink communication library +URL: http://netfilter.org/projects/libmnl/ +Version: 1.0.3 +Requires: +Conflicts: +Libs: -L${libdir} -lmnl +Cflags: -I${includedir} diff --git a/debian/libmnl/usr/share/lintian/overrides/libmnl b/debian/libmnl/usr/share/lintian/overrides/libmnl new file mode 100644 index 0000000..bd8a09b --- /dev/null +++ b/debian/libmnl/usr/share/lintian/overrides/libmnl @@ -0,0 +1,2 @@ +libmnl: file-in-unusual-dir +libmnl: dir-or-file-in-opt diff --git a/debian/libmnl0.dirs b/debian/libmnl0.dirs new file mode 100644 index 0000000..6845771 --- /dev/null +++ b/debian/libmnl0.dirs @@ -0,0 +1 @@ +usr/lib diff --git a/debian/libmnl0.install b/debian/libmnl0.install new file mode 100644 index 0000000..d0dbfd1 --- /dev/null +++ b/debian/libmnl0.install @@ -0,0 +1 @@ +usr/lib/lib*.so.* diff --git a/debian/lintian b/debian/lintian new file mode 100644 index 0000000..bd8a09b --- /dev/null +++ b/debian/lintian @@ -0,0 +1,2 @@ +libmnl: file-in-unusual-dir +libmnl: dir-or-file-in-opt diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..100e20d --- /dev/null +++ b/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_builddeb: + dh_builddeb -- -Zbzip2 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..779dbfd --- /dev/null +++ b/debian/source/options @@ -0,0 +1,2 @@ +compression = "bzip2" +compression-level = 9 |