2009/10/22 Pablo Martí Gamboa <[email protected]>

>
>
> 2009/10/22 Andrey Batyiev <[email protected]>
>
>> Hello everyone
>>
>> Am I right, that every IP address in
>> org.freedesktop.NetworkManager.IP4Config
>> is in network byte order? Could you explicitly document this behaviour,
>> please?
>>
>
> implementation in Python:
>
> import sockket
> def convert_ip_to_int(ip):
>     """
>     Converts ``ip`` to its integer representation
>
>     :param ip: The IP to convert
>     :type ip: str
>     :rtype: int
>     """
>     i = struct.unpack('i', socket.inet_pton(socket.AF_INET, ip))[0]
>     if i < 0:
>         i += 0xffffffff + 1
>     return i
>

Oops, too quick... it should be "import socket" :P


>
>> Thanks,
>>   Andrey
>> _______________________________________________
>> NetworkManager-list mailing list
>> [email protected]
>> http://mail.gnome.org/mailman/listinfo/networkmanager-list
>>
>
>
>
> --
> Pablo Martí
> http://www.linkedin.com/in/pmarti || http://www.warp.es
> python -c "print '706d6172746940776172702e6573'.decode('hex')"
>
>


-- 
Pablo Martí
http://www.linkedin.com/in/pmarti || http://www.warp.es
python -c "print '706d6172746940776172702e6573'.decode('hex')"
_______________________________________________
NetworkManager-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to