Changeset fa9915f995fc342fcce741ebe5502b0e4a09a001
- Timestamp:
- 12/09/09 15:46:16 (8 months ago)
- Author:
- Frederic Lepied <frederic.lepied@…>
- Parents:
- e5e582bfb02593a628c358d97bd630ff91da7f41
- Children:
- 74c3d1b1c53af237e622f28e0595b9fb76106d59
- git-committer:
- Frederic Lepied <frederic.lepied@splitted-desktop.com> / 2009-12-09T15:46:16Z+0100
- Message:
-
lookup ip to mac association ignoring case
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
re5e582b
|
rfa9915f
|
|
| 14 | 14 | from models import * |
| 15 | 15 | |
| 16 | | MAC_REGEXP = re.compile('^.*\s([0-9A-F:]+)\s.*') |
| 17 | | IP_REGEXP = re.compile('^([0-9.]+).*\s[0-9A-F:]+\s.*') |
| | 16 | MAC_REGEXP = re.compile('^.*\s([0-9a-f:]+)\s.*', re.I) |
| | 17 | IP_REGEXP = re.compile('^([0-9.]+).*\s[0-9a-f:]+\s.*', re.I) |
| 18 | 18 | |
| 19 | 19 | def ip_to_mac(ip): |
| … |
… |
|
| 37 | 37 | mac = ip_to_mac(request.META['REMOTE_ADDR']) |
| 38 | 38 | if not mac: |
| | 39 | print 'no mac for', request.META['REMOTE_ADDR'] |
| 39 | 40 | raise Http404 |
| 40 | 41 | return mac |