summaryrefslogtreecommitdiff
path: root/src/completion/list_dumpable_interfaces.py
blob: 101c92fbefa27c804c91d92f035e6168aa0861cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python3

# Extract the list of interfaces available for traffic dumps from tcpdump -D

import re

from vyos.util import cmd

if __name__ == '__main__':
    out = cmd('/usr/sbin/tcpdump -D').split('\n')
    intfs = " ".join(map(lambda s: re.search(r'\d+\.(\S+)\s', s).group(1), out))
    print(intfs)