1 /* 2 * Copyright 2007 Niels Provos <provos@citi.umich.edu> 3 * All rights reserved. 4 */ 5 6 #ifndef VIRUS_H_ 7 #define VIRUS_H_ 8 9 /* very simple - no timeout nothing */ 10 struct scanctx { 11 TAILQ_ENTRY(scanctx) next; 12 13 void (*cb)(const char *, void *); 14 void *cb_arg; 15 16 struct event ev_timeout; 17 }; 18 TAILQ_HEAD(scanctxq, scanctx); 19 20 struct virus_child { 21 TAILQ_ENTRY(virus_child) next; 22 23 pid_t pid; 24 25 struct bufferevent *bev; 26 int fd; 27 }; 28 29 TAILQ_HEAD(virusq, virus_child); 30 31 #define NUM_VIRUS_CHILDREN 2 32 33 int virus_init(); 34 35 void virus_scan_buffer(char *buffer, size_t buflen, 36 void (*cb)(const char *, void *), void *cb_arg); 37 38 #endif /* VIRUS_H_ */ 39