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

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

  if [[ $testCase == 'C' ]]; then
    r=$(sudo killall nrd 2>&1)
  fi
}

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
}

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

  sleep 2
}


check_nfd_status_counters() {
  faceId=$1
  faceUri=$2
  counterType=$3
  threshold=$4

  outCounter=$(nfd-status | grep -iF 'faceid='$faceId' remote='$faceUri | grep -Po $counterType={[0-9]+ | sed 's/'$counterType'={//')


  if [[ $outCounter -lt $threshold ]]; then
    if [[ "out" = $counterType ]]; then
      echo "nfd-status: out counter of face=$faceId is less than $threshold " >> $testLog
      echo "nfd-status is:" >> $testLog
      nfd-status >> $testLog
      clean_up
    fi
    exit 2

  fi

}

# check for the existence of the face
# param list: $1 - face Id
#             $2 - face Uri
check_nfd_status_face_existence() {
  faceId=$1
  faceUri=$2

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

  if [[ "none" != $faceId ]]; then
    if [[ $face != $faceId ]]; then
      echo "nfd-status: Failed to find face $faceId of $faceUri" >> $testLog
      echo "nfd-status is:" >> $testLog
      nfd-status >> $testLog
      echo "-1"
    else
      echo $face
    fi
  else
    echo $face
  fi

}


# This function checks for the existence of a face and a fib entry
# including nexthop records
# param list: $1 - face Id
#             $2 - face Uri
#             $3 - prefix
#             $4 - cost
check_nfd_status_correctness() {
  faceId=$1
  faceUri=$2
  prefix=$3
  cost=$4

  face=$(check_nfd_status_face_existence $faceId $faceUri)
  if [[ "-1" = $face ]]; then
    clean_up
    exit 2
  fi

  # check the existence of prefix FIB entry
  fibEntry=$(nfd-status | grep $prefix)
  if [[ -z "$fibEntry" ]]; then
    echo "nfd-status: Failed to find $prefix in FIB table" >> $testLog
    echo "nfd-status is:" >> $testLog
    nfd-status >> $testLog
    clean_up
    exit 2
  fi

  # check the correctness of cost on nexthop records
  fibEntryCost=$(echo $fibEntry | grep -Po 'faceid='$faceId'.\(cost=[0-9]+\)' | sed 's/faceid='$faceId' //' | sed 's/(cost=//' | sed 's/)//')

  if [[ $cost != $fibEntryCost ]]; then
    echo "nfd-status: nexthop records are incorrect, expected cost is $cost, cost in records $fibEntryCost" >> $testLog
    echo "nfd-status is:" >> $testLog
    nfd-status >> $testLog
    clean_up
    exit 2
  fi
}