X-Git-Url: http://git.meshlink.io/?p=catta;a=blobdiff_plain;f=src%2Fiface-windows.h;h=f7be1f709106bb06e4b299fb870ab25f2c45571c;hp=cf21c29d6833788ce59e661dcce5b3e487d4542e;hb=d1da9f9f0f312873501e42ff39a9eab26bf2ab50;hpb=dd315fb0f7a90a6f154cbea0e7a7c64b550164b9 diff --git a/src/iface-windows.h b/src/iface-windows.h index cf21c29..f7be1f7 100644 --- a/src/iface-windows.h +++ b/src/iface-windows.h @@ -1,10 +1,26 @@ #ifndef fooifacewindowshfoo #define fooifacewindowshfoo -#include "hashmap.h" +#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 { - int dummy; // silence "no members" warning + 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