You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/10/02 16:40:07 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #416: ipcfg: Add hooks for future IPv6 support.

xiaoxiang781216 commented on a change in pull request #416:
URL: https://github.com/apache/incubator-nuttx-apps/pull/416#discussion_r498930412



##########
File path: include/fsutils/ipcfg.h
##########
@@ -137,7 +227,8 @@ int ipcfg_read(FAR const char *netdev, FAR struct ipcfg_s *ipcfg);
  ****************************************************************************/
 
 #ifdef CONFIG_IPCFG_WRITABLE
-int ipcfg_write(FAR const char *netdev, FAR const struct ipcfg_s *ipcfg);
+int ipcfg_write(FAR const char *netdev, FAR const struct ipcfg_s *ipcfg,
+                sa_family_t af);

Review comment:
       If ipcfg_s already contain type field, why the call stll have to pass af argument?

##########
File path: include/fsutils/ipcfg.h
##########
@@ -31,23 +31,35 @@
  * Public Types
  ****************************************************************************/
 
-/* Values for the BOOTPROTO setting */
+/* Values for the record type field */
 
-enum ipcfg_bootproto_e
+enum ipcfg_iptype_e
 {
-  BOOTPROTO_NONE     = 0, /* No protocol assigned */
-  BOOTPROTO_STATIC   = 1, /* Use static IP */
-  BOOTPROTO_DHCP     = 2, /* Use DHCP */
-  BOOTPROTO_FALLBACK = 3  /* Use DHCP with fall back static IP */
+  IPTYPE_IPv4        = 0, /* IPv4 configuration */
+  IPTYPE_IPv6        = 1  /* IPv6 configuration */
+};
+
+/* Generic IP Configuration record header.  Must be cast compatible with
+ * both struct ipv4cfg_s and struct ipv6cfg_s
+ */
+
+struct ipcfg_s
+{
+  uint8_t next;                 /* Offset to the next IP configuration record */

Review comment:
       Who is responsible to initialize next field in the read or write case? I don't see there is the code to reference this filed in ipcfg_read/ipcfg_write.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org