• 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: Forcing DHCP release/renew
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing DHCP release/renew


  • Subject: Re: Forcing DHCP release/renew
  • From: Quinn <email@hidden>
  • Date: Wed, 29 Jan 2003 22:15:25 +0000

At 10:58 -0800 29/1/03, Eugene Lisitsyn wrote:
I need to force DHCP release/renew from within an ethernet driver ( in both
OS9 and OSX ).
For OS9 I found MoreNetworkSetup sample which has DHCPRelease sample code:
http://developer.apple.com/samplecode/Sample_Code/Networking/MoreNetworkSetup
.htm
Is this a way of doing this or there are better ways?

For OS X - I've seen this question in darwin-development group, but never saw
an answer. So, is there any known way to force DHCP release from within
IOEthernetController-based kext?

The techniques to do this from within an Ethernet driver are quite different from that which you'd use from user space code.

On 9, you'd use OTChangePortState with kOTPortNetworkChange to tell the system that the network has changed. This is what Apple's AirPort driver does when it moves off one network on to another.

Note that kOTPortNetworkChange was added in OT 2.5 (Mac OS 9), as per the following document. Prior to that you might be able to achieve the same effect by taking the port down and up again, although I don't know how well this will work.

<http://developer.apple.com/technotes/tn/tn1176.html>

On X, I was recently copied on an answer to this from the I/O Ethernet family engineer.

His driver should call setLinkStatus() to report the link condition. See IONetworkController.h.

// Report link down
setLinkStatus( kIONetworkLinkValid );

// Report link up
setLinkStatus( kIONetworkLinkValid | kIONetworkLinkActive );

There are optional parameters that can further specify the type of link established, speed, etc.

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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.

References: 
 >Forcing DHCP release/renew (From: "Eugene Lisitsyn" <email@hidden>)

  • Prev by Date: Re: Forcing DHCP release/renew
  • Next by Date: Re: Listening on an interface
  • Previous by thread: Re: Forcing DHCP release/renew
  • Next by thread: Re: Re(5): errno 40 (EMSGSIZE, message too long)
  • Index(es):
    • Date
    • Thread