25 lines
407 B
C
25 lines
407 B
C
#include <stddef.h>
|
|
|
|
#include "internal/icmp_internal.h"
|
|
#include "internal/icmp_recv.h"
|
|
|
|
int
|
|
recv_validate_params(struct icmp_handle *h, icmp_callback_t cb)
|
|
{
|
|
if (NULL == h)
|
|
return 0;
|
|
|
|
if (NULL == cb)
|
|
{
|
|
icmp_set_error_fmt(h, ICMP_ERR_INVALID, "Callback cannot be NULL");
|
|
return 0;
|
|
}
|
|
|
|
if (h->fd < 0)
|
|
{
|
|
icmp_set_error_fmt(h, ICMP_ERR_INVALID, "Invalid socket FD");
|
|
return 0;
|
|
}
|
|
|
|
return 1;
|
|
}
|