libnl 1.1
include/netlink/netfilter/log.h
00001 /*
00002  * netlink/netfilter/log.h      Netfilter Log
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) 2003-2006 Thomas Graf <tgraf@suug.ch>
00010  * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
00011  * Copyright (c) 2007 Secure Computing Corporation
00012  */
00013 
00014 #ifndef NETLINK_LOG_H_
00015 #define NETLINK_LOG_H_
00016 
00017 #include <netlink/netlink.h>
00018 
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 struct nl_handle;
00024 struct nlmsghdr;
00025 struct nfnl_log;
00026 
00027 extern struct nl_object_ops log_obj_ops;
00028 
00029 /* General */
00030 extern struct nfnl_log *nfnl_log_alloc(void);
00031 extern struct nfnl_log *nfnlmsg_log_parse(struct nlmsghdr *);
00032 
00033 extern void             nfnl_log_get(struct nfnl_log *);
00034 extern void             nfnl_log_put(struct nfnl_log *);
00035 
00036 extern struct nl_msg *  nfnl_log_build_bind(uint16_t);;
00037 extern int              nfnl_log_bind(struct nl_handle *, uint16_t);
00038 extern struct nl_msg *  nfnl_log_build_unbind(uint16_t);
00039 extern int              nfnl_log_unbind(struct nl_handle *, uint16_t);
00040 extern struct nl_msg *  nfnl_log_build_pf_bind(uint8_t);
00041 extern int              nfnl_log_pf_bind(struct nl_handle *, uint8_t);
00042 extern struct nl_msg *  nfnl_log_build_pf_unbind(uint8_t);
00043 extern int              nfnl_log_pf_unbind(struct nl_handle *, uint8_t);
00044 extern struct nl_msg *  nfnl_log_build_mode(uint16_t, uint8_t, uint32_t);
00045 extern int              nfnl_log_set_mode(struct nl_handle *, uint16_t,
00046                                           uint8_t, uint32_t);
00047 
00048 extern void             nfnl_log_set_family(struct nfnl_log *, uint8_t);
00049 extern uint8_t          nfnl_log_get_family(const struct nfnl_log *);
00050 
00051 extern void             nfnl_log_set_hwproto(struct nfnl_log *, uint16_t);
00052 extern int              nfnl_log_test_hwproto(const struct nfnl_log *);
00053 extern uint16_t         nfnl_log_get_hwproto(const struct nfnl_log *);
00054 
00055 extern void             nfnl_log_set_hook(struct nfnl_log *, uint8_t);
00056 extern int              nfnl_log_test_hook(const struct nfnl_log *);
00057 extern uint8_t          nfnl_log_get_hook(const struct nfnl_log *);
00058 
00059 extern void             nfnl_log_set_mark(struct nfnl_log *, uint32_t);
00060 extern int              nfnl_log_test_mark(const struct nfnl_log *);
00061 extern uint32_t         nfnl_log_get_mark(const struct nfnl_log *);
00062 
00063 extern void             nfnl_log_set_timestamp(struct nfnl_log *,
00064                                                struct timeval *);
00065 extern const struct timeval *nfnl_log_get_timestamp(const struct nfnl_log *);
00066 
00067 extern void             nfnl_log_set_indev(struct nfnl_log *, uint32_t);
00068 extern uint32_t         nfnl_log_get_indev(const struct nfnl_log *);
00069 
00070 extern void             nfnl_log_set_outdev(struct nfnl_log *, uint32_t);
00071 extern uint32_t         nfnl_log_get_outdev(const struct nfnl_log *);
00072 
00073 extern void             nfnl_log_set_physindev(struct nfnl_log *, uint32_t);
00074 extern uint32_t         nfnl_log_get_physindev(const struct nfnl_log *);
00075 
00076 extern void             nfnl_log_set_physoutdev(struct nfnl_log *, uint32_t);
00077 extern uint32_t         nfnl_log_get_physoutdev(const struct nfnl_log *);
00078 
00079 extern void             nfnl_log_set_hwaddr(struct nfnl_log *, uint8_t *, int);
00080 extern const uint8_t *  nfnl_log_get_hwaddr(const struct nfnl_log *, int *);
00081 
00082 extern int              nfnl_log_set_payload(struct nfnl_log *, uint8_t *, int);
00083 extern const void *     nfnl_log_get_payload(const struct nfnl_log *, int *);
00084 
00085 extern int              nfnl_log_set_prefix(struct nfnl_log *, void *);
00086 extern const char *     nfnl_log_get_prefix(const struct nfnl_log *);
00087 
00088 extern void             nfnl_log_set_uid(struct nfnl_log *, uint32_t);
00089 extern int              nfnl_log_test_uid(const struct nfnl_log *);
00090 extern uint32_t         nfnl_log_get_uid(const struct nfnl_log *);
00091 
00092 extern void             nfnl_log_set_seq(struct nfnl_log *, uint32_t);
00093 extern int              nfnl_log_test_seq(const struct nfnl_log *);
00094 extern uint32_t         nfnl_log_get_seq(const struct nfnl_log *);
00095 
00096 extern void             nfnl_log_set_seq_global(struct nfnl_log *, uint32_t);
00097 extern int              nfnl_log_test_seq_global(const struct nfnl_log *);
00098 extern uint32_t         nfnl_log_get_seq_global(const struct nfnl_log *);
00099 
00100 #ifdef __cplusplus
00101 }
00102 #endif
00103 
00104 #endif
00105