summaryrefslogtreecommitdiff
path: root/slirp/ip6_icmp.h
diff options
context:
space:
mode:
authorYann Bordenave <meow@meowstars.org>2016-03-15 10:31:19 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-15 10:35:04 +0100
commitfc6c9257c6dd47316a1c55d356bcd89bdc5fd642 (patch)
treea3a46ef4bd2c113b7a90167c7b41b6dd1c81a02c /slirp/ip6_icmp.h
parentde40abfecfe17f79870a66acfc1f87a53fc066ca (diff)
downloadqemu-fc6c9257c6dd47316a1c55d356bcd89bdc5fd642.tar.gz
slirp: Adding ICMPv6 error sending
Adding icmp6_send_error to send ICMPv6 Error messages. This function is simpler than the v4 version. Adding some calls in various functions to send ICMP errors, when a received packet is too big, or when its hop limit is 0. Signed-off-by: Yann Bordenave <meow@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'slirp/ip6_icmp.h')
-rw-r--r--slirp/ip6_icmp.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/slirp/ip6_icmp.h b/slirp/ip6_icmp.h
index b2c40d6c96..9460bf837a 100644
--- a/slirp/ip6_icmp.h
+++ b/slirp/ip6_icmp.h
@@ -19,6 +19,12 @@ struct icmp6_echo { /* Echo Messages */
uint16_t seq_num;
};
+union icmp6_error_body {
+ uint32_t unused;
+ uint32_t pointer;
+ uint32_t mtu;
+};
+
/*
* NDP Messages
*/
@@ -82,6 +88,7 @@ struct icmp6 {
uint8_t icmp6_code; /* type sub code */
uint16_t icmp6_cksum; /* ones complement cksum of struct */
union {
+ union icmp6_error_body error_body;
struct icmp6_echo echo;
struct ndp_rs ndp_rs;
struct ndp_ra ndp_ra;
@@ -89,6 +96,7 @@ struct icmp6 {
struct ndp_na ndp_na;
struct ndp_redirect ndp_redirect;
} icmp6_body;
+#define icmp6_err icmp6_body.error_body
#define icmp6_echo icmp6_body.echo
#define icmp6_nrs icmp6_body.ndp_rs
#define icmp6_nra icmp6_body.ndp_ra
@@ -98,6 +106,7 @@ struct icmp6 {
} QEMU_PACKED;
#define ICMP6_MINLEN 4
+#define ICMP6_ERROR_MINLEN 8
#define ICMP6_ECHO_MINLEN 8
#define ICMP6_NDP_RS_MINLEN 8
#define ICMP6_NDP_RA_MINLEN 16
@@ -197,6 +206,7 @@ struct ndpopt {
void icmp6_init(Slirp *slirp);
void icmp6_cleanup(Slirp *slirp);
void icmp6_input(struct mbuf *);
+void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code);
void ndp_send_ra(Slirp *slirp);
void ndp_send_ns(Slirp *slirp, struct in6_addr addr);