aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-04-14 19:39:09 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-04-21 16:40:39 +0200
commit962146085cc161c5c3b21273297e4675ad035a1b (patch)
treefb1114b48e220818f70cbfd6d9879bdc652cc4bb /lib
parente2b0961f18c1ba9204013b831797ad94604352ef (diff)
sgsnemu: Implement ping on IPv6 APNs
Diffstat (limited to 'lib')
-rw-r--r--lib/icmpv6.c2
-rw-r--r--lib/icmpv6.h10
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/icmpv6.c b/lib/icmpv6.c
index 1bddf65..ac1474d 100644
--- a/lib/icmpv6.c
+++ b/lib/icmpv6.c
@@ -42,7 +42,7 @@ const struct in6_addr all_router_mcast_addr = {
};
/* Prepends the ipv6 header and returns checksum content */
-static uint16_t icmpv6_prepend_ip6hdr(struct msgb *msg, const struct in6_addr *saddr,
+uint16_t icmpv6_prepend_ip6hdr(struct msgb *msg, const struct in6_addr *saddr,
const struct in6_addr *daddr)
{
uint32_t len;
diff --git a/lib/icmpv6.h b/lib/icmpv6.h
index 44b9b73..4b4dc37 100644
--- a/lib/icmpv6.h
+++ b/lib/icmpv6.h
@@ -22,6 +22,13 @@ struct icmpv6_hdr {
uint16_t csum;
} __attribute__ ((packed));
+struct icmpv6_echo_hdr {
+ struct icmpv6_hdr hdr;
+ uint16_t ident; /* Identifier */
+ uint16_t seq; /* Sequence number */
+ uint8_t data[0]; /* Data */
+} __attribute__ ((packed));
+
/* RFC4861 Section 4.1 */
struct icmpv6_rsol_hdr {
struct icmpv6_hdr hdr;
@@ -76,6 +83,9 @@ struct icmpv6_opt_prefix {
uint8_t prefix[16];
} __attribute__ ((packed));
+uint16_t icmpv6_prepend_ip6hdr(struct msgb *msg, const struct in6_addr *saddr,
+ const struct in6_addr *daddr);
+
struct msgb *icmpv6_construct_rs(const struct in6_addr *saddr);
int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp,