]> git.pld-linux.org Git - packages/iptables.git/blame - ip_queue_vwmark.patch.userspace
- allow build with -O0
[packages/iptables.git] / ip_queue_vwmark.patch.userspace
CommitLineData
9acebf10 1diff -Nru include.orig/libipq/libipq.h include/libipq/libipq.h
2--- userspace/include.orig/libipq/libipq.h 2003-10-16 01:53:08.000000000 +0200
3+++ userspace/include/libipq/libipq.h 2003-10-16 23:47:35.000000000 +0200
4@@ -79,6 +79,13 @@
5 size_t data_len,
6 unsigned char *buf);
7
8+int ipq_set_vwmark(const struct ipq_handle *h,
9+ ipq_id_t id,
10+ unsigned int verdict,
11+ unsigned long nfmark,
12+ size_t data_len,
13+ unsigned char *buf);
14+
15 int ipq_ctl(const struct ipq_handle *h, int request, ...);
16
17 char *ipq_errstr(void);
18
19diff -Nru libipq.orig/libipq.c libipq/libipq.c
20--- userspace/libipq.orig/libipq.c 2003-10-16 01:58:46.000000000 +0200
21+++ userspace/libipq/libipq.c 2003-10-16 23:33:10.000000000 +0200
22@@ -348,6 +348,54 @@
23 return ipq_netlink_sendmsg(h, &msg, 0);
24 }
25
26+int ipq_set_vwmark(const struct ipq_handle *h,
27+ ipq_id_t id,
28+ unsigned int verdict,
29+ unsigned long nfmark,
30+ size_t data_len,
31+ unsigned char *buf)
32+{
33+ unsigned char nvecs;
34+ size_t tlen;
35+ struct nlmsghdr nlh;
36+ ipq_peer_msg_t pm;
37+ struct iovec iov[3];
38+ struct msghdr msg;
39+
40+ memset(&nlh, 0, sizeof(nlh));
41+ nlh.nlmsg_flags = NLM_F_REQUEST;
42+ nlh.nlmsg_type = IPQM_VWMARK;
43+ nlh.nlmsg_pid = h->local.nl_pid;
44+ memset(&pm, 0, sizeof(pm));
45+ pm.msg.vwmark.value = verdict;
46+ pm.msg.vwmark.id = id;
47+ pm.msg.vwmark.data_len = data_len;
48+ pm.msg.vwmark.nfmark = nfmark;
49+ iov[0].iov_base = &nlh;
50+ iov[0].iov_len = sizeof(nlh);
51+ iov[1].iov_base = ±
52+ iov[1].iov_len = sizeof(pm);
53+ tlen = sizeof(nlh) + sizeof(pm);
54+ nvecs = 2;
55+ if (data_len && buf) {
56+ iov[2].iov_base = buf;
57+ iov[2].iov_len = data_len;
58+ tlen += data_len;
59+ nvecs++;
60+ }
61+ msg.msg_name = (void *)&h->peer;
62+ msg.msg_namelen = sizeof(h->peer);
63+ msg.msg_iov = iov;
64+ msg.msg_iovlen = nvecs;
65+ msg.msg_control = NULL;
66+ msg.msg_controllen = 0;
67+ msg.msg_flags = 0;
68+ nlh.nlmsg_len = tlen;
69+ return ipq_netlink_sendmsg(h, &msg, 0);
70+}
71+
72+
73+
74 /* Not implemented yet */
75 int ipq_ctl(const struct ipq_handle *h, int request, ...)
76 {
This page took 0.087616 seconds and 4 git commands to generate.