• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: DHCP server address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DHCP server address


  • Subject: Re: DHCP server address
  • From: Jens Bauer <email@hidden>
  • Date: Sun, 2 Jun 2002 15:39:05 +0200

Hi Ryan,

On Sun, 2 Jun, 2002, Ryan McGann <email@hidden> wrote:

>Quickie: Is there a way to obtain the IP address of the DHCP server?

I think the quick answer is: Yes.

Try looking at this code, which gets the current DNS address under Mac OS 9:

int GetCurrentDNS(char *buffer)
{
OSStatus err;
char *p;
InetInterfaceInfo info;
InetHost dns;

p = buffer;
if(p)
{
OTMemzero(&info, sizeof(info));
err = OTInetGetInterfaceInfo(&info, kDefaultInetInterface);

dns = info.fDNSAddr; /* you may want to change this line
(fDefaultGatewayAddr) */
sprintf(p, "%d.%d.%d.%d", (dns >> 24) &0xff, (dns >> 16) &0xff, (dns >>
8) &0xff, dns & 0xff);

return(1);
}
return(0);
}

-Note: You should not use the sprintf for converting it into a dotted-
decimal string.


Love,
Jens

--
Jens Bauer, Faster Software.
-Let's make the World better, shall we ?
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: DHCP server address
      • From: Eric Gundrum <email@hidden>
References: 
 >DHCP server address (From: Ryan McGann <email@hidden>)

  • Prev by Date: DHCP server address
  • Next by Date: Re: DHCP server address
  • Previous by thread: DHCP server address
  • Next by thread: Re: DHCP server address
  • Index(es):
    • Date
    • Thread