#!/usr/bin/env bash
NUM_OF_PINGS=100

# clean up - kill nfd
clean_up() {
  r=$(ssh $CTRL_B "sudo killall nfd" 2>&1)
  r=$(sudo killall nfd 2>&1)
}

start_nfd() {
  # start nfd on localhost
  sudo nfd &> $workdir/logs/nfd.log &

  # start nfd on hostB
  ssh $CTRL_B "mkdir -p $workdir/logs ; sudo nfd &> $workdir/logs/nfd.log & sleep 2"
  sleep 2
}

# check whether a given face with the specified FaceId and URI has had at least a given number of
# incoming/outgoing Interests
# param list: $1 - face ID
#             $2 - face URI
#             $3 - counter type (in/out)
#             $4 - minimum successful value of the counter
check_nfdc_face_counters() {
  local faceId=$1
  local faceUri=$2
  local counterType=$3
  local threshold=$4

  # wait for the refreshed output of nfd-status
  sleep 2

  local counter=$(nfdc face list | grep -iF "faceid=$faceId remote=$faceUri" | sed -E "s/.*${counterType}=\{([0-9]+)i.*/\1/")

  if [[ $counter -lt $threshold ]]; then
    echo "nfdc: $counterType counter of face=$faceId is less than $threshold " >> $testLog
    echo "'nfdc face list' is:" >> $testLog
    nfdc face list >> $testLog
    clean_up
    exit 2
  fi
}

# check for the existence of a face with the specified FaceId and URI
# param list: $1 - face ID
#             $2 - face URI
check_nfdc_face_existence() {
  local faceId=$1
  local faceUri=$2

  # wait for the refreshed output of nfdc
  sleep 2

  # check for the existence of the specified face
  # First, get the face line
  # Second, extract the face id attached to the fetched line
  local face=$(nfdc face list | grep -iF "remote=$faceUri" | sed -E "s/.*faceid=([0-9]+).*/\1/")

  if [[ $faceId != "none" && $face != $faceId ]]; then
    echo "nfdc: Failed to find face $faceId to $faceUri" >> $testLog
    echo "'nfdc face list' is:" >> $testLog
    nfdc face list >> $testLog
    echo "-1"
  else
    echo $face
  fi
}

# check for the existence of a face with the specified FaceId and URI using `nfdc face show`
# param list: $1 - face ID
#             $2 - face URI
check_nfdc_face_existence_show() {
  local faceId=$1
  local faceUri=$2

  # wait for the refreshed output of nfdc
  sleep 2

  # check for the existence of the specified face
  # Extract the remote URI
  local actualUri=$(nfdc face show id $faceId | grep -iFo "remote=$faceUri" | sed 's/remote=//')

  if [[ "$actualUri" != "$faceUri" ]]; then
    echo "nfdc: Failed to find face $faceId to $faceUri" >> $testLog
    echo "'nfdc face show id $faceId' is:" >> $testLog
    nfdc face show id $faceId >> $testLog
    echo "-1"
  else
    echo $face
  fi
}

# check for the existence of a face with the specified FaceId and URI using `nfdc face list`, filtered
# for remote URI
# param list: $1 - face ID
#             $2 - face URI
check_nfdc_face_existence_remote_uri() {
  local faceId=$1
  local faceUri=$2

  # wait for the refreshed output of nfdc
  sleep 2

  # check for the existence of the specified face
  # First, get the face line
  # Second, extract the face id attached to the fetched line
  local face=$(nfdc face list remote $faceUri | grep -iF "remote=$faceUri" | grep -Po "faceid=[0-9]+" | sed 's/faceid=//')

  if [[ "none" != $faceId && $face != $faceId ]]; then
    echo "nfdc: Failed to find face $faceId to $faceUri" >> $testLog
    echo "'nfdc face list remote $faceUri' is:" >> $testLog
    nfdc face list >> $testLog
    echo "-1"
  else
    echo $face
  fi
}

# check for the existence of a route for a given prefix with nexthop face ID and cost
# param list: $1 - route prefix
#             $2 - nexthop face ID
#             $3 - route cost
#             $4 - if set, check if route does not exist (optional)
check_nfdc_route_existence() {
  local prefix=$1
  local nexthop=$2
  local cost=$3
  local noexist=false
  if [[ $# -gt 3 ]]; then
    noexist=true
  fi

  local routeInfo=$(nfdc route list | grep "^prefix=$prefix nexthop=$nexthop origin=[a-zA-Z0-9]* cost=$cost flags=")

  if [[ $noexist == false ]]; then
    if [[ -z $routeInfo ]]; then
      echo "nfdc: Failed to find route to $prefix with nexthop $nexthop and cost $cost" >> $testLog
      echo "'nfdc route list' is:" >> $testLog
      nfdc route list >> $testLog
      clean_up
      exit 2
    fi
  else
    if [[ -n $routeInfo ]]; then
      echo "nfdc: Failed to remove route to $prefix with nexthop" >> $testLog
      echo "'nfdc route list' is:" >> $testLog
      nfdc route list >> $testLog
      clean_up
      exit 2
    fi
  fi
}

# check for the existence of a route for a given prefix with nexthop face ID and cost using
# `nfdc route show`
# param list: $1 - route prefix
#             $2 - nexthop face ID
#             $3 - route cost
#             $4 - if set, check if route does not exist (optional)
check_nfdc_route_existence_show() {
  local prefix=$1
  local nexthop=$2
  local cost=$3
  local noexist=false
  if [[ $# -gt 3 ]]; then
    noexist=true
  fi

  local routeInfo=$(nfdc route show $prefix | grep "^prefix=$prefix nexthop=$nexthop origin=[a-zA-Z0-9]* cost=$cost flags=")

  if [[ $noexist == false ]]; then
    if [[ -z $routeInfo ]]; then
      echo "nfdc: Failed to find route to $prefix with nexthop $nexthop and cost $cost" >> $testLog
      echo "'nfdc route list' is:" >> $testLog
      nfdc route list >> $testLog
      clean_up
      exit 2
    fi
  else
    if [[ -n $routeInfo ]]; then
      echo "nfdc: Failed to remove route to $prefix with nexthop" >> $testLog
      echo "'nfdc route list' is:" >> $testLog
      nfdc route list >> $testLog
      clean_up
      exit 2
    fi
  fi
}

# check for the existence of a given route for a given nexthop
# param list: $1 - route prefix
#             $2 - nexthop face ID
#             $3 - route cost
#             $4 - if set, check if route does not exist (optional)
check_nfdc_nexthop_existence() {
  local prefix=$1
  local faceId=$2
  local cost=$3
  local noexist=false
  if [[ $# -gt 3 ]]; then
    noexist=true
  fi

  local nexthopInfo=$(nfdc fib list | grep "^  $prefix" | grep "faceid=$faceId (cost=$cost)")

  if [[ $noexist == false ]]; then
    if [[ -z $nexthopInfo ]]; then
      echo "nfdc: Failed to find route to $prefix via $faceId with cost $cost in FIB" >> $testLog
      echo "'nfdc fib list' is:" >> $testLog
      nfdc fib list >> $testLog
      clean_up
      exit 2
    fi
  else
    if [[ -n $nexthopInfo ]]; then
      echo "nfdc: Failed to remove route to $prefix via $faceId with from FIB" >> $testLog
      echo "'nfdc fib list' is:" >> $testLog
      nfdc fib list >> $testLog
      clean_up
      exit 2
    fi
  fi
}
