Skip to content
Permalink
Browse files

net: shell: Indentation fixes for ping command

Fix the indentation of code for the ping command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed May 21, 2019
1 parent ba4eae1 commit 29b55f860ecd3318604ae396c9a703391bf633df
Showing with 23 additions and 19 deletions.
  1. +23 −19 subsys/net/ip/net_shell.c
@@ -2657,15 +2657,16 @@ static inline void remove_ipv6_ping_handler(void)
}

static enum net_verdict handle_ipv6_echo_reply(struct net_pkt *pkt,
struct net_ipv6_hdr *ip_hdr,
struct net_icmp_hdr *icmp_hdr)
struct net_ipv6_hdr *ip_hdr,
struct net_icmp_hdr *icmp_hdr)
{
NET_PKT_DATA_ACCESS_CONTIGUOUS_DEFINE(icmp_access,
struct net_icmpv6_echo_req);
u32_t cycles;
struct net_icmpv6_echo_req *icmp_echo;
u32_t cycles;

icmp_echo = (struct net_icmpv6_echo_req *)net_pkt_get_data(pkt, &icmp_access);
icmp_echo = (struct net_icmpv6_echo_req *)net_pkt_get_data(pkt,
&icmp_access);
if (icmp_echo == NULL) {
return -NET_DROP;
}
@@ -2686,7 +2687,8 @@ static enum net_verdict handle_ipv6_echo_reply(struct net_pkt *pkt,
#else
"time=%d ms\n",
#endif
ntohs(ip_hdr->len) - net_pkt_ipv6_ext_len(pkt) - NET_ICMPH_LEN,
ntohs(ip_hdr->len) - net_pkt_ipv6_ext_len(pkt) -
NET_ICMPH_LEN,
net_sprint_ipv6_addr(&ip_hdr->src),
net_sprint_ipv6_addr(&ip_hdr->dst),
ntohs(icmp_echo->sequence),
@@ -2706,14 +2708,14 @@ static enum net_verdict handle_ipv6_echo_reply(struct net_pkt *pkt,
}

static int ping_ipv6(const struct shell *shell,
char *host,
unsigned int count,
unsigned int interval)
char *host,
unsigned int count,
unsigned int interval)
{
struct in6_addr ipv6_target;
struct net_if *iface = net_if_get_default();
struct net_nbr *nbr;
int ret = 0;
struct in6_addr ipv6_target;
struct net_nbr *nbr;

#if defined(CONFIG_NET_ROUTE)
struct net_route_entry *route;
@@ -2767,8 +2769,8 @@ static int ping_ipv6(const struct shell *shell,
#if defined(CONFIG_NET_IPV4)

static enum net_verdict handle_ipv4_echo_reply(struct net_pkt *pkt,
struct net_ipv4_hdr *ip_hdr,
struct net_icmp_hdr *icmp_hdr);
struct net_ipv4_hdr *ip_hdr,
struct net_icmp_hdr *icmp_hdr);

static struct net_icmpv4_handler ping4_handler = {
.type = NET_ICMPV4_ECHO_REPLY,
@@ -2782,15 +2784,16 @@ static inline void remove_ipv4_ping_handler(void)
}

static enum net_verdict handle_ipv4_echo_reply(struct net_pkt *pkt,
struct net_ipv4_hdr *ip_hdr,
struct net_icmp_hdr *icmp_hdr)
struct net_ipv4_hdr *ip_hdr,
struct net_icmp_hdr *icmp_hdr)
{
NET_PKT_DATA_ACCESS_CONTIGUOUS_DEFINE(icmp_access,
struct net_icmpv4_echo_req);
u32_t cycles;
struct net_icmpv4_echo_req *icmp_echo;

icmp_echo = (struct net_icmpv4_echo_req *)net_pkt_get_data(pkt, &icmp_access);
icmp_echo = (struct net_icmpv4_echo_req *)net_pkt_get_data(pkt,
&icmp_access);
if (icmp_echo == NULL) {
return -NET_DROP;
}
@@ -2808,7 +2811,8 @@ static enum net_verdict handle_ipv4_echo_reply(struct net_pkt *pkt,
#else
"time=%d ms\n",
#endif
ntohs(ip_hdr->len) - net_pkt_ipv6_ext_len(pkt) - NET_ICMPH_LEN,
ntohs(ip_hdr->len) - net_pkt_ipv6_ext_len(pkt) -
NET_ICMPH_LEN,
net_sprint_ipv4_addr(&ip_hdr->src),
net_sprint_ipv4_addr(&ip_hdr->dst),
ntohs(icmp_echo->sequence),
@@ -2825,9 +2829,9 @@ static enum net_verdict handle_ipv4_echo_reply(struct net_pkt *pkt,
}

static int ping_ipv4(const struct shell *shell,
char *host,
unsigned int count,
unsigned int interval)
char *host,
unsigned int count,
unsigned int interval)
{
struct in_addr ipv4_target;
int ret = 0;

0 comments on commit 29b55f8

Please sign in to comment.
You can’t perform that action at this time.