OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [lwip_tcpip/] [current/] [host/] [extractdump.py] - Blame information for rev 817

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#!/usr/bin/python
2
 
3
import sys
4
import re
5
import binascii
6
 
7
def extract_pppdump(input, output):
8
 
9
        fi = open(input, "r")
10
        fo = open(output, "wb")
11
        p = re.compile("PPPDUMP:(.*)")
12
        for line in fi.readlines():
13
                m = p.match(line)
14
                if m == None:
15
                        continue
16
                hex = m.group(1).strip()
17
                data = binascii.unhexlify(hex)
18
                fo.write(data)
19
        fi.close()
20
        fo.close()
21
 
22
# command line parsing
23
if len(sys.argv) != 3:
24
        print "Usage: extractdump.py [input] [output]"
25
        sys.exit()
26
 
27
extract_pppdump(sys.argv[1], sys.argv[2])

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.