#!/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

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

  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

  # wait for the refreshed output of nfd-status
  sleep 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

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

  # 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
}
