diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-03-15 17:09:52 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-03-15 17:09:52 +0000 |
commit | a6cdb77f816961f929d7934643febd2852230135 (patch) | |
tree | 927a63ea0415115f37de4822fd6f192e28d7df81 /slirp/ip6_output.c | |
parent | a58a4cb18725117bf69e6bee0a753c8b73b09667 (diff) | |
parent | fad7fb9ccd8013ea03c8c7a8f491c395e786dae6 (diff) |
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
slirp: Adding IPv6 support to Qemu -net user mode
# gpg: Signature made Tue 15 Mar 2016 16:06:03 GMT using RSA key ID FB6B2F1D
# gpg: Good signature from "Samuel Thibault <samuel.thibault@gnu.org>"
# gpg: aka "Samuel Thibault <sthibault@debian.org>"
# gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>"
# gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>"
# gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6
# Subkey fingerprint: F632 74CD C630 0873 CB3D 29D9 E3E5 1CE8 FB6B 2F1D
* remotes/thibault/tags/samuel-thibault:
slirp: Add IPv6 support to the TFTP code
qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses
slirp: Adding IPv6 address for DNS relay
slirp: Handle IPv6 in TCP functions
slirp: Reindent after refactoring
slirp: Generalizing and neutralizing various TCP functions before adding IPv6 stuff
slirp: Factorizing tcpiphdr structure with an union
slirp: Adding IPv6 UDP support
slirp: Adding ICMPv6 error sending
slirp: Fix ICMP error sending
slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'slirp/ip6_output.c')
-rw-r--r-- | slirp/ip6_output.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/slirp/ip6_output.c b/slirp/ip6_output.c new file mode 100644 index 0000000000..762cbfe89c --- /dev/null +++ b/slirp/ip6_output.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2013 + * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne. + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "slirp.h" + +/* Number of packets queued before we start sending + * (to prevent allocing too many mbufs) */ +#define IF6_THRESH 10 + +/* + * IPv6 output. The packet in mbuf chain m contains a IP header + */ +int ip6_output(struct socket *so, struct mbuf *m, int fast) +{ + struct ip6 *ip = mtod(m, struct ip6 *); + + DEBUG_CALL("ip6_output"); + DEBUG_ARG("so = %lx", (long)so); + DEBUG_ARG("m = %lx", (long)m); + + /* Fill IPv6 header */ + ip->ip_v = IP6VERSION; + ip->ip_hl = IP6_HOP_LIMIT; + ip->ip_tc_hi = 0; + ip->ip_tc_lo = 0; + ip->ip_fl_hi = 0; + ip->ip_fl_lo = 0; + + if (fast) { + if_encap(m->slirp, m); + } else { + if_output(so, m); + } + + return 0; +} |