/*
 * 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;

typedef enum
{
  SEND_PING_OK = 0,
  SEND_PING_ALLOC_FAIL,
  SEND_PING_NO_INTERFACE,
  SEND_PING_NO_TABLE,
} send_ip46_ping_result_t;

/*
 * Currently running ping command.
 */
typedef struct ping_run_t
{
  u16 icmp_id;
  u16 curr_seq;
  uword cli_process_id;
} 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;

ping_main_t ping_main;

#define PING_DEFAULT_DATA_LEN 60
#define PING_DEFAULT_INTERVAL 1.0

#define PING_MAXIMUM_DATA_SIZE 2000

typedef CLIB_PACKED (struct
		     {
		     u16 id;
		     u16 seq; f64 time_sent; u8 data[PING_MAXIMUM_DATA_SIZE];
		     }) 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;


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 */
