blob: 2ee20bf944733302b66ca01988b720682f68a713 [file] [log] [blame]
// Copyright 2016 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef __NET_IPV6_INET6_H__
#define __NET_IPV6_INET6_H__
#include "drivers/net/net.h"
#include "net/ethernet.h"
#include "net/ipv6/ipv6.h"
// provided by inet6.c
void ipv6_init(NetDevice *dev);
int eth_recv(NetDevice *dev, void *data, size_t len);
// provided by interface driver
int eth_add_mcast_filter(NetDevice *dev, const MacAddress *addr);
// call to transmit a UDP packet
int udpv6_send(Ipv6UdpCon *con, const void *data, size_t len);
// implement to recive UDP packets
void udpv6_recv(void *data, size_t len,
const Ipv6Address *daddr, uint16_t dport,
const Ipv6Address *saddr, uint16_t sport);
// NOTES
//
// This is an extremely minimal IPv6 stack, supporting just enough
// functionality to talk to link local hosts over UDP.
//
// It responds to ICMPv6 Neighbor Solicitations for its link local
// address, which is computed from the mac address provided by the
// ethernet interface driver.
//
// It responds to PINGs.
//
// It can only transmit to multicast addresses or to the address it
// last received a packet from (general usecase is to reply to a UDP
// packet from the UDP callback, which this supports)
//
// It does not currently do duplicate address detection, which is
// probably the most severe bug.
//
// It does not support any IPv6 options and will drop packets with
// options.
//
// It expects the network stack to provide transmit buffer allocation
// and free functionality. It will allocate a single transmit buffer
// from udp6_send() or icmp6_send() to fill out and either pass to the
// network stack via eth_send() or, in the event of an error, release
// via eth_put_buffer().
//
#endif /* __NET_IPV6_INET6_H__ */