Browse Source

[settings] Merge SETTING_IPv4 and SETTING_IPv6

Allow for equivalent IPv4 and IPv6 settings (which requires equivalent
settings to be adjacent within the settings list).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
f3e5df3162
4 changed files with 23 additions and 25 deletions
  1. 1
    1
      src/core/settings.c
  2. 17
    19
      src/include/ipxe/settings.h
  3. 3
    3
      src/net/ipv4.c
  4. 2
    2
      src/net/udp/dns.c

+ 1
- 1
src/core/settings.c View File

@@ -2346,7 +2346,7 @@ const struct setting hostname_setting __setting ( SETTING_HOST, hostname ) = {
2346 2346
 };
2347 2347
 
2348 2348
 /** Domain name setting */
2349
-const struct setting domain_setting __setting ( SETTING_IPv4_EXTRA, domain ) = {
2349
+const struct setting domain_setting __setting ( SETTING_IP_EXTRA, domain ) = {
2350 2350
 	.name = "domain",
2351 2351
 	.description = "DNS domain",
2352 2352
 	.tag = DHCP_DOMAIN_NAME,

+ 17
- 19
src/include/ipxe/settings.h View File

@@ -62,20 +62,18 @@ struct setting {
62 62
 
63 63
 #define SETTING_NETDEV		01 /**< Network device settings */
64 64
 #define SETTING_NETDEV_EXTRA	02 /**< Network device additional settings */
65
-#define SETTING_IPv4		03 /**< IPv4 settings */
66
-#define SETTING_IPv4_EXTRA	04 /**< IPv4 additional settings */
67
-#define SETTING_IPv6		05 /**< IPv6 settings */
68
-#define SETTING_IPv6_EXTRA	06 /**< IPv6 additional settings */
69
-#define SETTING_BOOT		07 /**< Generic boot settings */
70
-#define SETTING_BOOT_EXTRA	08 /**< Generic boot additional settings */
71
-#define SETTING_SANBOOT		09 /**< SAN boot settings */
72
-#define SETTING_SANBOOT_EXTRA	10 /**< SAN boot additional settings */
73
-#define SETTING_HOST		11 /**< Host identity settings */
74
-#define SETTING_HOST_EXTRA	12 /**< Host identity additional settings */
75
-#define SETTING_AUTH		13 /**< Authentication settings */
76
-#define SETTING_AUTH_EXTRA	14 /**< Authentication additional settings */
77
-#define SETTING_CRYPTO		15 /**< Cryptography settings */
78
-#define SETTING_MISC		16 /**< Miscellaneous settings */
65
+#define SETTING_IP		03 /**< IPv4 settings */
66
+#define SETTING_IP_EXTRA	04 /**< IPv4 additional settings */
67
+#define SETTING_BOOT		05 /**< Generic boot settings */
68
+#define SETTING_BOOT_EXTRA	06 /**< Generic boot additional settings */
69
+#define SETTING_SANBOOT		07 /**< SAN boot settings */
70
+#define SETTING_SANBOOT_EXTRA	08 /**< SAN boot additional settings */
71
+#define SETTING_HOST		09 /**< Host identity settings */
72
+#define SETTING_HOST_EXTRA	10 /**< Host identity additional settings */
73
+#define SETTING_AUTH		11 /**< Authentication settings */
74
+#define SETTING_AUTH_EXTRA	12 /**< Authentication additional settings */
75
+#define SETTING_CRYPTO		13 /**< Cryptography settings */
76
+#define SETTING_MISC		14 /**< Miscellaneous settings */
79 77
 
80 78
 /** @} */
81 79
 
@@ -421,17 +419,17 @@ extern const struct setting_type setting_type_uuid __setting_type;
421 419
 extern const struct setting_type setting_type_busdevfn __setting_type;
422 420
 
423 421
 extern const struct setting
424
-ip_setting __setting ( SETTING_IPv4, ip );
422
+ip_setting __setting ( SETTING_IP, ip );
425 423
 extern const struct setting
426
-netmask_setting __setting ( SETTING_IPv4, netmask );
424
+netmask_setting __setting ( SETTING_IP, netmask );
427 425
 extern const struct setting
428
-gateway_setting __setting ( SETTING_IPv4, gateway );
426
+gateway_setting __setting ( SETTING_IP, gateway );
429 427
 extern const struct setting
430
-dns_setting __setting ( SETTING_IPv4_EXTRA, dns );
428
+dns_setting __setting ( SETTING_IP_EXTRA, dns );
431 429
 extern const struct setting
432 430
 hostname_setting __setting ( SETTING_HOST, hostname );
433 431
 extern const struct setting
434
-domain_setting __setting ( SETTING_IPv4_EXTRA, domain );
432
+domain_setting __setting ( SETTING_IP_EXTRA, domain );
435 433
 extern const struct setting
436 434
 filename_setting __setting ( SETTING_BOOT, filename );
437 435
 extern const struct setting

+ 3
- 3
src/net/ipv4.c View File

@@ -636,7 +636,7 @@ int format_ipv4_setting ( const struct setting_type *type __unused,
636 636
 }
637 637
 
638 638
 /** IPv4 address setting */
639
-const struct setting ip_setting __setting ( SETTING_IPv4, ip ) = {
639
+const struct setting ip_setting __setting ( SETTING_IP, ip ) = {
640 640
 	.name = "ip",
641 641
 	.description = "IP address",
642 642
 	.tag = DHCP_EB_YIADDR,
@@ -644,7 +644,7 @@ const struct setting ip_setting __setting ( SETTING_IPv4, ip ) = {
644 644
 };
645 645
 
646 646
 /** IPv4 subnet mask setting */
647
-const struct setting netmask_setting __setting ( SETTING_IPv4, netmask ) = {
647
+const struct setting netmask_setting __setting ( SETTING_IP, netmask ) = {
648 648
 	.name = "netmask",
649 649
 	.description = "Subnet mask",
650 650
 	.tag = DHCP_SUBNET_MASK,
@@ -652,7 +652,7 @@ const struct setting netmask_setting __setting ( SETTING_IPv4, netmask ) = {
652 652
 };
653 653
 
654 654
 /** Default gateway setting */
655
-const struct setting gateway_setting __setting ( SETTING_IPv4, gateway ) = {
655
+const struct setting gateway_setting __setting ( SETTING_IP, gateway ) = {
656 656
 	.name = "gateway",
657 657
 	.description = "Default gateway",
658 658
 	.tag = DHCP_ROUTERS,

+ 2
- 2
src/net/udp/dns.c View File

@@ -652,7 +652,7 @@ struct resolver dns_resolver __resolver ( RESOLV_NORMAL ) = {
652 652
  */
653 653
 
654 654
 /** IPv4 DNS server setting */
655
-const struct setting dns_setting __setting ( SETTING_IPv4_EXTRA, dns ) = {
655
+const struct setting dns_setting __setting ( SETTING_IP_EXTRA, dns ) = {
656 656
 	.name = "dns",
657 657
 	.description = "DNS server",
658 658
 	.tag = DHCP_DNS_SERVERS,
@@ -660,7 +660,7 @@ const struct setting dns_setting __setting ( SETTING_IPv4_EXTRA, dns ) = {
660 660
 };
661 661
 
662 662
 /** IPv6 DNS server setting */
663
-const struct setting dns6_setting __setting ( SETTING_IPv6_EXTRA, dns6 ) = {
663
+const struct setting dns6_setting __setting ( SETTING_IP_EXTRA, dns6 ) = {
664 664
 	.name = "dns6",
665 665
 	.description = "DNS server",
666 666
 	.tag = DHCPV6_DNS_SERVERS,

Loading…
Cancel
Save