libnl  3.2.3
/build/buildd/libnl3-3.2.3/include/netlink/netfilter/queue.h
00001 /*
00002  * netlink/netfilter/queue.h    Netfilter Queue
00003  *
00004  *      This library is free software; you can redistribute it and/or
00005  *      modify it under the terms of the GNU Lesser General Public
00006  *      License as published by the Free Software Foundation version 2.1
00007  *      of the License.
00008  *
00009  * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net>
00010  */
00011 
00012 #ifndef NETLINK_QUEUE_H_
00013 #define NETLINK_QUEUE_H_
00014 
00015 #include <netlink/netlink.h>
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 struct nl_sock;
00022 struct nlmsghdr;
00023 struct nfnl_queue;
00024 
00025 extern struct nl_object_ops queue_obj_ops;
00026 
00027 enum nfnl_queue_copy_mode {
00028         NFNL_QUEUE_COPY_NONE,
00029         NFNL_QUEUE_COPY_META,
00030         NFNL_QUEUE_COPY_PACKET,
00031 };
00032 
00033 /* General */
00034 extern struct nl_sock *         nfnl_queue_socket_alloc(void);
00035 
00036 extern struct nfnl_queue *      nfnl_queue_alloc(void);
00037 
00038 extern void                     nfnl_queue_get(struct nfnl_queue *);
00039 extern void                     nfnl_queue_put(struct nfnl_queue *);
00040 
00041 /* Attributes */
00042 extern void                     nfnl_queue_set_group(struct nfnl_queue *, uint16_t);
00043 extern int                      nfnl_queue_test_group(const struct nfnl_queue *);
00044 extern uint16_t                 nfnl_queue_get_group(const struct nfnl_queue *);
00045 
00046 extern void                     nfnl_queue_set_maxlen(struct nfnl_queue *, uint32_t);
00047 extern int                      nfnl_queue_test_maxlen(const struct nfnl_queue *);
00048 extern uint32_t                 nfnl_queue_get_maxlen(const struct nfnl_queue *);
00049 
00050 extern void                     nfnl_queue_set_copy_mode(struct nfnl_queue *,
00051                                                          enum nfnl_queue_copy_mode);
00052 extern int                      nfnl_queue_test_copy_mode(const struct nfnl_queue *);
00053 extern enum nfnl_queue_copy_mode nfnl_queue_get_copy_mode(const struct nfnl_queue *);
00054 
00055 extern char *                   nfnl_queue_copy_mode2str(enum nfnl_queue_copy_mode,
00056                                                          char *, size_t);
00057 extern enum nfnl_queue_copy_mode nfnl_queue_str2copy_mode(const char *);
00058 
00059 extern void                     nfnl_queue_set_copy_range(struct nfnl_queue *,
00060                                                           uint32_t);
00061 extern int                      nfnl_queue_test_copy_range(const struct nfnl_queue *);
00062 extern uint32_t                 nfnl_queue_get_copy_range(const struct nfnl_queue *);
00063 
00064 extern int      nfnl_queue_build_pf_bind(uint8_t, struct nl_msg **);
00065 extern int      nfnl_queue_pf_bind(struct nl_sock *, uint8_t);
00066 
00067 extern int      nfnl_queue_build_pf_unbind(uint8_t, struct nl_msg **);
00068 extern int      nfnl_queue_pf_unbind(struct nl_sock *, uint8_t);
00069 
00070 extern int      nfnl_queue_build_create_request(const struct nfnl_queue *,
00071                                                 struct nl_msg **);
00072 extern int      nfnl_queue_create(struct nl_sock *,
00073                                   const struct nfnl_queue *);
00074 
00075 extern int      nfnl_queue_build_change_request(const struct nfnl_queue *,
00076                                                 struct nl_msg **);
00077 extern int      nfnl_queue_change(struct nl_sock *,
00078                                   const struct nfnl_queue *);
00079 
00080 extern int      nfnl_queue_build_delete_request(const struct nfnl_queue *,
00081                                                 struct nl_msg **);
00082 extern int      nfnl_queue_delete(struct nl_sock *,
00083                                   const struct nfnl_queue *);
00084 
00085 #ifdef __cplusplus
00086 }
00087 #endif
00088 
00089 #endif
00090