wrote:
>I would like to get the source MAC address of the incoming HTTP request.
>Yet, I don't see such information being available in HttpRequest.META.
>dictionary. Does anyone know where I can get the MAC address from?
>
MAC addresses are not a normal part of the information available at
the TCP/IP level -- wrapping of TCP/IP packets with MAC addressing is
handled at a lower lower level of the network stack.
Unfortunately, Python does not include an ARP module -- I found an
alpha release of one for WinXP+ (since WinXP and later don't expose a
RAW packet capability; which other OSs might still permit -- ARP has to
be performed at that lower level).
You could see if the machine has a standalone ARP utility program
that you could spawn out. Even Win7 has:
C:\Users\Wulfraed>arp
Displays and modifies the IP-to-Physical address translation tables used
by
address resolution protocol (ARP).
ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr] [-v]
-a Displays current ARP entries by interrogating the
current
protocol data. If inet_addr is specified, the IP and
Physical
addresses for only the specified computer are displayed.
If
more than one network interface uses ARP, entries for
each ARP
table are displayed.
-g Same as -a.
C:\Users\Wulfraed>
C:\Users\Wulfraed>arp -a 10.33.202.194
Interface: 10.33.202.199 --- 0xf
Internet Address Physical Address Type
10.33.202.194 18-75-2e-08-00-00 static
C:\Users\Wulfraed>
(Note: I obtained the IP address used above from running "arp -a" which
listed all of them.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment