1 .TH IPQ_MESSAGE_TYPE 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual"
3 .\" $Id: ipq_message_type.3,v 1.2 2001/10/16 14:41:02 jamesm Exp $
5 .\" Copyright (c) 2000-2001 Netfilter Core Team
7 .\" This program is free software; you can redistribute it and/or modify
8 .\" it under the terms of the GNU General Public License as published by
9 .\" the Free Software Foundation; either version 2 of the License, or
10 .\" (at your option) any later version.
12 .\" This program is distributed in the hope that it will be useful,
13 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
14 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 .\" GNU General Public License for more details.
17 .\" You should have received a copy of the GNU General Public License
18 .\" along with this program; if not, write to the Free Software
19 .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 ipq_message_type, ipq_get_packet, ipq_getmsgerr - query queue messages
25 .B #include <linux/netfilter.h>
27 .B #include <libipq.h>
29 .BI "int ipq_message_type(const unsigned char *" buf ");"
31 .BI "ipq_packet_msg_t *ipq_get_packet(const unsigned char *" buf ");"
33 .BI "int ipq_get_msgerr(const unsigned char *" buf ");"
37 function returns the type of queue message returned to userspace
42 should always be called following a successful call to
44 to determine whether the message is a packet message or an
47 parameter should be the same data obtained from
52 will return one of the following values:
55 An error message generated by the Netlink transport.
59 A packet message containing packet metadata and optional packet payload data.
63 function should be called if
69 parameter should point to the same data used for the call to
70 .BR ipq_message_type .
71 The pointer returned by
73 points to a packet message, which is declared as follows:
77 typedef struct ipq_packet_msg {
78 unsigned long packet_id; /* ID of queued packet */
79 unsigned long mark; /* Netfilter mark value */
80 long timestamp_sec; /* Packet arrival time (seconds) */
81 long timestamp_usec; /* Packet arrvial time (+useconds) */
82 unsigned int hook; /* Netfilter hook we rode in on */
83 char indev_name[IFNAMSIZ]; /* Name of incoming interface */
84 char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */
85 unsigned short hw_protocol; /* Hardware protocol (network order) */
86 unsigned short hw_type; /* Hardware type */
87 unsigned char hw_addrlen; /* Hardware address length */
88 unsigned char hw_addr[8]; /* Hardware address */
89 size_t data_len; /* Length of packet data */
90 unsigned char payload[0]; /* Optional packet data */
95 Each of these fields may be read by the application. If the queue mode
100 value is greater than zero, the packet payload contents may be accessed
101 in the memory following the
103 structure to a range of
108 field contains a packet identifier to be used when calling
109 .BR ipq_set_verdict .
113 function should be called if
119 parameter should point to the same data used for the call to
120 .BR ipq_message_type .
121 The value returned by
123 is set by higher level kernel code and corresponds to standard
129 James Morris <jmorris@intercode.com.au>
131 Copyright (c) 2000-2001 Netfilter Core Team.
133 Distributed under the GNU General Public License.