43 lines
1.2 KiB
C
43 lines
1.2 KiB
C
#ifndef _PLUGIN_H
|
|
#define _PLUGIN_H
|
|
|
|
#include "netpkt.h"
|
|
#include "configfile.h"
|
|
#include "list.h"
|
|
|
|
extern int server_add(u_int16_t gameid, u_int32_t ip, u_int16_t port1, u_int16_t port2);
|
|
|
|
struct scan_ports {
|
|
unsigned short portlo;
|
|
unsigned short porthi;
|
|
unsigned short gameid;
|
|
};
|
|
|
|
extern int pkt_send(struct in_addr *dstip, unsigned int dstport, char *buf, unsigned int size);
|
|
extern int pkt_send_portarr(struct in_addr *dstip, struct scan_ports *portarr, char *buf, unsigned int size);
|
|
|
|
extern int pkt_check_portarr(struct net_pkt *pkt, struct scan_ports *portarr);
|
|
extern int pkt_memcmp(struct net_pkt *pkt, unsigned int offset, char *search, unsigned int size);
|
|
extern void * pkt_memmem(struct net_pkt *pkt, unsigned int offset, char *search, unsigned int size);
|
|
|
|
extern int server_add_pkt(unsigned int gameid, struct net_pkt *pkt);
|
|
|
|
extern char * pkt_ntoa(struct net_pkt *pkt);
|
|
extern unsigned short pkt_getport(struct net_pkt *pkt);
|
|
extern int pkt_atoi(struct net_pkt *pkt, void *p);
|
|
|
|
struct hlswmaster_plugin {
|
|
struct list_head list;
|
|
|
|
char name[32];
|
|
void *dlref;
|
|
|
|
int (*init)(struct conf_section *config);
|
|
int (*fini)(void);
|
|
int (*scan)(void);
|
|
int (*parse)(struct net_pkt *pkt);
|
|
int (*gc)(int timeout);
|
|
};
|
|
|
|
#endif /* _PLUGIN_H */
|