Re: NAT-PMP Broadcast Address?
Re: NAT-PMP Broadcast Address?
- Subject: Re: NAT-PMP Broadcast Address?
- From: email@hidden
- Date: Tue, 11 Sep 2007 11:49:03 -0600
On Sep 10, 2007, at 12:35 PM, Matt Slot wrote:
On Sep 10, 2007, at 1:56 PM, email@hidden wrote:
I am just wondering if I am missing something, like maybe I have
to send a special discovery packet to get the address of the
router, and then pass that to NAT-PMP so it can query the router
address directly. Or, do I look in the system somewhere for the
router address as seen in system prefs?
Here's the code I use to discover the address of my upstream router
using BSD.
Hey thanx, you always seem to help me on this esoteric stuff :-P I'm
going to try it today on my friend's airport, so if I don't respond
to this thread, then the bsd code worked.
On Sep 11, 2007, at 4:16 AM, Quinn wrote:
At 14:35 -0400 10/9/07, Matt Slot wrote:
Here's the code I use to discover the address of my upstream
router using BSD.
Alternatively you could do this the same way that mDNSResponder
does it:
1. Use SCDynamicStoreCopyValue to get "State:/Network/Global/IPv4".
2. Extract the default router's IP using the "Router" key.
You can also use SCF notifications to learn about changes.
Ya I will listen for changes, maybe with just the notifications that
happen in the spec though. Also, I think I found a flaw in NAT-
PMP...because you can't query what ports your machine opened? I want
to be able to check a port and see what it is. But the only way to
do that is to basically try to remove the port. You will get an
error code if another machine is using the port. However, if your
computer had a port allocated, you just get an answer that you
successfully either got the port, or changed its timeout, which for
removal is a timeout of 0. There doesn't seem to be a way to
determine if the port was already open. I realize that is how the
spec is designed to work, so that multiple requests return multiple
success replies, but this still seems to be a pretty major thing to
overlook.
So is there any way to get a port list from an airport, maybe not
even with NAT-PMP?
Thanx,
--Zack
_______________________________________________
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