MLIB
Loading...
Searching...
No Matches
firewall.h
1#pragma once
2
3#if __has_include("defs.h")
4#include "defs.h"
5#endif
6
7#include "safe_winsock.h"
8
9#include <netfw.h>
10#include "errorcode.h"
11
12namespace mlib {
13
16{
17public:
18 firewall ();
19 ~firewall ();
20
21 bool is_enabled ();
22 bool is_port_enabled (int portnum, bool tcp);
23 bool has_port (int portnum, bool tcp);
24 bool has_app (const char* appname);
25 erc add_app (const char* appname, const char* filename);
26 erc add_port (int portnum, bool tcp, const char* name);
27 erc set_port (int portnum, bool tcp, bool enable);
28
29 static errfac& Errors ();
30 static void Errors (errfac& facility);
31
32private:
33 INetFwMgr* fwmgr;
34 INetFwPolicy* fwpolicy;
35 INetFwProfile* fwprofile;
36};
37
38extern errfac* fw_errptr;
39
40}; // namespace mlib
objects returned as a function result or thrown directly.
Definition errorcode.h:68
An error facility routes a group of errors handled in a similar manner.
Definition errorcode.h:136
Light wrapper for Windows firewall.
Definition firewall.h:16
Definition of erc and erfac classes.