Ejemplo n.º 1
0
static void sai_neighbor_entry_to_string(
        _In_ const sai_neighbor_entry_t *neighbor_entry,
        _Out_ char * entry_string) {
    int count = 0;
    int entry_length = 0;
    count = snprintf(entry_string,
                     SAI_MAX_ENTRY_STRING_LEN,
                     "neighbor:  rif %lx",
                     neighbor_entry->rif_id);
    sai_ipaddress_to_string(neighbor_entry->ip_address,
                           SAI_MAX_ENTRY_STRING_LEN - count,
                           entry_string + count,
                           &entry_length);
    return;
}
Ejemplo n.º 2
0
static void sai_ipmc_entry_to_string(_In_ const sai_ipmc_entry_t *ipmc_entry,
                                     _Out_ char *entry_string) {
  int count = 0;
  int len = 0;
  count = snprintf(entry_string,
                   SAI_MAX_ENTRY_STRING_LEN,
                   "route: vrf %" PRIx64 " (",
                   ipmc_entry->vr_id);
  if (count > SAI_MAX_ENTRY_STRING_LEN) {
    return;
  }
  sai_ipaddress_to_string(ipmc_entry->source,
                          SAI_MAX_ENTRY_STRING_LEN - count,
                          entry_string + count,
                          &len);
  count += len;
  if (count > SAI_MAX_ENTRY_STRING_LEN) {
    return;
  }
  count +=
      snprintf(entry_string + count, SAI_MAX_ENTRY_STRING_LEN - count, ",");
  if (count > SAI_MAX_ENTRY_STRING_LEN) {
    return;
  }
  sai_ipprefix_to_string(ipmc_entry->group,
                         SAI_MAX_ENTRY_STRING_LEN - count,
                         entry_string + count,
                         &len);
  count += len;
  if (count > SAI_MAX_ENTRY_STRING_LEN) {
    return;
  }
  count +=
      snprintf(entry_string + count, SAI_MAX_ENTRY_STRING_LEN - count, ")");
  return;
}