Did I find the right examples for you? yes no      Crawl my project      Python Jobs

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

        def mactoreadable(macaddress):
    mac_string = ""
    for i in range(5,0,-1):
        eachbyte = 0xff & int(macaddress >> (i*8))
        mac_string += ":{:02x}".format(eachbyte)
    return mac_string
        


src/a/c/AcraNetwork-0.1/examples/parser_aligned_pcap_example.py   AcraNetwork(Download)
import AcraNetwork.iNetX as inetx
import AcraNetwork.Pcap as pcap
from AcraNetwork.SimpleEthernet import mactoreadable
import AcraNetwork.ParserAligned as ParserAligned
 
                    inetx_packet = inetx.iNetX()
                    inetx_packet.unpack(udp_packet.payload)
                    readablemac = mactoreadable(eth_packet.srcmac) # handy function to return the mac address in a readable format
                    output_format = "SRCMAC={:>20s} SRCIP={:>15s} DSTPORT={:5d} StreamID={:#5x} Sequence={:10d}"
 

src/a/c/AcraNetwork-0.1/examples/simple_parser_packets_from_pcap.py   AcraNetwork(Download)
import AcraNetwork.iNetX as inetx
import AcraNetwork.Pcap as pcap
from AcraNetwork.SimpleEthernet import mactoreadable
import AcraNetwork.ParserAligned as ParserAligned
 

src/a/c/AcraNetwork-0.1/examples/pcap_to_ascii.py   AcraNetwork(Download)
import AcraNetwork.iNetX as inetx
import AcraNetwork.Pcap as pcap
from AcraNetwork.SimpleEthernet import mactoreadable
import AcraNetwork.ParserAligned as ParserAligned