i am writing a rlm_python module for radius which grabs location from "Accouting-Request" packet
however, the location is on binary format,
"\001\027\002\025\001+\001\024"
when i try to unpack using struct
[root@server ~]# python
Python 2.4.3 (#1, May 5 2011, 16:39:10)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from struct import *
>>> unpack('hhl',"\001\027\002\025\001+\001\024" )
Traceback (most recent call last):
File "<stdin>", line 1, in ?
struct.error: unpack str size does not match format
any idea, how i can unpack this data?
calcsize('l'),calcsize('=l'),calcsize('i'), etc. (wherecalcsizeisstruct.calcsize).