udphole

Basic UDP wormhole proxy
git clone git://git.finwo.net/app/udphole
Log | Files | Refs | README | LICENSE

scheduler.h (642B)


      1 #ifndef UDPHOLE_SCHEDULER_H
      2 #define UDPHOLE_SCHEDULER_H
      3 
      4 #include "domain/protothreads.h"
      5 
      6 #include <stdint.h>
      7 #include <sys/select.h>
      8 
      9 struct pt_task;
     10 
     11 typedef char (*pt_task_fn)(struct pt *pt, int64_t timestamp, struct pt_task *task);
     12 
     13 typedef struct pt_task {
     14   struct pt pt;
     15   struct pt_task *next;
     16   pt_task_fn func;
     17   void *udata;
     18   char is_active;
     19   int maxfd;
     20 } pt_task_t;
     21 
     22 int domain_schedmod_pt_create(pt_task_fn fn, void *udata);
     23 int domain_schedmod_pt_remove(pt_task_t *task);
     24 int domain_schedmod_main(void);
     25 
     26 extern fd_set g_select_result;
     27 
     28 int domain_schedmod_has_data(int *in_fds, int **out_fds);
     29 
     30 #endif // UDPHOLE_SCHEDULER_H