<commit_before>/*
 * Copyright (C) 2015 Freie Universität Berlin
 *
 * 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_ng_netif_hdr Generic network interface header
 * @ingroup     net_ng_netif
 * @{
 *
 * @file
 * @brief       Generic network interface header
 *
 * @author      <NAME> <hauke.petersen@fu-berlin.de>
 * @author      <NAME> <mlenders@inf.fu-berlin.de>
 */

#ifndef NETIF_HDR_H_
#define NETIF_HDR_H_

#include <string.h>
#include <stdint.h>

#include "kernel.h"
#include "net/ng_pkt.h"
#include "net/ng_pktbuf.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief   Maximum length of the l2 addresses of the generic interface header
 *          in bytes.
 */
#define NG_NETIF_HDR_L2ADDR_MAX_LEN     (8)

/**
 * @{
 * @name    Flags for the ng_netif_hdr_t
 */
/**
 * @brief   Send packet broadcast.
 *
 * @details Packets with this flag set must be send broadcast.
 *          ng_netif_hdr_t::dst_l2addr_len and any appended destination
 *          address must be ignored.
 *          If the link layer does not support broadcast the packet must be
 *          dropped silently.
 */
#define NG_NETIF_HDR_FLAGS_BROADCAST    (0x80)

/**
 * @brief   Send packet multicast.
 *
 * @details Packets with this flag set must be send multicast.
 *          ng_netif_hdr_t::dst_l2addr_len and any appended destination
 *          address must be ignored.
 *          The context for the multicast address must be derived from the
 *          network layer destination address.
 *          If the link layer does not support multicast it should interpret
 *          this flag the same way it does @ref NG_NETIF_HDR_FLAGS_BROADCAST.
 */
#define NG_NETIF_HDR_FLAGS_MULTICAST    (0x40)
/**
 * @}
 */

/**
 * @brief   Generic network interface header
 *
 * The link layer addresses included in this header are put in memory directly
 * following this struct.
 */
typedef struct __attribute__((packed)) {
    uint8_t src_l2addr_len;     /**< length of l2 source address in byte */
    uint8_t dst_l2addr_len;     /**< length of l2 destination address in byte */<commit_msg>ng_netif_hdr: remove packed attribute from ng_netif_hdr_t<commit_after>/*
 * Copyright (C) 2015 Freie Universität Berlin
 *
 * 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_ng_netif_hdr Generic network interface header
 * @ingroup     net_ng_netif
 * @{
 *
 * @file
 * @brief       Generic network interface header
 *
 * @author      <NAME> <hauke.petersen@fu-berlin.de>
 * @author      <NAME> <mlenders@inf.fu-berlin.de>
 */

#ifndef NETIF_HDR_H_
#define NETIF_HDR_H_

#include <string.h>
#include <stdint.h>

#include "kernel.h"
#include "net/ng_pkt.h"
#include "net/ng_pktbuf.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief   Maximum length of the l2 addresses of the generic interface header
 *          in bytes.
 */
#define NG_NETIF_HDR_L2ADDR_MAX_LEN     (8)

/**
 * @{
 * @name    Flags for the ng_netif_hdr_t
 */
/**
 * @brief   Send packet broadcast.
 *
 * @details Packets with this flag set must be send broadcast.
 *          ng_netif_hdr_t::dst_l2addr_len and any appended destination
 *          address must be ignored.
 *          If the link layer does not support broadcast the packet must be
 *          dropped silently.
 */
#define NG_NETIF_HDR_FLAGS_BROADCAST    (0x80)

/**
 * @brief   Send packet multicast.
 *
 * @details Packets with this flag set must be send multicast.
 *          ng_netif_hdr_t::dst_l2addr_len and any appended destination
 *          address must be ignored.
 *          The context for the multicast address must be derived from the
 *          network layer destination address.
 *          If the link layer does not support multicast it should interpret
 *          this flag the same way it does @ref NG_NETIF_HDR_FLAGS_BROADCAST.
 */
#define NG_NETIF_HDR_FLAGS_MULTICAST    (0x40)
/**
 * @}
 */

/**
 * @brief   Generic network interface header
 *
 * The link layer addresses included in this header are put in memory directly
 * following this struct.
 */
typedef struct {
    uint8_t src_l2addr_len;     /**< length of l2 source address in byte */
    uint8_t dst_l2addr_len;     /**< length of l2 destination address in byte */
{'fraction_non_alphanumeric': 0.0860912343470483, 'fraction_numerical': 0.010286225402504472, 'mean_word_length': 2.94792586054722, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5501360', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1410, 'n_words': 484}