def del_from_dict(dictionary, srcip, dstip):
  """Removes an entry from the given dictionary.
  Assumed is that srcip and dstip exist in the dictionary.
  :param dictionary: dictionary to remove an entry from
  :type dictionary: dictionary
  :param srcip: source ip
  :type srcip: string
  :param dstip: destination ip
  :type dstip: string
  :return: dictionary
  """
  if len(dictionary[srcip]['targets']) <= 1:
    del dictionary[srcip]

  else:
    del dictionary[srcip]['targets'][dstip]
  return dictionary