summaryrefslogtreecommitdiff
path: root/net/ping.c
Commit message (Collapse)AuthorAgeLines
* net: Allow filtering on debug traces in the net subsystemJoe Hershberger2012-05-23-2/+2
| | | | | | | | | | | | Add several levels of DEBUG prints so that you can limit the noise to the severety of your problem. DEBUG_LL_STATE = Link local state machine changes DEBUG_DEV_PKT = Packets or info directed to the device DEBUG_NET_PKT = Packets on info on the network at large DEBUG_INT_STATE = Internal network state changes Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: Don't copy every packet that waits for an ARPJoe Hershberger2012-05-23-3/+2
| | | | | | | | | Use the NetArpTxPacket for the ARP packet, not to hold what used to be in NetTxPacket. This saves a copy and makes the code easier to understand. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: Remove static allocation for MAC address in PingSend()Joe Hershberger2012-05-23-7/+3
| | | | | | | | Don't force ARP clients to return the MAC address if they don't care (such as ping) Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: Add net_update_ether() to handle ARP and Ping repliesJoe Hershberger2012-05-23-5/+5
| | | | | | | | | When the network is VLAN or SNAP, net_update_ether() will preserve the original Ethernet packet header and simply replace the src and dest MACs and the protocol Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: Refactor to protect access to the NetState variableJoe Hershberger2012-05-23-2/+2
| | | | | | | Changes to NetState now go through an accessor function called net_set_state() Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: Refactor to use NetSendPacket instead of eth_send directlyJoe Hershberger2012-05-23-2/+1
| | | | | | | | Use this entry-point consistently across the net/ code Use a static inline function to preserve code size Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: Refactor ping receive handlerJoe Hershberger2012-05-23-16/+2
| | | | | | | | There is no need to call through the handler... inline it Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: Refactor packet length computationsJoe Hershberger2012-05-23-3/+4
| | | | | | | | | Save the length when it is computed instead of forgetting it and subtracting pointers to figure it out again. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: Refactor IP, UPD, and ICMP header writing functionsJoe Hershberger2012-05-23-29/+23
| | | | | | | | ICMP (ping) was reimplementing IP header code... it now shares code. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: cosmetic: Un-typedef ICMP_tJoe Hershberger2012-05-23-1/+1
| | | | | | Remove typedef and lower-case name Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: cosmetic: Un-typedef Ethernet_tJoe Hershberger2012-05-23-1/+1
| | | | | | | Separate the Ethernet header from the 802 header. Base the size constants on the structs. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: cosmetic: Split struct ip_udp_hdr into ip_hdrJoe Hershberger2012-05-23-5/+5
| | | | | | | | Add a structure that only contains IP header fields to be used by functions that don't need UDP Rename IP_HDR_SIZE_NO_UDP to IP_HDR_SIZE Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: cosmetic: Un-typedef IP_tJoe Hershberger2012-05-23-3/+3
| | | | | | | | Rename IP header related things to IP_UDP. The existing definition of IP_t includes UDP header, so name it to accurately describe the structure. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: Move PING out of net.cJoe Hershberger2012-05-23-0/+140
Separate this functionality out of the net.c behemoth Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>