summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aff6140)
raw | patch | inline | side by side (parent: aff6140)
author | Holger Weiss <holger@zedat.fu-berlin.de> | |
Mon, 1 Jun 2009 23:09:18 +0000 (01:09 +0200) | ||
committer | Holger Weiss <holger@zedat.fu-berlin.de> | |
Mon, 1 Jun 2009 23:09:18 +0000 (01:09 +0200) |
Buffers which are used for holding arbitrary data should be referenced
using pointers to void and accessed using pointers to unsigned char.
Signed-off-by: Holger Weiss <holger@zedat.fu-berlin.de>
using pointers to void and accessed using pointers to unsigned char.
Signed-off-by: Holger Weiss <holger@zedat.fu-berlin.de>
plugins-root/check_icmp.c | patch | blob | history |
index 845fc95df02b3016d83900e9d87caf883da35879..ecf3d08bd139dd0505eee5d85ad9d6bd80a63712 100644 (file)
static u_int get_timevaldiff(struct timeval *, struct timeval *);
static in_addr_t get_ip_address(const char *);
static int wait_for_reply(int, u_int);
-static int recvfrom_wto(int, char *, unsigned int, struct sockaddr *, u_int *);
+static int recvfrom_wto(int, void *, unsigned int, struct sockaddr *, u_int *);
static int send_icmp_ping(int, struct rta_host *);
static int get_threshold(char *str, threshold *th);
static void run_checks(void);
static void set_source_ip(char *);
static int add_target(char *);
static int add_target_ip(char *, struct in_addr *);
-static int handle_random_icmp(char *, struct sockaddr_in *);
+static int handle_random_icmp(unsigned char *, struct sockaddr_in *);
static unsigned short icmp_checksum(unsigned short *, int);
static void finish(int);
static void crash(const char *, ...);
}
static int
-handle_random_icmp(char *packet, struct sockaddr_in *addr)
+handle_random_icmp(unsigned char *packet, struct sockaddr_in *addr)
{
struct icmp p, sent_icmp;
struct rta_host *host = NULL;
wait_for_reply(int sock, u_int t)
{
int n, hlen;
- static char buf[4096];
+ static unsigned char buf[4096];
struct sockaddr_in resp_addr;
struct ip *ip;
struct icmp icp;
send_icmp_ping(int sock, struct rta_host *host)
{
static union {
- char *buf; /* re-use so we prevent leaks */
+ void *buf; /* re-use so we prevent leaks */
struct icmp *icp;
u_short *cksum_in;
} packet = { NULL };
}
static int
-recvfrom_wto(int sock, char *buf, unsigned int len, struct sockaddr *saddr,
+recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr,
u_int *timo)
{
u_int slen;