Did I find the right examples for you? yes no

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)
int(x[, base]) -> integer

Convert a string or number to an integer, if possible.  A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!)  When converting a string, use
the optional base.  It is an error to supply a base when converting a
non-string.  If base is zero, the proper base is guessed based on the
string content.  If the argument is outside the integer range a
long object will be returned instead.

src/r/s/rsbac-python-HEAD/main/examples/jail-tcpserver.py   rsbac-python(Download)
		test("set ressource", lambda : resource.setrlimit(resource.RLIMIT_NOFILE, (500, 500)))
		if os.getuid() == 0:
			test("raw socket creation", lambda : socket.socket(socket.AF_PACKET, socket.SOCK_RAW))
			test("/etc/shadow read", lambda : open("/etc/shadow").read())
		# User data outputs

src/p/y/pymnl-0.5/examples/rtnl/rtnl-link-dump3.py   pymnl(Download)
 
# build rtgenmsg header and add it to the message
rtgenmsg_header = rtnetlink.RtGenMessageHeader(socket.AF_PACKET)
rtnlmsg.put_extra_header(rtgenmsg_header)
 

src/s/c/scapy-real-2.2.0-dev/scapy/arch/linux.py   scapy-real(Download)
    def __init__(self, type = ETH_P_ALL, filter=None, promisc=None, iface=None, nofilter=0):
        self.type = type
        self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))
        self.ins.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 0)
        _flush_fd(self.ins)
                attach_filter(self.ins, filter)
        self.ins.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 2**30)
        self.outs = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))
        self.outs.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2**30)
        if promisc is None:
    def __init__(self, iface = None, type = ETH_P_ALL, filter=None, nofilter=0):
        if iface is None:
            iface = conf.iface
        self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))
        self.ins.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 0)
    def __init__(self, iface = None, type = ETH_P_ALL, promisc=None, filter=None, nofilter=0):
        self.type = type
        self.outs = None
        self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))
        self.ins.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 0)

src/s/c/scapy-real-2.2.0-dev/scapy/supersocket.py   scapy-real(Download)
    def __init__(self, type = ETH_P_IP, filter=None, iface=None, promisc=None, nofilter=0):
        self.outs = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW)
        self.outs.setsockopt(socket.SOL_IP, socket.IP_HDRINCL, 1)
        self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))
        if iface is not None:

src/s/c/scapy-real-2.2.0-dev/scapy/layers/inet6.py   scapy-real(Download)
    def __init__(self, type = ETH_P_IPV6, filter=None, iface=None, promisc=None, nofilter=0):
        L3RawSocket.__init__(self, type, filter, iface, promisc)
        # NOTE: if fragmentation is needed, it will be done by the kernel (RFC 2292)
        self.outs = socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_RAW)
        self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))

src/c/o/conwc-HEAD/trunk/docs/research/ClusterController.py   conwc(Download)
    def getMac(self):
        s = socket.socket(socket.AF_PACKET,socket.SOCK_RAW)
        s.bind(("eth0",9999))
        mac = s.getsockname()[-1]
        return "".join(["%02x" % ord(x) for x in mac])

src/t/o/torrentcast-HEAD/BTL/ifaddrs.py   torrentcast(Download)
        d['port'] = sin.sin_port or None
        d['addr'] = '.'.join([ str(ord(x)) for x in struct.pack('I', sin.sin_addr.s_addr) ])
    elif hasattr(socket, 'AF_PACKET') and sa.sa_family == socket.AF_PACKET:
        sll = cast(addr, POINTER(sockaddr_ll))[0]
        #d['ifindex'] = sll.sll_ifindex
                if (d.get('addr') is not None and
                    hasattr(socket, 'AF_PACKET') and
                    d['addr'].get('family') == socket.AF_PACKET):
 
                    nds = cast(ifa[0].ifa_data, POINTER(net_device_stats))[0]

src/a/r/arprequest-0.3/arprequest.py   arprequest(Download)
        self.if_ipaddr = socket.gethostbyname(socket.gethostname())
 
        self.socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 
                                                        socket.SOCK_RAW)
        self.socket.bind((if_name, socket.SOCK_RAW))

src/f/e/fechter-0.0.4/fechter/platform.py   fechter(Download)
def _send_arp(ifname, address):
    """Send out a gratuitous on interface C{ifname}."""
    # Try to get hold of a socket:
    try:
        ether_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)