7#include <osmocom/core/msgb.h>
8#include <osmocom/core/endian.h>
10#define ICMPv6_OPT_TYPE_PREFIX_INFO 0x03
16} __attribute__ ((packed));
23} __attribute__ ((packed));
30} __attribute__ ((packed));
36#if OSMO_IS_LITTLE_ENDIAN
40#elif OSMO_IS_BIG_ENDIAN
42 uint8_t o:1, m:1, res:6;
44 uint16_t router_lifetime;
45 uint32_t reachable_time;
46 uint32_t retrans_timer;
48} __attribute__ ((packed));
57} __attribute__ ((packed));
63#if OSMO_IS_LITTLE_ENDIAN
67#elif OSMO_IS_BIG_ENDIAN
69 uint8_t l:1, a:1, res:6;
71 uint32_t valid_lifetime;
72 uint32_t preferred_lifetime;
75} __attribute__ ((packed));
82} __attribute__ ((packed));
84uint16_t osmo_icmpv6_prepend_ip6hdr(
struct msgb *msg,
const struct in6_addr *saddr,
85 const struct in6_addr *daddr);
87struct msgb *osmo_icmpv6_construct_rs(
const struct in6_addr *saddr);
88struct msgb *osmo_icmpv6_construct_ra(
const struct in6_addr *saddr,
89 const struct in6_addr *daddr,
90 const struct in6_addr *prefix,
93bool osmo_icmpv6_validate_router_solicit(
const uint8_t *pack,
unsigned len);
96#define foreach_icmpv6_opt(icmpv6_pkt, icmpv6_len, opt_hdr) \
97 for (opt_hdr = (struct osmo_icmpv6_opt_hdr *)(icmpv6_pkt)->options; \
98 (uint8_t *)(opt_hdr) + sizeof(struct osmo_icmpv6_opt_hdr) <= (((uint8_t *)(icmpv6_pkt)) + (icmpv6_len)); \
99 opt_hdr = (struct osmo_icmpv6_opt_hdr *)((uint8_t *)(opt_hdr) + (opt_hdr)->len) \
103extern const struct in6_addr osmo_icmpv6_all_router_mcast_addr;
105extern const uint8_t osmo_icmpv6_solicited_node_mcast_addr_prefix[13];