2006-02-02 16:43:41 +01:00
|
|
|
#ifndef _PLUGIN_HELPER_H
|
|
|
|
#define _PLUGIN_HELPER_H
|
|
|
|
|
2006-02-02 16:49:14 +01:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
2006-02-02 16:43:41 +01:00
|
|
|
#include "netpkt.h"
|
|
|
|
#include "list.h"
|
|
|
|
#include "plugin.h"
|
|
|
|
|
2006-02-02 16:49:14 +01:00
|
|
|
extern int server_add(uint16_t gameid, uint32_t ip, uint16_t port1, uint16_t port2);
|
2006-02-02 16:43:41 +01:00
|
|
|
|
|
|
|
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);
|
2006-02-02 16:47:20 +01:00
|
|
|
extern int pkt_memmem(struct net_pkt *pkt, unsigned int offset, char *search, unsigned int size);
|
|
|
|
extern struct net_pkt * pkt_merge(struct net_pkt *pkt1, struct net_pkt *pkt2);
|
2006-02-02 16:43:41 +01:00
|
|
|
|
|
|
|
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);
|
2006-02-02 16:47:20 +01:00
|
|
|
extern int pkt_sameaddr(struct net_pkt *pkt1, struct net_pkt *pkt2);
|
|
|
|
extern int pkt_parse_int(struct net_pkt *pkt, unsigned int offset, int *val);
|
|
|
|
extern int pkt_parse_ip(struct net_pkt *pkt, int offset, struct in_addr *ip);
|
|
|
|
extern char * pkt_print(struct net_pkt *pkt);
|
2006-02-02 16:43:41 +01:00
|
|
|
|
|
|
|
#endif /* _PLUGIN_HELPER_H */
|