Blame view

RIOT/sys/include/net/gnrc/sixlowpan/frag.h 2.09 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  /*
   * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
   * Copyright (C) 2015 Hamburg University of Applied Sciences
   *
   * This file is subject to the terms and conditions of the GNU Lesser
   * General Public License v2.1. See the file LICENSE in the top level
   * directory for more details.
   */
  
  /**
   * @defgroup    net_gnrc_sixlowpan_frag   6LoWPAN Fragmentation
   * @ingroup     net_gnrc_sixlowpan
   * @brief       6LoWPAN Fragmentation headers and functionality
   * @see <a href="https://tools.ietf.org/html/rfc4944#section-5.3">
   *          RFC 4944, section 5.3
   *      </a>
   * @{
   *
   * @file
   * @brief   6LoWPAN Fragmentation definitions
   *
   * @author  Martine Lenders <mlenders@inf.fu-berlin.de>
   * @author  Peter Kietzmann <peter.kietzmann@haw-hamburg.de>
   */
  #ifndef NET_GNRC_SIXLOWPAN_FRAG_H
  #define NET_GNRC_SIXLOWPAN_FRAG_H
  
  #include <inttypes.h>
  #include <stdbool.h>
  
  #include "byteorder.h"
  #include "kernel_types.h"
  #include "net/gnrc/pkt.h"
  #include "net/sixlowpan.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @brief   Message type for passing one 6LoWPAN fragment down the network stack
   */
  #define GNRC_SIXLOWPAN_MSG_FRAG_SND    (0x0225)
  
  /**
   * @brief   Definition of 6LoWPAN fragmentation type.
   */
  typedef struct {
      kernel_pid_t pid;       /**< PID of the interface */
      gnrc_pktsnip_t *pkt;    /**< Pointer to the IPv6 packet to be fragmented */
      size_t datagram_size;   /**< Length of just the IPv6 packet to be fragmented */
      uint16_t offset;        /**< Offset of the Nth fragment from the beginning of the
                               *   payload datagram */
  } gnrc_sixlowpan_msg_frag_t;
  
  /**
   * @brief   Sends a packet fragmented.
   *
   * @param[in] fragment_msg    Message containing status of the 6LoWPAN
   *                            fragmentation progress
   */
  void gnrc_sixlowpan_frag_send(gnrc_sixlowpan_msg_frag_t *fragment_msg);
  
  /**
   * @brief   Handles a packet containing a fragment header.
   *
   * @param[in] pkt   The packet to handle.
   */
  void gnrc_sixlowpan_frag_handle_pkt(gnrc_pktsnip_t *pkt);
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* NET_GNRC_SIXLOWPAN_FRAG_H */
  /** @} */