forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 9
/
mcontext.h
executable file
·32 lines (23 loc) · 941 Bytes
/
mcontext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef MCONTEXT_H_INCLUDED
#define MCONTEXT_H_INCLUDED
/** Thread unsafe */
#include "iheader.h"
#include "bst.h"
typedef void (*SweepCallback)(const MsgContext *MsgCtx, int Number, void *Arg);
typedef struct _ModuleContext ModuleContext;
struct _ModuleContext{
/* private */
Bst d;
/* public */
MsgContext *(*Add)(ModuleContext *c, MsgContext *MsgCtx);
void (*Del)(ModuleContext *c, MsgContext *MsgCtx);
const MsgContext *(*Find)(ModuleContext *c, MsgContext *Input);
int (*GenAnswerHeaderAndRemove)(ModuleContext *c,
MsgContext *Input,
MsgContext *Output
);
void (*Sweep)(ModuleContext *c, SweepCallback cb, void *Arg);
};
void ModuleContext_Free(ModuleContext *c);
int ModuleContext_Init(ModuleContext *c, int ItemLength);
#endif /* MCONTEXT_H_INCLUDED */