aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2012-08-09 14:17:11 -0600
committerJohn Rigby <john.rigby@linaro.org>2012-08-16 11:18:54 -0600
commit3f0ff412b6be56f90ad96724872f79e371c66c28 (patch)
tree87da073dd9cfacdb4ae2945961a60e2735343f58
parent98fc2964ef6759b92b6223fa1dc4b0220f734988 (diff)
downloadu-boot-linaro-stable-3f0ff412b6be56f90ad96724872f79e371c66c28.tar.gz
dhcp: add default weak dhcp_vendorex_{prep,proc} functions
Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r--net/bootp.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/net/bootp.c b/net/bootp.c
index c9b8349b3..938d54101 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -63,6 +63,39 @@ static char *dhcpmsg2str(int type)
}
}
#endif
+
+#if defined(CONFIG_BOOTP_VENDOREX)
+extern u8 *dhcp_vendorex_prep (u8 *e); /*rtn new e after add own opts. */
+extern u8 *dhcp_vendorex_proc (u8 *e); /*rtn next e if mine,else NULL */
+u8 *__dhcp_vendorex_prep(u8 *e)
+{
+ char *ptr;
+
+ /* DHCP vendor-class-identifier = 60 */
+ if ((ptr = getenv("dhcp_vendor-class-identifier"))) {
+ *e++ = 60;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+ /* DHCP_CLIENT_IDENTIFIER = 61 */
+ if ((ptr = getenv("dhcp_client_id"))) {
+ *e++ = 61;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+
+ return e;
+}
+
+u8 *__dhcp_vendorex_proc(u8 *popt)
+{
+ return NULL;
+}
+u8 *dhcp_vendorex_prep(u8 *e) __attribute__((weak, alias("__dhcp_vendorex_prep")));
+u8 *dhcp_vendorex_proc(u8 *e) __attribute__((weak, alias("__dhcp_vendorex_proc")));
+#endif
#endif
static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src, unsigned len)