Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
43644930
Commit
43644930
authored
10 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
ng_ethernet: intial import
parent
dab8f9f6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sys/include/net/ng_ethernet.h
+56
-0
56 additions, 0 deletions
sys/include/net/ng_ethernet.h
sys/include/net/ng_ethernet/hdr.h
+49
-0
49 additions, 0 deletions
sys/include/net/ng_ethernet/hdr.h
sys/include/net/ng_ethertype.h
+5
-4
5 additions, 4 deletions
sys/include/net/ng_ethertype.h
with
110 additions
and
4 deletions
sys/include/net/ng_ethernet.h
0 → 100644
+
56
−
0
View file @
43644930
/*
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
*
* 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_ethernet Ethernet
* @ingroup net
* @brief Ethernet implementation
* @{
*
* @file
* @brief Definitions for Ethernet
*
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#ifndef NG_ETHERNET_H_
#define NG_ETHERNET_H_
#include
"net/ng_ethernet/hdr.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#define NG_ETHERNET_DATA_LEN (1500)
/**< maximum number of bytes in payload */
#define NG_ETHERNET_FCS_LEN (4)
/**< number of bytes in the FCS
* (frame check sequence) */
/**
* @brief maximum number of bytes in an ethernet frame (without FCS)
*/
#define NG_ETHERNET_FRAME_LEN (NG_ETHERNET_DATA_LEN + \
sizeof(ng_ethernet_hdr_t))
#define NG_ETHERNET_MIN_LEN (64)
/**< minimum number of bytes in an
* ethernet frame (with FCF) */
/**
* @brief maximum number of bytes in an ethernet frame (with FCF)
*/
#define NG_ETHERNET_MAX_LEN (NG_ETHERNET_FRAME_LEN + \
NG_ETHERNET_FCS_LEN)
#ifdef __cplusplus
}
#endif
#endif
/* NG_ETHERNET_H_ */
/**
* @}
*/
This diff is collapsed.
Click to expand it.
sys/include/net/ng_ethernet/hdr.h
0 → 100644
+
49
−
0
View file @
43644930
/*
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
*
* 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_ethernet_hdr Ethernet header
* @ingroup net_ng_ethernet
* @brief Ethernet header
* @{
*
* @file
* @brief Ethernet header definitions
*
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#ifndef NG_ETHERNET_HDR_H_
#define NG_ETHERNET_HDR_H_
#include
<inttypes.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#define NG_ETHERNET_ADDR_LEN (6)
/**< Length of an Ethernet address */
/**
* @brief Ethernet header
*/
typedef
struct
__attribute__
((
packed
))
{
uint8_t
dst
[
NG_ETHERNET_ADDR_LEN
];
/**< destination address */
uint8_t
src
[
NG_ETHERNET_ADDR_LEN
];
/**< source address */
uint16_t
type
;
/**< ether type (see @ref net_ng_ethertype) */
}
ng_ethernet_hdr_t
;
#ifdef __cplusplus
}
#endif
#endif
/* NG_ETHERNET_HDR_H_ */
/**
* @}
*/
This diff is collapsed.
Click to expand it.
sys/include/net/ng_ethertype.h
+
5
−
4
View file @
43644930
...
...
@@ -7,7 +7,7 @@
*/
/**
* @defgroup net_ng_ethertype
* @defgroup net_ng_ethertype
Ether types
* @ingroup net
* @brief Ether types
* @see <a href="http://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml#ieee-802-numbers-1">
...
...
@@ -31,9 +31,10 @@ extern "C" {
#endif
/* expand at will ;-) */
#define NG_ETHERTYPE_IPV4 (0x0800)
/* Internet protocol version 4 */
#define NG_ETHERTYPE_ARP (0x0806)
/* Address resolution protocol */
#define NG_ETHERTYPE_IPV6 (0x86dd)
/* Internet protocol version 6 */
#define NG_ETHERTYPE_RESERVED (0x0000)
/**< Reserved */
#define NG_ETHERTYPE_IPV4 (0x0800)
/**< Internet protocol version 4 */
#define NG_ETHERTYPE_ARP (0x0806)
/**< Address resolution protocol */
#define NG_ETHERTYPE_IPV6 (0x86dd)
/**< Internet protocol version 6 */
#ifdef __cplusplus
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment