summaryrefslogtreecommitdiffstats
path: root/src/interface_reader.hpp
blob: f38a12f139d80866fd9ac82207095f7cf60aa42f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef GETIF_INTERFACE_READER_H
#define GETIF_INTERFACE_READER_H
#include <string>
#include <vector>
#include <optional>
#include "interface.hpp"
#include "interface_read_error.hpp"

class interface_reader {
    public:
        interface_reader(std::vector<std::string> interfaces);

        std::optional<interface_read_error> read_interfaces(void);

        std::vector<interface> const& get_interfaces(void) const;

    private:
        std::vector<std::string> interface_names;

        std::vector<interface> interfaces;

        bool do_filter(void) const;
        bool interface_whitelisted(std::string const& if_name) const;

};

#endif // GETIF_INTERFACE_READER_H