58 log_fatal (
"attempted to reinitialize icmp protocol");
61 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
66 log_fatal (
"Can't register icmp object type: %s",
93 log_error (
"unable to create icmp socket: %m");
97#if defined (HAVE_SETFD)
99 log_error (
"Can't set close-on-exec on icmp: %m");
105 (
char *)&state,
sizeof state) < 0)
106 log_fatal (
"Can't disable SO_DONTROUTE on ICMP: %m");
112 log_fatal (
"Can't register icmp handle: %s",
141 log_fatal (
"ICMP protocol used before initialization.");
143 memset (&to, 0,
sizeof(to));
145 to.sin_len =
sizeof to;
149 memcpy (&to.sin_addr, addr -> iabuf,
sizeof to.sin_addr);
155#if SIZEOF_STRUCT_IADDR_P == 8
168 char *buf = (
char *)0;
180 iov [0].buf = (
char *)addr;
181 iov [0].len =
sizeof *addr;
196 if (status !=
sizeof icmp)
235 if (status < hlen + (
sizeof *
icfrom)) {
248 if (state -> icmp_handler) {
249 memcpy (ia.
iabuf, &from.sin_addr,
sizeof from.sin_addr);
250 ia.
len =
sizeof from.sin_addr;
255 iov [0].buf = (
char *)&ia;
263 (*state -> icmp_handler) (ia,
icbuf, len);
273 ia = (
struct iaddr *)buf;
278 (
int)(length -
sizeof ia));
287 if (length != (
sizeof (
struct icmp) +
sizeof (ia))) {
288 log_error (
"trace_icmp_output_input: data size mismatch %d:%d",
289 length, (
int)(
sizeof (
struct icmp) +
sizeof (ia)));
void trace_icmp_input_input(trace_type_t *, unsigned, char *)
void trace_icmp_input_stop(trace_type_t *)
void trace_icmp_output_stop(trace_type_t *)
void trace_icmp_output_input(trace_type_t *, unsigned, char *)
int icmp_readsocket(omapi_object_t *h)
int icmp_echorequest(struct iaddr *addr)
void icmp_startup(int routep, void *handler)
isc_result_t icmp_echoreply(omapi_object_t *h)
struct icmp_state * icmp_state
const char * piaddr(const struct iaddr addr)
#define OMAPI_OBJECT_ALLOC(name, stype, type)
isc_result_t omapi_register_io_object(omapi_object_t *, int(*)(omapi_object_t *), int(*)(omapi_object_t *), isc_result_t(*)(omapi_object_t *), isc_result_t(*)(omapi_object_t *), isc_result_t(*)(omapi_object_t *))
isc_result_t omapi_object_type_register(omapi_object_type_t **, const char *, isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *), isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **), isc_result_t(*)(omapi_object_t *, const char *, int), isc_result_t(*)(omapi_object_t *, const char *, va_list), isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t **, omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t **, omapi_object_t *), isc_result_t(*)(omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t *, const char *, int), isc_result_t(*)(omapi_object_t **, const char *, int), isc_result_t(*)(size_t), size_t, isc_result_t(*)(omapi_object_t *, const char *, int), int)
void dfree(void *, const char *, int)
int log_error(const char *,...) __attribute__((__format__(__printf__
void log_fatal(const char *,...) __attribute__((__format__(__printf__
u_int32_t checksum(unsigned char *buf, unsigned nbytes, u_int32_t sum)
u_int32_t wrapsum(u_int32_t sum)
trace_type_t * trace_type_register(const char *, void *, void(*)(trace_type_t *, unsigned, char *), void(*)(trace_type_t *), const char *, int)
isc_result_t trace_get_packet(trace_type_t **, unsigned *, char **)
isc_result_t trace_write_packet_iov(trace_type_t *, int, trace_iov_t *, const char *, int)