CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

DNS address?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tagge



Joined: 23 Aug 2005
Posts: 93

View user's profile Send private message Visit poster's website

DNS address?
PostPosted: Fri May 08, 2009 3:50 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Fri May 08, 2009 10:04 pm     Reply with quote

Set AppConfig.PrimaryDNSServer.
_________________
Andrew
Tagge



Joined: 23 Aug 2005
Posts: 93

View user's profile Send private message Visit poster's website

PostPosted: Tue May 12, 2009 2:33 am     Reply with quote

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 Confused
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

View user's profile Send private message Visit poster's website

PostPosted: Tue May 12, 2009 6:18 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Tue May 12, 2009 7:52 am     Reply with quote

Code:
AppConfig.PrimaryDNSServer.Val = make32(1,1,168,192);

Works just fine! Very Happy
thanks
/tagge
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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