This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: [ECOS] build_bootp_record() support dns server address
Motoya Kurotsu wrote:
And here is the patch. Again, i've not tested it, but it seems to
compile OK in various configurations. Motoya, please can you test it
in your setup.
[snip]
With them fixed, both dns1 and dns2 were finished successfully.
Please ckeck the patch attached.
This is now applied, with a few tweaks by me. Including trivial spelling
ones not included here. I needed to touch infra to get rid of a warning
with passing in a const ptr to CYG_CHECK_DATA_PTR.
Jifl
--
eCosCentric http://www.eCosCentric.com/ <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
Index: infra/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/ChangeLog,v
retrieving revision 1.30
diff -u -5 -p -r1.30 ChangeLog
--- infra/current/ChangeLog 18 Jul 2002 20:08:15 -0000 1.30
+++ infra/current/ChangeLog 18 Jan 2003 04:17:45 -0000
@@ -1,5 +1,17 @@
+2003-01-18 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * include/cyg_ass.h (CYG_CHECK_FUNC_PTRC): Define with const pointer
+ arguments.
+ (CYG_CHECK_DATA_PTRC): Ditto.
+ (CYG_CHECK_FUNC_PTR): Ditto.
+ (CYG_CHECK_DATA_PTR): Ditto.
+ * src/null.cxx: Define cyg_check_data/func_ptr() with const args.
+ * src/buffer.cxx: Ditto.
+ * src/fancy.cxx: Ditto.
+ * src/simple.cxx: Ditto.
+
2002-07-18 Gary Thomas <gary@chez-thomas.org>
* include/diag.h:
* src/diag.cxx (diag_vdump_buf_with_offset): New function.
Index: infra/current/include/cyg_ass.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/include/cyg_ass.h,v
retrieving revision 1.10
diff -u -5 -p -r1.10 cyg_ass.h
--- infra/current/include/cyg_ass.h 23 May 2002 23:05:49 -0000 1.10
+++ infra/current/include/cyg_ass.h 18 Jan 2003 04:17:45 -0000
@@ -154,36 +154,36 @@ cyg_assert_msg( const char *psz_func, co
// that are outside to defined memory areas of the platform or executable.
// We differentiate between data and function pointers, so that we can cope
// with different formats, and so we can check them against different memory
// regions.
-externC cyg_bool cyg_check_data_ptr(void *ptr);
-externC cyg_bool cyg_check_func_ptr(void (*ptr)(void));
+externC cyg_bool cyg_check_data_ptr(const void *ptr);
+externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void));
#ifdef CYGDBG_USE_ASSERTS
# define CYG_CHECK_DATA_PTR( _ptr_, _msg_ ) \
CYG_MACRO_START \
- if( !cyg_check_data_ptr((void *)(_ptr_))) \
+ if( !cyg_check_data_ptr((const void *)(_ptr_))) \
CYG_ASSERT_DOCALL( _msg_ ); \
CYG_MACRO_END
# define CYG_CHECK_FUNC_PTR( _ptr_, _msg_ ) \
CYG_MACRO_START \
- if( !cyg_check_func_ptr((void (*)(void))(_ptr_))) \
+ if( !cyg_check_func_ptr((const void (*)(void))(_ptr_))) \
CYG_ASSERT_DOCALL( _msg_ ); \
CYG_MACRO_END
# define CYG_CHECK_DATA_PTRC( _ptr_ ) \
CYG_MACRO_START \
- if ( !cyg_check_data_ptr((void *)(_ptr_))) \
+ if ( !cyg_check_data_ptr((const void *)(_ptr_))) \
CYG_ASSERT_DOCALL("data pointer (" #_ptr_ ") is valid");\
CYG_MACRO_END
# define CYG_CHECK_FUNC_PTRC( _ptr_ ) \
CYG_MACRO_START \
- if ( !cyg_check_func_ptr((void (*)(void))(_ptr_))) \
+ if ( !cyg_check_func_ptr((const void (*)(void))(_ptr_))) \
CYG_ASSERT_DOCALL("function pointer (" #_ptr_ ") is valid"); \
CYG_MACRO_END
#else // CYGDBG_USE_ASSERTS
Index: infra/current/src/buffer.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/src/buffer.cxx,v
retrieving revision 1.12
diff -u -5 -p -r1.12 buffer.cxx
--- infra/current/src/buffer.cxx 23 May 2002 23:05:51 -0000 1.12
+++ infra/current/src/buffer.cxx 18 Jan 2003 04:17:46 -0000
@@ -759,22 +759,22 @@ extern unsigned long _etext;
unsigned long stext_addr = (unsigned long)&_stext;
unsigned long etext_addr = (unsigned long)&_etext;
};
-externC cyg_bool cyg_check_data_ptr(void *ptr)
+externC cyg_bool cyg_check_data_ptr(const void *ptr)
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
if( p > stext_addr && p < etext_addr ) return false;
return true;
}
-externC cyg_bool cyg_check_func_ptr(void (*ptr)(void))
+externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void))
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
Index: infra/current/src/fancy.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/src/fancy.cxx,v
retrieving revision 1.11
diff -u -5 -p -r1.11 fancy.cxx
--- infra/current/src/fancy.cxx 23 May 2002 23:05:51 -0000 1.11
+++ infra/current/src/fancy.cxx 18 Jan 2003 04:17:46 -0000
@@ -630,22 +630,22 @@ extern unsigned long _etext;
unsigned long stext_addr = (unsigned long)&_stext;
unsigned long etext_addr = (unsigned long)&_etext;
};
-externC cyg_bool cyg_check_data_ptr(void *ptr)
+externC cyg_bool cyg_check_data_ptr(const void *ptr)
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
if( p > stext_addr && p < etext_addr ) return false;
return true;
}
-externC cyg_bool cyg_check_func_ptr(void (*ptr)(void))
+externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void))
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
Index: infra/current/src/null.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/src/null.cxx,v
retrieving revision 1.10
diff -u -5 -p -r1.10 null.cxx
--- infra/current/src/null.cxx 23 May 2002 23:05:52 -0000 1.10
+++ infra/current/src/null.cxx 18 Jan 2003 04:17:46 -0000
@@ -153,22 +153,22 @@ extern unsigned long _etext;
unsigned long stext_addr = (unsigned long)&_stext;
unsigned long etext_addr = (unsigned long)&_etext;
};
-externC cyg_bool cyg_check_data_ptr(void *ptr)
+externC cyg_bool cyg_check_data_ptr(const void *ptr)
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
if( p > stext_addr && p < etext_addr ) return false;
return true;
}
-externC cyg_bool cyg_check_func_ptr(void (*ptr)(void))
+externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void))
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
Index: infra/current/src/simple.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/src/simple.cxx,v
retrieving revision 1.11
diff -u -5 -p -r1.11 simple.cxx
--- infra/current/src/simple.cxx 23 May 2002 23:05:52 -0000 1.11
+++ infra/current/src/simple.cxx 18 Jan 2003 04:17:46 -0000
@@ -531,22 +531,22 @@ extern unsigned long _etext;
unsigned long stext_addr = (unsigned long)&_stext;
unsigned long etext_addr = (unsigned long)&_etext;
};
-externC cyg_bool cyg_check_data_ptr(void *ptr)
+externC cyg_bool cyg_check_data_ptr(const void *ptr)
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
if( p > stext_addr && p < etext_addr ) return false;
return true;
}
-externC cyg_bool cyg_check_func_ptr(void (*ptr)(void))
+externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void))
{
unsigned long p = (unsigned long)ptr;
if( p == 0 ) return false;
Index: net/common/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/ChangeLog,v
retrieving revision 1.16
diff -u -5 -p -r1.16 ChangeLog
--- net/common/current/ChangeLog 18 Jan 2003 03:46:17 -0000 1.16
+++ net/common/current/ChangeLog 18 Jan 2003 04:17:46 -0000
@@ -1,5 +1,10 @@
+2003-01-18 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * src/network_support.c (init_all_network_interfaces): Define buf
+ as const.
+
2003-01-10 Andrew Lunn <andrew.lunn@ascom.ch>
* src/network_support.c (init_all_network_interfaces): Added
support for a hard coded domain name. Inspired by Motoya Kurotsu.
Index: net/common/current/src/network_support.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/src/network_support.c,v
retrieving revision 1.3
diff -u -5 -p -r1.3 network_support.c
--- net/common/current/src/network_support.c 18 Jan 2003 03:46:18 -0000 1.3
+++ net/common/current/src/network_support.c 18 Jan 2003 04:17:46 -0000
@@ -40,11 +40,12 @@
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
-// Contributors: gthomas, sorin@netappi.com ("Sorin Babeanu"), hmt
+// Contributors: gthomas, sorin@netappi.com ("Sorin Babeanu"), hmt, jlarmour,
+// andrew.lunn@ascom.ch
// Date: 2000-01-10
// Purpose:
// Description:
//
//
@@ -468,11 +469,11 @@ init_all_network_interfaces(void)
#endif
#ifdef CYGDAT_NS_DNS_DOMAINNAME_NAME
#define _NAME string(CYGDAT_NS_DNS_DOMAINNAME_NAME)
{
- char buf[] = _NAME;
+ const char buf[] = _NAME;
int len = strlen(_NAME);
setdomainname(buf,len);
}
#endif
Index: net/ns/dns/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/ns/dns/current/ChangeLog,v
retrieving revision 1.8
diff -u -5 -p -r1.8 ChangeLog
--- net/ns/dns/current/ChangeLog 18 Jan 2003 03:47:02 -0000 1.8
+++ net/ns/dns/current/ChangeLog 18 Jan 2003 04:17:47 -0000
@@ -1,5 +1,11 @@
+2003-01-18 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * include/dns_impl.inl (setdomainname): define with const name
+ argument.
+ * include/dns.h: Ditto.
+
2003-01-10 Andrew Lunn <andrew.lunn@ascom.ch>
* cdl/dns.cdl: Added the ability to hard code a domain name.
Inspired by Motoya Kurotsu.
* doc/dns.sgml: Documentation for this.
Index: net/ns/dns/current/include/dns.h
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/ns/dns/current/include/dns.h,v
retrieving revision 1.2
diff -u -5 -p -r1.2 dns.h
--- net/ns/dns/current/include/dns.h 23 May 2002 23:08:05 -0000 1.2
+++ net/ns/dns/current/include/dns.h 18 Jan 2003 04:17:47 -0000
@@ -55,11 +55,11 @@
#ifndef _POSIX_SOURCE
/* Initialise the DNS client with the address of the server */
externC int cyg_dns_res_init(struct in_addr *dns_server);
externC int getdomainname(char *name, size_t len);
-externC int setdomainname(char *name, size_t len);
+externC int setdomainname(const char *name, size_t len);
#endif
// Host name / IP mapping
struct hostent {
char *h_name; /* official name of host */
Index: net/ns/dns/current/include/dns_impl.inl
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/ns/dns/current/include/dns_impl.inl,v
retrieving revision 1.3
diff -u -5 -p -r1.3 dns_impl.inl
--- net/ns/dns/current/include/dns_impl.inl 29 Aug 2002 10:10:40 -0000 1.3
+++ net/ns/dns/current/include/dns_impl.inl 18 Jan 2003 04:17:47 -0000
@@ -521,11 +521,11 @@ gethostbyname(const char * hostname)
return hent;
}
/* Set the domain names, as used by the DNS server */
int
-setdomainname(char *name, size_t len)
+setdomainname(const char *name, size_t len)
{
char * ptr;
CYG_REPORT_FUNCNAMETYPE( "setdomainname", "returning %d" );
CYG_REPORT_FUNCARG2( "name=%08x, len=%d", name, len );