|
|
View previous topic :: View next topic |
Author |
Message |
Tagge
Joined: 23 Aug 2005 Posts: 93
|
DNS address? |
Posted: Fri May 08, 2009 3:50 pm |
|
|
In the CCS TCP/IP stack, how can I manually assign the DNS server address? It seems to allways be dynamic..
I would like to point it to my router directly, for ex 192.168.1.1
I havent find where it could be done, unlike the unit IP-address, subnet mask and gateway.
It mostly seems to work allright anyway, but just to be sure..
anyone figured it out?
Thanks/tagge |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Fri May 08, 2009 10:04 pm |
|
|
Set AppConfig.PrimaryDNSServer. _________________ Andrew |
|
|
Tagge
Joined: 23 Aug 2005 Posts: 93
|
|
Posted: Tue May 12, 2009 2:33 am |
|
|
Hi, thanks, but there is no function, at least, as
"Set AppConfig.PrimaryDNSServer"
I assume I just cant write in the ip address in the struct.. SMTPServerAddr, or? how should it look like in that case?
What should I then disable to avoid the DNS functions to owerwrite it?
Code: |
typedef struct _APP_CONFIG
{
IP_ADDR MyIPAddr;
MAC_ADDR MyMACAddr;
IP_ADDR MyMask;
IP_ADDR MyGateway;
IP_ADDR PrimaryDNSServer;
struct
{
unsigned char bIsDHCPEnabled : 1;
unsigned char bInConfigMode : 1;
} Flags;
WORD_VAL SerialNumber;
IP_ADDR SMTPServerAddr; // Not used. In CCS ???
IP_ADDR TFTPServerAddr; // Not used.
BYTE NetBIOSName[16];
} APP_CONFIG;
|
But most confusing is that the DNS address changes, and often to a not working one.. But only when reprogramming, not by reset
Then it usually uses the last obtained, even if its not up to date..
But if I turn on the DHCP function, it get the right DNS.
Its all about resolving the IP to the SMTP server, thats needed.
but I would like to write the DNS address in manually, and wouldnt have to use the DHCP function. |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Tue May 12, 2009 6:18 am |
|
|
You should have also seen: Code: | typedef int32 DWORD;
typedef union _IP_ADDR
{
BYTE v[4];
DWORD Val;
} IP_ADDR; | That means you can write: Code: | AppConfig.PrimaryDNSServer.Val = make32(192,168,1,1); | or maybe it should be: Code: | AppConfig.PrimaryDNSServer.Val = make32(1,1,168,192); | ? See which one works.
Just set the value at startup. _________________ Andrew |
|
|
Tagge
Joined: 23 Aug 2005 Posts: 93
|
|
Posted: Tue May 12, 2009 7:52 am |
|
|
Code: | AppConfig.PrimaryDNSServer.Val = make32(1,1,168,192); |
Works just fine!
thanks
/tagge |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|