Did I find the right examples for you? yes no

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)

        def iptoint(ipstr):
    return struct.unpack('!I', socket.inet_aton(ipstr))[0]
        


src/p/y/pybootd-HEAD/pybootd/pxed.py   pybootd(Download)
from binascii import hexlify
from pybootd import PRODUCT_NAME
from util import hexline, to_bool, iptoint, inttoip, get_iface_config
 
BOOTP_PORT_REQUEST = 67
        if buf[BOOTP_CIADDR] == '\x00\x00\x00\x00':
            self.log.debug('Client needs its address')
            ipaddr = iptoint(self.pool_start)
            ip = None
            if mac_str in self.ippool:
            if not ip:
                raise BootpError('No more IP available in definined pool')
            mask = iptoint(self.netconfig['mask'])
            reply_broadcast = iptoint(ip) & mask
            reply_broadcast |= (~mask)&((1<<32)-1)