From f65c5cf1f7ca0ea9fb5a284da2b126aa6dcbae98 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 13 Dec 2011 17:25:23 +0000 Subject: STM32 Ethernet bugfixes; STM3240G-EVAL DHCPD configuration; fixes for IP address order bugs in DHCPD git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4168 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/dhcpd/Makefile | 16 ++++++++++++++-- apps/examples/dhcpd/host.c | 4 ++-- apps/examples/dhcpd/target.c | 22 +++++++++++++++++----- 3 files changed, 33 insertions(+), 9 deletions(-) (limited to 'apps/examples/dhcpd') diff --git a/apps/examples/dhcpd/Makefile b/apps/examples/dhcpd/Makefile index 219cfb865..3254a9806 100644 --- a/apps/examples/dhcpd/Makefile +++ b/apps/examples/dhcpd/Makefile @@ -2,7 +2,7 @@ # apps/examples/dhcpd/Makefile # # Copyright (C) 2009-2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -56,6 +56,12 @@ endif ROOTDEPPATH = --dep-path . +# DHCPD built-in application info + +APPNAME = dhcpd +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + # Common build VPATH = @@ -75,7 +81,13 @@ $(COBJS): %$(OBJEXT): %.c done ; ) @touch .built -context: +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ +endif + +context: .context .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/dhcpd/host.c b/apps/examples/dhcpd/host.c index 9e654819b..479a845c1 100644 --- a/apps/examples/dhcpd/host.c +++ b/apps/examples/dhcpd/host.c @@ -1,8 +1,8 @@ /**************************************************************************** * examples/dhcpd/host.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/apps/examples/dhcpd/target.c b/apps/examples/dhcpd/target.c index d394da02e..350bfe15f 100644 --- a/apps/examples/dhcpd/target.c +++ b/apps/examples/dhcpd/target.c @@ -2,7 +2,7 @@ * examples/dhcpd/target.c * * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -53,7 +53,7 @@ /* Configuation Checkes *****************************************************/ /* BEWARE: - * There are other configuration settings needed in netutitls/dhcpd/dhcpdc.s, + * There are other configuration settings needed in netutils/dhcpd/dhcpdc.c, * but there are default values for those so we cannot check them here. */ @@ -62,7 +62,7 @@ #endif #ifndef CONFIG_EXAMPLE_DHCPD_DRIPADDR -# error "You must define " +# error "You must define CONFIG_EXAMPLE_DHCPD_DRIPADDR" #endif #ifndef CONFIG_EXAMPLE_DHCPD_NETMASK @@ -81,15 +81,27 @@ # error "You must define CONFIG_NET_BROADCAST" #endif +/* If CONFIG_NSH_BUILTIN_APPS is defined, then it is assumed that you want + * to execute the DHCPD daemon as an NSH built-in task. + */ + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME dhcpd_main +# define MAIN_NAME_STRING "dhcpd_main" +#else +# define MAIN_NAME user_start +# define MAIN_NAME_STRING "user_start" +#endif + /**************************************************************************** * Private Data ****************************************************************************/ /**************************************************************************** - * user_start + * Name: user_start/dhcpd_main ****************************************************************************/ -int user_start(int argc, char *argv[]) +int MAIN_NAME(int argc, char *argv[]) { struct in_addr addr; #if defined(CONFIG_EXAMPLE_DHCPD_NOMAC) -- cgit v1.2.3