mac_newworld: add via machine option to control mac99 VIA/ADB configuration
[qemu/ar7.git] / slirp / ip6_output.c
blob762cbfe89c13ab058834f8953c7ae668e5eb53b1
1 /*
2 * Copyright (c) 2013
3 * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
4 */
6 #include "qemu/osdep.h"
7 #include "qemu-common.h"
8 #include "slirp.h"
10 /* Number of packets queued before we start sending
11 * (to prevent allocing too many mbufs) */
12 #define IF6_THRESH 10
15 * IPv6 output. The packet in mbuf chain m contains a IP header
17 int ip6_output(struct socket *so, struct mbuf *m, int fast)
19 struct ip6 *ip = mtod(m, struct ip6 *);
21 DEBUG_CALL("ip6_output");
22 DEBUG_ARG("so = %lx", (long)so);
23 DEBUG_ARG("m = %lx", (long)m);
25 /* Fill IPv6 header */
26 ip->ip_v = IP6VERSION;
27 ip->ip_hl = IP6_HOP_LIMIT;
28 ip->ip_tc_hi = 0;
29 ip->ip_tc_lo = 0;
30 ip->ip_fl_hi = 0;
31 ip->ip_fl_lo = 0;
33 if (fast) {
34 if_encap(m->slirp, m);
35 } else {
36 if_output(so, m);
39 return 0;