Re: Network Utility
Re: Network Utility
- Subject: Re: Network Utility
- From: "Peter Sichel" <email@hidden>
- Date: Wed, 22 Mar 2006 09:08:20 -0500
On 3/21/06, Tim michals wrote:
>Is this an open source app? I'm trying to create an
>app that is simlar.
What are your goals for creating a similar app? Are you trying to learn
about networking, or solve a specific problem?
>If not, here are a couple of questions:
>- can the entire network (TCP/IP) stack be restarted?
>ie, stop and restarted?
You can "restart" the stack indirectly using the System Configuration
Framework to modify and commit changes to the network configuration.
>- I have a couple of examples to get the MAC address
>for each interface, how can the IP address be
>retreived?
There are a few ways to do this, but the most Mac friendly is to use the
System Configuration Framework which reflects the information in the
Network Preferences panel. Alternatively, you can use the BSD layer
'getifaddrs()' or a routing socket to get the addresses for each network
port, but this won't give you the corresponding user name for that port
or the service order which controls routing and DNS. I use a
combination of techniques to get various information.
> What happen if it is DHCP assigned?
>(just use sysctrl to get the info, ie like ifconfig?)
The System Configuration Framework can report DHCP assigned addresses.
There's also a separate store for DHCP information such as the DHCP
Server and lease expiration time.
Kind Regards,
- Peter Sichel
Sustainable Softworks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden