net/ip: Let's make public the 2 utility unions for ip/proto headers

Though these are currently used by the core only, it will be then used
by net_context as well. This one of the steps to get rid of net_pkt's
appdata/appdatalen attributes.

Also normalizing all ip/proto parameters name to ip_hdr and proto_hdr.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2019-01-30 10:07:10 +01:00 committed by Jukka Rissanen
commit e4ebe486b8
12 changed files with 86 additions and 75 deletions

View file

@ -312,6 +312,20 @@ struct net_tcp_hdr {
u8_t optdata[0];
} __packed;
/**
* This 2 unions are here temporarly, as long as net_context.h will
* be still public and not part of the core only.
*/
union net_ip_header {
struct net_ipv4_hdr *ipv4;
struct net_ipv6_hdr *ipv6;
};
union net_proto_header {
struct net_udp_hdr *udp;
struct net_tcp_hdr *tcp;
};
#define NET_UDPH_LEN 8 /* Size of UDP header */
#define NET_TCPH_LEN 20 /* Size of TCP header */
#define NET_ICMPH_LEN 4 /* Size of ICMP header */