]> git.meshlink.io Git - catta/blob - src/iface-windows.h
skeleton implementation of interface change event handling
[catta] / src / iface-windows.h
1 #ifndef fooifacewindowshfoo
2 #define fooifacewindowshfoo
3
4 #include <catta/llist.h>
5 #include <pthread.h>
6
7 // we register with Windows to receive callbacks when IP interfaces change.
8 // we save these events in the structures below and pick them up from our
9 // own mainloop which we wake via a pipe.
10
11 typedef struct ChangeEvent ChangeEvent;
12
13 typedef struct CattaInterfaceMonitorOSDep {
14     pthread_mutex_t mutex;  // guards access to event queues and the pipe
15
16     CATTA_LLIST_HEAD(ChangeEvent, events);
17
18     int pipefd[2];      // used to wake up the mainloop and check for events
19
20     // handles for deregistering the handler and notification callbacks
21     HANDLE icnhandle;   // interface change notification handle
22     HANDLE acnhandle;   // address change notification handle
23     CattaWatch *watch;
24 } CattaInterfaceMonitorOSDep;
25
26 #endif