net/icmpv6: Remove various useless get/set hdr functions

All of these are unused anywhere now, thus can be safely removed.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2018-12-20 17:14:03 +01:00 committed by Jukka Rissanen
parent 14f3ae1152
commit ec16928d8b
2 changed files with 0 additions and 159 deletions

View file

@ -127,151 +127,6 @@ int net_icmpv6_finalize(struct net_pkt *pkt)
return net_pkt_set_data(pkt, &icmp_access);
}
int net_icmpv6_get_hdr(struct net_pkt *pkt, struct net_icmp_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
frag = net_frag_read(pkt->frags,
net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt),
&pos, sizeof(*hdr), (u8_t *)hdr);
if (pos > 0 && !frag) {
NET_ERR("Cannot get the ICMPv6 header");;
return -EINVAL;
}
return 0;
}
int net_icmpv6_set_hdr(struct net_pkt *pkt, struct net_icmp_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
frag = net_pkt_write(pkt, pkt->frags, net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt), &pos,
sizeof(*hdr), (u8_t *)hdr, PKT_WAIT_TIME);
if (pos > 0 && !frag) {
NET_ERR("Cannot set the ICMPv6 header");
return -EINVAL;
}
return 0;
}
int net_icmpv6_get_ns_hdr(struct net_pkt *pkt, struct net_icmpv6_ns_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
frag = net_frag_read(pkt->frags,
net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt) +
sizeof(struct net_icmp_hdr),
&pos, sizeof(*hdr), (u8_t *)hdr);
if (pos > 0 && !frag) {
NET_ERR("Cannot get the ICMPv6 NS header");;
return -EINVAL;
}
return 0;
}
int net_icmpv6_set_ns_hdr(struct net_pkt *pkt, struct net_icmpv6_ns_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
hdr->reserved = 0U;
frag = net_pkt_write(pkt, pkt->frags, net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt) +
sizeof(struct net_icmp_hdr), &pos,
sizeof(*hdr), (u8_t *)hdr, PKT_WAIT_TIME);
if (pos > 0 && !frag) {
NET_ERR("Cannot set the ICMPv6 NS header");
return -EINVAL;
}
return 0;
}
int net_icmpv6_get_nd_opt_hdr(struct net_pkt *pkt,
struct net_icmpv6_nd_opt_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
frag = net_frag_read(pkt->frags,
net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt) +
sizeof(struct net_icmp_hdr) +
net_pkt_ipv6_ext_opt_len(pkt),
&pos, sizeof(*hdr), (u8_t *)hdr);
if (pos > 0 && !frag) {
return -EINVAL;
}
return 0;
}
int net_icmpv6_get_na_hdr(struct net_pkt *pkt, struct net_icmpv6_na_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
frag = net_frag_read(pkt->frags, net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt) +
sizeof(struct net_icmp_hdr),
&pos, sizeof(*hdr), (u8_t *)hdr);
if (pos > 0 && !frag) {
NET_ERR("Cannot get the ICMPv6 NA header");
return -EINVAL;
}
return 0;
}
int net_icmpv6_set_na_hdr(struct net_pkt *pkt, struct net_icmpv6_na_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
(void)memset(hdr->reserved, 0, sizeof(hdr->reserved));
frag = net_pkt_write(pkt, pkt->frags,
net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt) +
sizeof(struct net_icmp_hdr),
&pos, sizeof(*hdr), (u8_t *)hdr,
PKT_WAIT_TIME);
if (!frag) {
NET_ERR("Cannot set the ICMPv6 NA header");
return -EINVAL;
}
return 0;
}
int net_icmpv6_get_ra_hdr(struct net_pkt *pkt, struct net_icmpv6_ra_hdr *hdr)
{
struct net_buf *frag;
u16_t pos;
frag = net_frag_read(pkt->frags, net_pkt_ip_hdr_len(pkt) +
net_pkt_ipv6_ext_len(pkt) +
sizeof(struct net_icmp_hdr),
&pos, sizeof(*hdr), (u8_t *)hdr);
if (pos > 0 && !frag) {
NET_ERR("Cannot get the ICMPv6 RA header");
return -EINVAL;
}
return 0;
}
int net_icmpv6_create(struct net_pkt *pkt, u8_t icmp_type, u8_t icmp_code)
{
NET_PKT_DATA_ACCESS_CONTIGUOUS_DEFINE(icmp_access,

View file

@ -183,24 +183,10 @@ void net_icmpv6_unregister_handler(struct net_icmpv6_handler *handler);
enum net_verdict net_icmpv6_input(struct net_pkt *pkt,
struct net_ipv6_hdr *ip_hdr);
int net_icmpv6_get_hdr(struct net_pkt *pkt, struct net_icmp_hdr *hdr);
int net_icmpv6_set_hdr(struct net_pkt *pkt, struct net_icmp_hdr *hdr);
int net_icmpv6_set_chksum(struct net_pkt *pkt);
int net_icmpv6_create(struct net_pkt *pkt, u8_t icmp_type, u8_t icmp_code);
int net_icmpv6_finalize(struct net_pkt *pkt);
int net_icmpv6_get_ns_hdr(struct net_pkt *pkt, struct net_icmpv6_ns_hdr *hdr);
int net_icmpv6_set_ns_hdr(struct net_pkt *pkt, struct net_icmpv6_ns_hdr *hdr);
int net_icmpv6_get_nd_opt_hdr(struct net_pkt *pkt,
struct net_icmpv6_nd_opt_hdr *hdr);
int net_icmpv6_get_na_hdr(struct net_pkt *pkt, struct net_icmpv6_na_hdr *hdr);
int net_icmpv6_set_na_hdr(struct net_pkt *pkt, struct net_icmpv6_na_hdr *hdr);
int net_icmpv6_get_ra_hdr(struct net_pkt *pkt, struct net_icmpv6_ra_hdr *hdr);
#if defined(CONFIG_NET_IPV6)
void net_icmpv6_init(void);
#else