/*
 * Copyright (c) 2015 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef included_vnet_ping_h
#define included_vnet_ping_h


#include <vnet/ip/ip.h>

#include <vnet/ip/lookup.h>

typedef enum
{
  PING_RESPONSE_IP6 = 42,
  PING_RESPONSE_IP4,
} ping_response_type_t;

#define foreach_ip46_ping_result                                      \
  _ (OK, "OK")                                                        \
  _ (ALLOC_FAIL, "packet allocation failed")                          \
  _ (NO_INTERFACE, "no egress interface")                             \
  _ (NO_TABLE, "no IPv6 Table for lookup")                            \
  _ (NO_SRC_ADDRESS, "no source address for egress interface")        \

typedef enum
{
#define _(v, s) SEND_PING_##v,
    foreach_ip46_ping_result
#undef _
} send_ip46_ping_result_t;

/*
 * Currently running ping command.
 */
typedef struct ping_run_t
{
  u16 icmp_id;
  u16 curr_seq;
  uword cli_process_id;
  uword cli_thread_index;
} ping_run_t;

typedef struct ping_main_t
{
  ip6_main_t *ip6_main;
  ip4_main_t *ip4_main;
  ping_run_t *ping_runs;
  /* hash table to find back the CLI process for a reply */
  // uword *cli_proc_by_icmp_id;
  ping_run_t *ping_run_by_icmp_id;
} ping_main_t;

extern ping_main_t ping_main;

#define PING_DEFAULT_DATA_LEN 60
#define PING_DEFAULT_INTERVAL 1.0

#define PING_MAXIMUM_DATA_SIZE (VLIB_BUFFER_DATA_SIZE - sizeof(ip6_header_t) - sizeof(icmp46_header_t) - offsetof(icmp46_echo_request_t, data))

/* *INDENT-OFF* */

typedef CLIB_PACKED (struct {
  u16 id;
  u16 seq;
  f64 time_sent;
  u8 data[0];
}) icmp46_echo_request_t;


typedef CLIB_PACKED (struct {
  ip6_header_t ip6;
  icmp46_header_t icmp;
  icmp46_echo_request_t icmp_echo;
}) icmp6_echo_request_header_t;

typedef CLIB_PACKED (struct {
  ip4_header_t ip4;
  icmp46_header_t icmp;
  icmp46_echo_request_t icmp_echo;
}) icmp4_echo_request_header_t;

/* *INDENT-ON* */


typedef struct
{
  u16 id;
  u16 seq;
  u8 bound;
} icmp_echo_trace_t;




typedef enum
{
  ICMP6_ECHO_REPLY_NEXT_DROP,
  ICMP6_ECHO_REPLY_NEXT_PUNT,
  ICMP6_ECHO_REPLY_N_NEXT,
} icmp6_echo_reply_next_t;

typedef enum
{
  ICMP4_ECHO_REPLY_NEXT_DROP,
  ICMP4_ECHO_REPLY_NEXT_PUNT,
  ICMP4_ECHO_REPLY_N_NEXT,
} icmp4_echo_reply_next_t;

#endif /* included_vnet_ping_h */
