zephyr/subsys/net/ip/6lo.h
Tomasz Bursztyka db11fcd174 net/net_pkt: Fully separate struct net_pkt from struct net_buf
- net_pkt becomes a stand-alone structure with network packet meta
  information.
- network packet data is still managed through net_buf, mostly named
  'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
  or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
  memory when TCP is enabled.

Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00

66 lines
1.7 KiB
C

/** @file
@brief 6lowpan handler
This is not to be included by the application.
*/
/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __NET_6LO_H
#define __NET_6LO_H
#include <misc/slist.h>
#include <zephyr/types.h>
#include <net/net_pkt.h>
#include "icmpv6.h"
typedef bool (*fragment_handler_t)(struct net_pkt *, int);
/**
* @brief Compress IPv6 packet as per RFC 6282
*
* @details After this IPv6 packet and next header(if UDP), headers
* are compressed as per RFC 6282. After header compression data
* will be adjusted according to remaining space in fragments.
*
* @param Pointer to network packet
* @param iphc true for IPHC compression, false for IPv6 dispatch header
* @param Pointer to fragment function
*
* @return True on success, false otherwise
*/
bool net_6lo_compress(struct net_pkt *pkt, bool iphc,
fragment_handler_t fragment);
/**
* @brief Uncompress IPv6 packet as per RFC 6282
*
* @details After this IPv6 packet and next header(if UDP), headers
* are uncompressed as per RFC 6282. After header uncompression data
* will be adjusted according to remaining space in fragments.
*
* @param Pointer to network packet
*
* @return True on success, false otherwise
*/
bool net_6lo_uncompress(struct net_pkt *pkt);
/**
* @brief Set 6lowpan context information
*
* @details Set 6lowpan context information. This context information
* will be used in IPv6 header compression and uncompression.
*
* @return True on success, false otherwise
*/
#if defined(CONFIG_NET_6LO_CONTEXT)
void net_6lo_set_context(struct net_if *iface,
struct net_icmpv6_nd_opt_6co *context);
#endif
#endif /* __NET_6LO_H */