Olaf Rempel
9b62806411
- use c99 inttypes - added new Halflife scan (halflife) - added Battlefield2 support (gamespy2)
36 lines
1.3 KiB
C
36 lines
1.3 KiB
C
#ifndef _PLUGIN_HELPER_H
|
|
#define _PLUGIN_HELPER_H
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include "netpkt.h"
|
|
#include "list.h"
|
|
#include "plugin.h"
|
|
|
|
extern int server_add(uint16_t gameid, uint32_t ip, uint16_t port1, uint16_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 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);
|
|
|
|
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_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);
|
|
|
|
#endif /* _PLUGIN_HELPER_H */
|