summaryrefslogtreecommitdiff
path: root/src/completion/list_dumpable_interfaces.py
blob: 67bf6206bde1ac8868f366eeeb1b68807ee74638 (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('tcpdump -D').split('\n')
    intfs = " ".join(map(lambda s: re.search(r'\d+\.(\S+)\s', s).group(1), out))
    print(intfs)