X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fiface-windows.h;fp=src%2Fiface-windows.h;h=f7be1f709106bb06e4b299fb870ab25f2c45571c;hb=f1de9dcaab953757252d51b4725cbfa36daa10a5;hp=0000000000000000000000000000000000000000;hpb=7a5b2f69af7d36d6cd4153142f125fa011784e03;p=catta diff --git a/src/iface-windows.h b/src/iface-windows.h new file mode 100644 index 0000000..f7be1f7 --- /dev/null +++ b/src/iface-windows.h @@ -0,0 +1,26 @@ +#ifndef fooifacewindowshfoo +#define fooifacewindowshfoo + +#include +#include + +// we register with Windows to receive callbacks when IP interfaces change. +// we save these events in the structures below and pick them up from our +// own mainloop which we wake via a pipe. + +typedef struct ChangeEvent ChangeEvent; + +typedef struct CattaInterfaceMonitorOSDep { + pthread_mutex_t mutex; // guards access to event queues and the pipe + + CATTA_LLIST_HEAD(ChangeEvent, events); + + int pipefd[2]; // used to wake up the mainloop and check for events + + // handles for deregistering the handler and notification callbacks + HANDLE icnhandle; // interface change notification handle + HANDLE acnhandle; // address change notification handle + CattaWatch *watch; +} CattaInterfaceMonitorOSDep; + +#endif