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
74722888
Commit
74722888
authored
9 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
gnrc_netif_hdr: un-inline build function
parent
ad7071d2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sys/include/net/gnrc/netif/hdr.h
+1
-23
1 addition, 23 deletions
sys/include/net/gnrc/netif/hdr.h
sys/net/gnrc/netif/hdr/gnrc_netif_hdr.c
+41
-0
41 additions, 0 deletions
sys/net/gnrc/netif/hdr/gnrc_netif_hdr.c
with
42 additions
and
23 deletions
sys/include/net/gnrc/netif/hdr.h
+
1
−
23
View file @
74722888
...
@@ -190,29 +190,7 @@ static inline void gnrc_netif_hdr_set_dst_addr(gnrc_netif_hdr_t *hdr, uint8_t *a
...
@@ -190,29 +190,7 @@ static inline void gnrc_netif_hdr_set_dst_addr(gnrc_netif_hdr_t *hdr, uint8_t *a
* @return The generic network layer header on success.
* @return The generic network layer header on success.
* @return NULL on error.
* @return NULL on error.
*/
*/
static
inline
gnrc_pktsnip_t
*
gnrc_netif_hdr_build
(
uint8_t
*
src
,
uint8_t
src_len
,
gnrc_pktsnip_t
*
gnrc_netif_hdr_build
(
uint8_t
*
src
,
uint8_t
src_len
,
uint8_t
*
dst
,
uint8_t
dst_len
);
uint8_t
*
dst
,
uint8_t
dst_len
)
{
gnrc_pktsnip_t
*
pkt
=
gnrc_pktbuf_add
(
NULL
,
NULL
,
sizeof
(
gnrc_netif_hdr_t
)
+
src_len
+
dst_len
,
GNRC_NETTYPE_NETIF
);
if
(
pkt
==
NULL
)
{
return
NULL
;
}
gnrc_netif_hdr_init
(
pkt
->
data
,
src_len
,
dst_len
);
if
(
src
!=
NULL
&&
src_len
>
0
)
{
gnrc_netif_hdr_set_src_addr
(
pkt
->
data
,
src
,
src_len
);
}
if
(
dst
!=
NULL
&&
dst_len
>
0
)
{
gnrc_netif_hdr_set_dst_addr
(
pkt
->
data
,
dst
,
dst_len
);
}
return
pkt
;
}
/**
/**
* @brief Outputs a generic interface header to stdout.
* @brief Outputs a generic interface header to stdout.
...
...
This diff is collapsed.
Click to expand it.
sys/net/gnrc/netif/hdr/gnrc_netif_hdr.c
0 → 100644
+
41
−
0
View file @
74722888
/*
* 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.
*/
/**
* @{
*
* @file
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#include
"net/gnrc/netif/hdr.h"
gnrc_pktsnip_t
*
gnrc_netif_hdr_build
(
uint8_t
*
src
,
uint8_t
src_len
,
uint8_t
*
dst
,
uint8_t
dst_len
)
{
gnrc_pktsnip_t
*
pkt
=
gnrc_pktbuf_add
(
NULL
,
NULL
,
sizeof
(
gnrc_netif_hdr_t
)
+
src_len
+
dst_len
,
GNRC_NETTYPE_NETIF
);
if
(
pkt
==
NULL
)
{
return
NULL
;
}
gnrc_netif_hdr_init
(
pkt
->
data
,
src_len
,
dst_len
);
if
(
src
!=
NULL
&&
src_len
>
0
)
{
gnrc_netif_hdr_set_src_addr
(
pkt
->
data
,
src
,
src_len
);
}
if
(
dst
!=
NULL
&&
dst_len
>
0
)
{
gnrc_netif_hdr_set_dst_addr
(
pkt
->
data
,
dst
,
dst_len
);
}
return
pkt
;
}
/** @} */
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