From ed56af079af772aa66867bc1065e02a4647cfb66 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 6 Jul 2014 11:14:24 -0600 Subject: [PATCH] Updated comments --- include/nuttx/net/ip.h | 37 ++++++++++++------------------------- include/nuttx/net/net.h | 2 +- include/nuttx/net/netdev.h | 4 ++-- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/include/nuttx/net/ip.h b/include/nuttx/net/ip.h index f31768e867..2012150a3a 100644 --- a/include/nuttx/net/ip.h +++ b/include/nuttx/net/ip.h @@ -136,19 +136,7 @@ struct net_iphdr_s * Public Function Prototypes ****************************************************************************/ -/* uIP application functions - * - * Functions used by an application running of top of uIP. This includes - * functions for opening and closing connections, sending and receiving - * data, etc. - */ - -/* uIP convenience and converting functions. - * - * These functions can be used for converting between different data - * formats used by uIP. - * - * Construct an IP address from four bytes. +/* Construct an IPv4 address from four bytes. * * This function constructs an IPv4 address in network byte order. * @@ -174,7 +162,9 @@ struct net_iphdr_s # define net_ip4addr_conv32(addr) (((in_addr_t)((uint16_t*)addr)[1] << 16) | (in_addr_t)((uint16_t*)addr)[0]) #endif -/* Extract individual bytes from a 32-bit IPv4 IP address that is in network byte order */ +/* Extract individual bytes from a 32-bit IPv4 IP address that is in network + * byte order. + */ #ifdef CONFIG_ENDIAN_BIG /* Big-endian byte order: 11223344 */ @@ -209,9 +199,7 @@ struct net_iphdr_s ((uint16_t*)(addr))[7] = HTONS((addr7)); \ } while (0) -/* Copy an IP address to another IP address. - * - * Copies an IP address from one place to another. +/* Copy an IP address from one place to another. * * Example: * @@ -267,14 +255,15 @@ struct net_iphdr_s net_ipaddr_cmp(addr, addr2) #endif /* !CONFIG_NET_IPv6 */ -/* Compare two IP addresses with netmasks - * - * Compares two IP addresses with netmasks. The masks are used to mask - * out the bits that are to be compared. +/* Compare two IP addresses under a netmask. The mask is used to mask + * out the bits that are to be compared: Buts within the mask much + * match exactly; bits outside if the mask are ignored. * * Example: * - * net_ipaddr_t ipaddr1, ipaddr2, mask; + * net_ipaddr_t ipaddr1; + * net_ipaddr_t ipaddr2; + * net_ipaddr_t mask; * * net_ipaddr(&mask, 255,255,255,0); * net_ipaddr(&ipaddr1, 192,16,1,2); @@ -298,9 +287,7 @@ bool net_ipaddr_maskcmp(net_ipaddr_t addr1, net_ipaddr_t addr2, net_ipaddr_t mask); #endif -/* Mask out the network part of an IP address. - * - * Masks out the network part of an IP address, given the address and +/* Mask out the network part of an IP address, given the address and * the netmask. * * Example: diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index e2c465a214..e3cbc73bce 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -219,7 +219,7 @@ void net_initialize(void); void net_initlist(FAR struct socketlist *list); void net_releaselist(FAR struct socketlist *list); -/* Given a socket descriptor, return the underly NuttX-specific socket +/* Given a socket descriptor, return the underlying NuttX-specific socket * structure. */ diff --git a/include/nuttx/net/netdev.h b/include/nuttx/net/netdev.h index 41d9888b71..6eb06ca5a3 100644 --- a/include/nuttx/net/netdev.h +++ b/include/nuttx/net/netdev.h @@ -333,8 +333,8 @@ int devif_timer(struct net_driver_s *dev, devif_poll_callback_t callback, int hs * Call netdev_carrier_on when the carrier has become available and the device * is ready to receive/transmit packets. * - * Call detdev_carrier_off when the carrier disappeared and the device has moved - * into non operational state. + * Call detdev_carrier_off when the carrier disappeared and the device has + * moved into non operational state. * ****************************************************************************/