[pisa-src] r2517 - trunk/tools/dhcp/mac2ip.c

  • From: Christoph Viethen <christoph.viethen@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Tue, 5 Apr 2011 02:56:01 +0200

Author: viethen
Date: Tue Apr  5 02:56:01 2011
New Revision: 2517

Log:
clean up / clarify the comments a little; add one

Modified:
   trunk/tools/dhcp/mac2ip.c

Modified: trunk/tools/dhcp/mac2ip.c
==============================================================================
--- trunk/tools/dhcp/mac2ip.c   Tue Apr  5 02:37:39 2011        (r2516)
+++ trunk/tools/dhcp/mac2ip.c   Tue Apr  5 02:56:01 2011        (r2517)
@@ -1,7 +1,7 @@
 /**
- * This Code calculates IPv4s based on Ethernet-addresses
+ * This code calculates IPv4s based on Ethernet addresses
  *
- * Author: Max Gelmroth
+ * Original author: Max Gelmroth
  *
  */
 
@@ -74,7 +74,8 @@
     ip->x[0] =  hash & 0x000000ff;
 }
 
-/* converts mac in hex_string_format to mac_t */
+/* converts IPv4 address in the common dotted-quad notation to ipv4_t */
+/* returns -1 in case s.th. goes wrong, otherwise 0 */
 static int string_to_ipv4_t(const char *string, mac2ip_ipv4_t *ip)
 {
     if (sscanf(string, "%" SCNu8 ".%" SCNu8 ".%" SCNu8 ".%" SCNu8, &ip->x[0], 
&ip->x[1], &ip->x[2], &ip->x[3]) == 4) {
@@ -259,7 +260,8 @@
 {
     ip_bounds bounds;
 
-
+    /* call the hash function that will return an IP address
+     *  somewhere out of the space of all IPv4 addresses */
     hash_mac_to_rnd_ip_OAAT(mac, ip);
 
     /* we want to read at least 4 IPs */
-- 
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts: