Commit 1fe80d79c5c4e52d3410a7ab4b8515da095cdab3
1 parent
d3b8c1a743
Exists in
master
and in
54 other branches
Finally retire cmd_confdefs.h and CONFIG_BOOTP_MASK!
All of the choices for CONFIG_BOOTP_ are now documented in the README file. You must now individually select exactly the set that you want using a series of #define CONFIG_BOOTP_<x> statements in the board port config files now. Signed-off-by: Jon Loeliger <jdl@freescale.com>
Showing 7 changed files with 51 additions and 115 deletions Side-by-side Diff
README
... | ... | @@ -1125,10 +1125,21 @@ |
1125 | 1125 | BOOTP requests: delay 0 ... 8 sec |
1126 | 1126 | |
1127 | 1127 | - DHCP Advanced Options: |
1128 | - CONFIG_BOOTP_MASK | |
1128 | + You can fine tune the DHCP functionality by defining | |
1129 | + CONFIG_BOOTP_* symbols: | |
1129 | 1130 | |
1130 | - You can fine tune the DHCP functionality by adding | |
1131 | - these flags to the CONFIG_BOOTP_MASK define: | |
1131 | + CONFIG_BOOTP_SUBNETMASK | |
1132 | + CONFIG_BOOTP_GATEWAY | |
1133 | + CONFIG_BOOTP_HOSTNAME | |
1134 | + CONFIG_BOOTP_NISDOMAIN | |
1135 | + CONFIG_BOOTP_BOOTPATH | |
1136 | + CONFIG_BOOTP_BOOTFILESIZE | |
1137 | + CONFIG_BOOTP_DNS | |
1138 | + CONFIG_BOOTP_DNS2 | |
1139 | + CONFIG_BOOTP_SEND_HOSTNAME | |
1140 | + CONFIG_BOOTP_NTPSERVER | |
1141 | + CONFIG_BOOTP_TIMEOFFSET | |
1142 | + CONFIG_BOOTP_VENDOREX | |
1132 | 1143 | |
1133 | 1144 | CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS |
1134 | 1145 | serverip from a DHCP server, it is possible that more |
1135 | 1146 | |
... | ... | @@ -1137,15 +1148,14 @@ |
1137 | 1148 | serverip will be stored in the additional environment |
1138 | 1149 | variable "dnsip2". The first DNS serverip is always |
1139 | 1150 | stored in the variable "dnsip", when CONFIG_BOOTP_DNS |
1140 | - is added to the CONFIG_BOOTP_MASK. | |
1151 | + is defined. | |
1141 | 1152 | |
1142 | 1153 | CONFIG_BOOTP_SEND_HOSTNAME - Some DHCP servers are capable |
1143 | 1154 | to do a dynamic update of a DNS server. To do this, they |
1144 | 1155 | need the hostname of the DHCP requester. |
1145 | - If CONFIG_BOOP_SEND_HOSTNAME is added to the | |
1146 | - CONFIG_BOOTP_MASK, the content of the "hostname" | |
1147 | - environment variable is passed as option 12 to | |
1148 | - the DHCP server. | |
1156 | + If CONFIG_BOOP_SEND_HOSTNAME is defined, the content | |
1157 | + of the "hostname" environment variable is passed as | |
1158 | + option 12 to the DHCP server. | |
1149 | 1159 | |
1150 | 1160 | - CDP Options: |
1151 | 1161 | CONFIG_CDP_DEVICE_ID |
common/cmd_net.c
... | ... | @@ -128,7 +128,7 @@ |
128 | 128 | ip_to_string (NetOurDNSIP, tmp); |
129 | 129 | setenv ("dnsip", tmp); |
130 | 130 | } |
131 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2) | |
131 | +#if defined(CONFIG_BOOTP_DNS2) | |
132 | 132 | if (NetOurDNS2IP) { |
133 | 133 | ip_to_string (NetOurDNS2IP, tmp); |
134 | 134 | setenv ("dnsip2", tmp); |
135 | 135 | |
... | ... | @@ -138,14 +138,14 @@ |
138 | 138 | setenv ("domain", NetOurNISDomain); |
139 | 139 | |
140 | 140 | #if defined(CONFIG_CMD_SNTP) \ |
141 | - && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) | |
141 | + && defined(CONFIG_BOOTP_TIMEOFFSET) | |
142 | 142 | if (NetTimeOffset) { |
143 | 143 | sprintf (tmp, "%d", NetTimeOffset); |
144 | 144 | setenv ("timeoffset", tmp); |
145 | 145 | } |
146 | 146 | #endif |
147 | 147 | #if defined(CONFIG_CMD_SNTP) \ |
148 | - && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) | |
148 | + && defined(CONFIG_BOOTP_NTPSERVER) | |
149 | 149 | if (NetNtpServerIP) { |
150 | 150 | ip_to_string (NetNtpServerIP, tmp); |
151 | 151 | setenv ("ntpserverip", tmp); |
include/cmd_confdefs.h
1 | -/* | |
2 | - * (C) Copyright 2000-2002 | |
3 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
4 | - * | |
5 | - * See file CREDITS for list of people who contributed to this | |
6 | - * project. | |
7 | - * | |
8 | - * This program is free software; you can redistribute it and/or | |
9 | - * modify it under the terms of the GNU General Public License as | |
10 | - * published by the Free Software Foundation; either version 2 of | |
11 | - * the License, or (at your option) any later version. | |
12 | - * | |
13 | - * This program is distributed in the hope that it will be useful, | |
14 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | - * GNU General Public License for more details. | |
17 | - * | |
18 | - * You should have received a copy of the GNU General Public License | |
19 | - * along with this program; if not, write to the Free Software | |
20 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
21 | - * MA 02111-1307 USA | |
22 | - */ | |
23 | - | |
24 | -#ifndef _CMD_CONFIG_H | |
25 | -#define _CMD_CONFIG_H | |
26 | - | |
27 | -/* | |
28 | - * Temporary placeholder until all users directly | |
29 | - * include the proper include file, "config_bootp.h". | |
30 | - */ | |
31 | -#include "config_bootp.h" | |
32 | - | |
33 | -#endif /* _CMD_CONFIG_H */ |
include/config_bootp.h
1 | -/* | |
2 | - * Copyright 2007 Freescale Semiconductor, Inc. | |
3 | - * | |
4 | - * This file is licensed under the terms of the GNU General Public | |
5 | - * License Version 2. This file is licensed "as is" without any | |
6 | - * warranty of any kind, whether express or implied. | |
7 | - */ | |
8 | - | |
9 | -#ifndef _CONFIG_BOOTP_H | |
10 | -#define _CONFIG_BOOTP_H | |
11 | - | |
12 | -/* | |
13 | - * Optional BOOTP fields | |
14 | - */ | |
15 | - | |
16 | -#define CONFIG_BOOTP_SUBNETMASK 0x00000001 | |
17 | -#define CONFIG_BOOTP_GATEWAY 0x00000002 | |
18 | -#define CONFIG_BOOTP_HOSTNAME 0x00000004 | |
19 | -#define CONFIG_BOOTP_NISDOMAIN 0x00000008 | |
20 | -#define CONFIG_BOOTP_BOOTPATH 0x00000010 | |
21 | -#define CONFIG_BOOTP_BOOTFILESIZE 0x00000020 | |
22 | -#define CONFIG_BOOTP_DNS 0x00000040 | |
23 | -#define CONFIG_BOOTP_DNS2 0x00000080 | |
24 | -#define CONFIG_BOOTP_SEND_HOSTNAME 0x00000100 | |
25 | -#define CONFIG_BOOTP_NTPSERVER 0x00000200 | |
26 | -#define CONFIG_BOOTP_TIMEOFFSET 0x00000400 | |
27 | - | |
28 | -#define CONFIG_BOOTP_VENDOREX 0x80000000 | |
29 | - | |
30 | -#define CONFIG_BOOTP_ALL (~CONFIG_BOOTP_VENDOREX) | |
31 | - | |
32 | -#define CONFIG_BOOTP_DEFAULT (CONFIG_BOOTP_SUBNETMASK | \ | |
33 | - CONFIG_BOOTP_GATEWAY | \ | |
34 | - CONFIG_BOOTP_HOSTNAME | \ | |
35 | - CONFIG_BOOTP_BOOTPATH) | |
36 | - | |
37 | -#ifndef CONFIG_BOOTP_MASK | |
38 | -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT | |
39 | -#endif | |
40 | - | |
41 | -#endif /* _CONFIG_BOOTP_H */ |
include/net.h
... | ... | @@ -296,7 +296,7 @@ |
296 | 296 | extern IPaddr_t NetOurGatewayIP; /* Our gateway IP addresse */ |
297 | 297 | extern IPaddr_t NetOurSubnetMask; /* Our subnet mask (0 = unknown)*/ |
298 | 298 | extern IPaddr_t NetOurDNSIP; /* Our Domain Name Server (0 = unknown)*/ |
299 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2) | |
299 | +#if defined(CONFIG_BOOTP_DNS2) | |
300 | 300 | extern IPaddr_t NetOurDNS2IP; /* Our 2nd Domain Name Server (0 = unknown)*/ |
301 | 301 | #endif |
302 | 302 | extern char NetOurNISDomain[32]; /* Our NIS domain */ |
net/bootp.c
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 | } |
77 | 77 | #endif |
78 | 78 | |
79 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX) | |
79 | +#if defined(CONFIG_BOOTP_VENDOREX) | |
80 | 80 | extern u8 *dhcp_vendorex_prep (u8 *e); /*rtn new e after add own opts. */ |
81 | 81 | extern u8 *dhcp_vendorex_proc (u8 *e); /*rtn next e if mine,else NULL */ |
82 | 82 | #endif |
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 | if (NetOurDNSIP == 0) { |
182 | 182 | NetCopyIP (&NetOurDNSIP, (IPaddr_t *) (ext + 2)); |
183 | 183 | } |
184 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2) | |
184 | +#if defined(CONFIG_BOOTP_DNS2) | |
185 | 185 | if ((NetOurDNS2IP == 0) && (size > 4)) { |
186 | 186 | NetCopyIP (&NetOurDNS2IP, (IPaddr_t *) (ext + 2 + 4)); |
187 | 187 | } |
188 | 188 | |
... | ... | @@ -383,10 +383,10 @@ |
383 | 383 | u8 *start = e; |
384 | 384 | u8 *cnt; |
385 | 385 | |
386 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX) | |
386 | +#if defined(CONFIG_BOOTP_VENDOREX) | |
387 | 387 | u8 *x; |
388 | 388 | #endif |
389 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SEND_HOSTNAME) | |
389 | +#if defined(CONFIG_BOOTP_SEND_HOSTNAME) | |
390 | 390 | char *hostname; |
391 | 391 | #endif |
392 | 392 | |
... | ... | @@ -425,7 +425,7 @@ |
425 | 425 | *e++ = tmp >> 8; |
426 | 426 | *e++ = tmp & 0xff; |
427 | 427 | } |
428 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SEND_HOSTNAME) | |
428 | +#if defined(CONFIG_BOOTP_SEND_HOSTNAME) | |
429 | 429 | if ((hostname = getenv ("hostname"))) { |
430 | 430 | int hostnamelen = strlen (hostname); |
431 | 431 | |
... | ... | @@ -436,7 +436,7 @@ |
436 | 436 | } |
437 | 437 | #endif |
438 | 438 | |
439 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX) | |
439 | +#if defined(CONFIG_BOOTP_VENDOREX) | |
440 | 440 | if ((x = dhcp_vendorex_prep (e))) |
441 | 441 | return x - start; |
442 | 442 | #endif |
443 | 443 | |
444 | 444 | |
445 | 445 | |
446 | 446 | |
447 | 447 | |
448 | 448 | |
449 | 449 | |
450 | 450 | |
... | ... | @@ -444,39 +444,39 @@ |
444 | 444 | *e++ = 55; /* Parameter Request List */ |
445 | 445 | cnt = e++; /* Pointer to count of requested items */ |
446 | 446 | *cnt = 0; |
447 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SUBNETMASK) | |
447 | +#if defined(CONFIG_BOOTP_SUBNETMASK) | |
448 | 448 | *e++ = 1; /* Subnet Mask */ |
449 | 449 | *cnt += 1; |
450 | 450 | #endif |
451 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) | |
451 | +#if defined(CONFIG_BOOTP_TIMEOFFSET) | |
452 | 452 | *e++ = 2; |
453 | 453 | *cnt += 1; |
454 | 454 | #endif |
455 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_GATEWAY) | |
455 | +#if defined(CONFIG_BOOTP_GATEWAY) | |
456 | 456 | *e++ = 3; /* Router Option */ |
457 | 457 | *cnt += 1; |
458 | 458 | #endif |
459 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS) | |
459 | +#if defined(CONFIG_BOOTP_DNS) | |
460 | 460 | *e++ = 6; /* DNS Server(s) */ |
461 | 461 | *cnt += 1; |
462 | 462 | #endif |
463 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_HOSTNAME) | |
463 | +#if defined(CONFIG_BOOTP_HOSTNAME) | |
464 | 464 | *e++ = 12; /* Hostname */ |
465 | 465 | *cnt += 1; |
466 | 466 | #endif |
467 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTFILESIZE) | |
467 | +#if defined(CONFIG_BOOTP_BOOTFILESIZE) | |
468 | 468 | *e++ = 13; /* Boot File Size */ |
469 | 469 | *cnt += 1; |
470 | 470 | #endif |
471 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTPATH) | |
471 | +#if defined(CONFIG_BOOTP_BOOTPATH) | |
472 | 472 | *e++ = 17; /* Boot path */ |
473 | 473 | *cnt += 1; |
474 | 474 | #endif |
475 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NISDOMAIN) | |
475 | +#if defined(CONFIG_BOOTP_NISDOMAIN) | |
476 | 476 | *e++ = 40; /* NIS Domain name request */ |
477 | 477 | *cnt += 1; |
478 | 478 | #endif |
479 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) | |
479 | +#if defined(CONFIG_BOOTP_NTPSERVER) | |
480 | 480 | *e++ = 42; |
481 | 481 | *cnt += 1; |
482 | 482 | #endif |
... | ... | @@ -493,7 +493,7 @@ |
493 | 493 | |
494 | 494 | #else /* CFG_CMD_DHCP */ |
495 | 495 | /* |
496 | - * Warning: no field size check - change CONFIG_BOOTP_MASK at your own risk! | |
496 | + * Warning: no field size check - change CONFIG_BOOTP_* at your own risk! | |
497 | 497 | */ |
498 | 498 | static int BootpExtended (u8 * e) |
499 | 499 | { |
500 | 500 | |
501 | 501 | |
502 | 502 | |
503 | 503 | |
504 | 504 | |
505 | 505 | |
... | ... | @@ -515,43 +515,43 @@ |
515 | 515 | *e++ = (576 - 312 + OPT_SIZE) & 0xff; |
516 | 516 | #endif /* CFG_CMD_DHCP */ |
517 | 517 | |
518 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SUBNETMASK) | |
518 | +#if defined(CONFIG_BOOTP_SUBNETMASK) | |
519 | 519 | *e++ = 1; /* Subnet mask request */ |
520 | 520 | *e++ = 4; |
521 | 521 | e += 4; |
522 | 522 | #endif |
523 | 523 | |
524 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_GATEWAY) | |
524 | +#if defined(CONFIG_BOOTP_GATEWAY) | |
525 | 525 | *e++ = 3; /* Default gateway request */ |
526 | 526 | *e++ = 4; |
527 | 527 | e += 4; |
528 | 528 | #endif |
529 | 529 | |
530 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS) | |
530 | +#if defined(CONFIG_BOOTP_DNS) | |
531 | 531 | *e++ = 6; /* Domain Name Server */ |
532 | 532 | *e++ = 4; |
533 | 533 | e += 4; |
534 | 534 | #endif |
535 | 535 | |
536 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_HOSTNAME) | |
536 | +#if defined(CONFIG_BOOTP_HOSTNAME) | |
537 | 537 | *e++ = 12; /* Host name request */ |
538 | 538 | *e++ = 32; |
539 | 539 | e += 32; |
540 | 540 | #endif |
541 | 541 | |
542 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTFILESIZE) | |
542 | +#if defined(CONFIG_BOOTP_BOOTFILESIZE) | |
543 | 543 | *e++ = 13; /* Boot file size */ |
544 | 544 | *e++ = 2; |
545 | 545 | e += 2; |
546 | 546 | #endif |
547 | 547 | |
548 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTPATH) | |
548 | +#if defined(CONFIG_BOOTP_BOOTPATH) | |
549 | 549 | *e++ = 17; /* Boot path */ |
550 | 550 | *e++ = 32; |
551 | 551 | e += 32; |
552 | 552 | #endif |
553 | 553 | |
554 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NISDOMAIN) | |
554 | +#if defined(CONFIG_BOOTP_NISDOMAIN) | |
555 | 555 | *e++ = 40; /* NIS Domain name request */ |
556 | 556 | *e++ = 32; |
557 | 557 | e += 32; |
... | ... | @@ -726,7 +726,7 @@ |
726 | 726 | case 1: |
727 | 727 | NetCopyIP (&NetOurSubnetMask, (popt + 2)); |
728 | 728 | break; |
729 | -#if defined(CONFIG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) | |
729 | +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET) | |
730 | 730 | case 2: /* Time offset */ |
731 | 731 | NetCopyLong (&NetTimeOffset, (ulong *) (popt + 2)); |
732 | 732 | NetTimeOffset = ntohl (NetTimeOffset); |
... | ... | @@ -737,7 +737,7 @@ |
737 | 737 | break; |
738 | 738 | case 6: |
739 | 739 | NetCopyIP (&NetOurDNSIP, (popt + 2)); |
740 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2) | |
740 | +#if defined(CONFIG_BOOTP_DNS2) | |
741 | 741 | if (*(popt + 1) > 4) { |
742 | 742 | NetCopyIP (&NetOurDNS2IP, (popt + 2 + 4)); |
743 | 743 | } |
... | ... | @@ -755,7 +755,7 @@ |
755 | 755 | memcpy (&NetOurRootPath, popt + 2, size); |
756 | 756 | NetOurRootPath[size] = 0; |
757 | 757 | break; |
758 | -#if defined(CONFIG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) | |
758 | +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER) | |
759 | 759 | case 42: /* NTP server IP */ |
760 | 760 | NetCopyIP (&NetNtpServerIP, (popt + 2)); |
761 | 761 | break; |
... | ... | @@ -801,7 +801,7 @@ |
801 | 801 | } |
802 | 802 | break; |
803 | 803 | default: |
804 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX) | |
804 | +#if defined(CONFIG_BOOTP_VENDOREX) | |
805 | 805 | if (dhcp_vendorex_proc (popt)) |
806 | 806 | break; |
807 | 807 | #endif |
net/net.c
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | IPaddr_t NetOurSubnetMask=0; /* Our subnet mask (0=unknown) */ |
111 | 111 | IPaddr_t NetOurGatewayIP=0; /* Our gateways IP address */ |
112 | 112 | IPaddr_t NetOurDNSIP=0; /* Our DNS IP address */ |
113 | -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2) | |
113 | +#if defined(CONFIG_BOOTP_DNS2) | |
114 | 114 | IPaddr_t NetOurDNS2IP=0; /* Our 2nd DNS IP address */ |
115 | 115 | #endif |
116 | 116 | char NetOurNISDomain[32]={0,}; /* Our NIS domain */ |