
Marking local functions: fci_rt_db_match_criterion


Marking externally visible functions: fci_rt_db_drop_all fci_rt_db_get_next fci_rt_db_get_first fci_rt_db_remove fci_rt_db_add fci_rt_db_init


Marking externally visible variables:


Reclaiming functions:
Reclaiming variables:
Clearing address taken flags:
Symbol table:

memcmp/32 (memcmp) @07347e00
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_match_criterion/18 fci_rt_db_match_criterion/18 
  Calls: 
strcmp/31 (strcmp) @07347d20
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_match_criterion/18 
  Calls: 
pfe_phy_if_get_name/30 (pfe_phy_if_get_name) @07347c40
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_match_criterion/18 
  Calls: 
strncpy/29 (strncpy) @07347a80
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_get_first/22 
  Calls: 
oal_mm_free/28 (oal_mm_free) @073477e0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_drop_all/24 fci_rt_db_remove/21 
  Calls: 
memcpy/27 (memcpy) @07347620
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_get_first/22 fci_rt_db_get_first/22 fci_rt_db_add/20 fci_rt_db_add/20 fci_rt_db_add/20 
  Calls: 
memset/26 (memset) @07347540
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_get_first/22 fci_rt_db_add/20 
  Calls: 
oal_mm_malloc/25 (oal_mm_malloc) @07347460
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: fci_rt_db_add/20 
  Calls: 
fci_rt_db_drop_all/24 (fci_rt_db_drop_all) @073e5d20
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: oal_mm_free/28 
fci_rt_db_get_next/23 (fci_rt_db_get_next) @073e5380
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: fci_rt_db_match_criterion/18 
fci_rt_db_get_first/22 (fci_rt_db_get_first) @073e5c40
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: fci_rt_db_add/20 
  Calls: fci_rt_db_match_criterion/18 memcpy/27 memcpy/27 strncpy/29 memset/26 
fci_rt_db_remove/21 (fci_rt_db_remove) @073e57e0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: oal_mm_free/28 
fci_rt_db_add/20 (fci_rt_db_add) @073e5540
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: memcpy/27 memcpy/27 memcpy/27 memset/26 oal_mm_malloc/25 fci_rt_db_get_first/22 
fci_rt_db_init/19 (fci_rt_db_init) @073e52a0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: 
fci_rt_db_match_criterion/18 (fci_rt_db_match_criterion) @073e5000
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: fci_rt_db_get_next/23 fci_rt_db_get_first/22 
  Calls: memcmp/32 memcmp/32 strcmp/31 pfe_phy_if_get_name/30 
fci_rt_db_drop_all (struct fci_rt_db_t * db)
{
  errno_t ret;
  struct fci_rt_db_entry_t * entry;
  struct LLIST_t * aux;
  struct LLIST_t * item;
  errno_t D.11011;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  item = db->theList.prNext;
  aux = item->prNext;
  goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = item - 48B;
  entry = (struct fci_rt_db_entry_t *) _1;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = item->prPrev;
  _3 = item->prNext;
  _2->prNext = _3;
  # DEBUG BEGIN_STMT
  _4 = item->prNext;
  _5 = item->prPrev;
  _4->prPrev = _5;
  # DEBUG BEGIN_STMT
  item->prPrev = 0B;
  # DEBUG BEGIN_STMT
  item->prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_mm_free (entry);
  # DEBUG BEGIN_STMT
  item = aux;
  aux = aux->prNext;

  <bb 4> :
  # DEBUG BEGIN_STMT
  _6 = &db->theList;
  if (item != _6)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.11011 = ret;
  return D.11011;

}


fci_rt_db_get_next (struct fci_rt_db_t * db)
{
  bool_t match;
  struct fci_rt_db_entry_t * entry;
  struct fci_rt_db_entry_t * D.11009;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match = 0;
  # DEBUG BEGIN_STMT
  _1 = db->theList.prNext;
  _2 = &db->theList;
  if (_1 != _2)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = db->cur_item;
  _4 = &db->theList;
  if (_3 == _4)
    goto <bb 4>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  entry = 0B;
  goto <bb 9>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _5 = db->cur_item;
  _6 = _5 - 48B;
  entry = (struct fci_rt_db_entry_t *) _6;
  # DEBUG BEGIN_STMT
  _7 = db->cur_item;
  _8 = _7->prNext;
  db->cur_item = _8;
  # DEBUG BEGIN_STMT
  if (entry != 0B)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _9 = fci_rt_db_match_criterion (db, entry);
  if (_9 == 1)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  match = 1;
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _10 = db->cur_item;
  _11 = &db->theList;
  if (_10 != _11)
    goto <bb 5>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  if (match != 1)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  entry = 0B;

  <bb 11> :
  # DEBUG BEGIN_STMT
  D.11009 = entry;
  return D.11009;

}


fci_rt_db_get_first (struct fci_rt_db_t * db, fci_rt_db_get_criterion_t crit, const void * arg)
{
  unsigned int D.10993;
  bool_t is_unknown_crit;
  bool_t match;
  struct LLIST_t * item;
  struct fci_rt_db_entry_t * entry;
  struct fci_rt_db_entry_t * D.10992;

  <bb 2> :
  # DEBUG BEGIN_STMT
  entry = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match = 0;
  # DEBUG BEGIN_STMT
  is_unknown_crit = 0;
  # DEBUG BEGIN_STMT
  db->cur_crit = crit;
  # DEBUG BEGIN_STMT
  _1 = db->cur_crit;
  _2 = (int) _1;
  switch (_2) <default: <L6> [INV], case 0: <L22> [INV], case 1: <L1> [INV], case 2: <L2> [INV], case 3: <L3> [INV], case 4: <L4> [INV], case 5: <L5> [INV]>

  <bb 3> :
<L1>:
  # DEBUG BEGIN_STMT
  db->cur_crit_arg.iface = arg;
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 4> :
<L2>:
  # DEBUG BEGIN_STMT
  _3 = &db->cur_crit_arg.outif_name;
  memset (_3, 0, 16);
  # DEBUG BEGIN_STMT
  _4 = &db->cur_crit_arg.outif_name;
  strncpy (_4, arg, 15);
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 5> :
<L3>:
  # DEBUG BEGIN_STMT
  _5 = &db->cur_crit_arg.dst_ip;
  memcpy (_5, arg, 22);
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 6> :
<L4>:
  # DEBUG BEGIN_STMT
  _6 = &db->cur_crit_arg.dst_mac;
  memcpy (_6, arg, 6);
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 7> :
<L5>:
  # DEBUG BEGIN_STMT
  _7 = &db->cur_crit_arg.id;
  D.10993 = MEM[(char * {ref-all})arg];
  MEM[(char * {ref-all})_7] = D.10993;
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 8> :
<L6>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  is_unknown_crit = 1;
  # DEBUG BEGIN_STMT

  <bb 9> :
<L22>:
  # DEBUG BEGIN_STMT
  if (is_unknown_crit != 1)
    goto <bb 10>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _8 = db->theList.prNext;
  _9 = &db->theList;
  if (_8 != _9)
    goto <bb 11>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  item = db->theList.prNext;
  goto <bb 16>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _10 = item - 48B;
  entry = (struct fci_rt_db_entry_t *) _10;
  # DEBUG BEGIN_STMT
  _11 = item->prNext;
  db->cur_item = _11;
  # DEBUG BEGIN_STMT
  if (entry != 0B)
    goto <bb 13>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  _12 = fci_rt_db_match_criterion (db, entry);
  if (_12 == 1)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  match = 1;
  # DEBUG BEGIN_STMT
  goto <bb 17>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  item = item->prNext;

  <bb 16> :
  # DEBUG BEGIN_STMT
  _13 = &db->theList;
  if (item != _13)
    goto <bb 12>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  if (match != 1)
    goto <bb 18>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  entry = 0B;

  <bb 19> :
  # DEBUG BEGIN_STMT
  D.10992 = entry;
  return D.10992;

}


fci_rt_db_remove (struct fci_rt_db_t * db, struct fci_rt_db_entry_t * entry)
{
  errno_t ret;
  errno_t D.10980;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  _1 = &entry->list_member;
  _2 = db->cur_item;
  if (_1 == _2)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = db->cur_item;
  _4 = _3->prNext;
  db->cur_item = _4;

  <bb 4> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = entry->list_member.prPrev;
  _6 = entry->list_member.prNext;
  _5->prNext = _6;
  # DEBUG BEGIN_STMT
  _7 = entry->list_member.prNext;
  _8 = entry->list_member.prPrev;
  _7->prPrev = _8;
  # DEBUG BEGIN_STMT
  entry->list_member.prPrev = 0B;
  # DEBUG BEGIN_STMT
  entry->list_member.prNext = 0B;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  oal_mm_free (entry);
  # DEBUG BEGIN_STMT
  D.10980 = ret;
  return D.10980;

}


fci_rt_db_add (struct fci_rt_db_t * db, struct pfe_ip_addr_t * dst_ip, uint8_t[6] * src_mac, uint8_t[6] * dst_mac, struct pfe_phy_if_t * iface, uint32_t id, void * refptr, bool_t overwrite)
{
  errno_t ret;
  bool_t is_new;
  struct fci_rt_db_entry_t * new_entry;
  errno_t D.10976;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  is_new = 0;
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  new_entry = fci_rt_db_get_first (db, 5, &id);
  # DEBUG BEGIN_STMT
  if (new_entry == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  new_entry = oal_mm_malloc (56);
  # DEBUG BEGIN_STMT
  is_new = 1;
  # DEBUG BEGIN_STMT
  if (new_entry == 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret = 11;
  goto <bb 8>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  memset (new_entry, 0, 56);
  goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  is_new = 0;
  # DEBUG BEGIN_STMT
  if (overwrite == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  ret = 115;

  <bb 8> :
  # DEBUG BEGIN_STMT
  if (ret == 0)
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _1 = &new_entry->dst_ip;
  memcpy (_1, dst_ip, 22);
  # DEBUG BEGIN_STMT
  _2 = &new_entry->src_mac;
  memcpy (_2, src_mac, 6);
  # DEBUG BEGIN_STMT
  _3 = &new_entry->dst_mac;
  memcpy (_3, dst_mac, 6);
  # DEBUG BEGIN_STMT
  new_entry->iface = iface;
  # DEBUG BEGIN_STMT
  id.0_4 = id;
  new_entry->id = id.0_4;
  # DEBUG BEGIN_STMT
  new_entry->mtu = 0;
  # DEBUG BEGIN_STMT
  new_entry->refptr = refptr;
  # DEBUG BEGIN_STMT
  if (is_new == 1)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = db->theList.prPrev;
  new_entry->list_member.prPrev = _5;
  # DEBUG BEGIN_STMT
  _6 = &db->theList;
  new_entry->list_member.prNext = _6;
  # DEBUG BEGIN_STMT
  _7 = db->theList.prPrev;
  _8 = &new_entry->list_member;
  _7->prNext = _8;
  # DEBUG BEGIN_STMT
  _9 = &new_entry->list_member;
  db->theList.prPrev = _9;

  <bb 11> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.10976 = ret;
  return D.10976;

}


fci_rt_db_init (struct fci_rt_db_t * db)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &db->theList;
  db->theList.prNext = _1;
  # DEBUG BEGIN_STMT
  _2 = &db->theList;
  db->theList.prPrev = _2;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = db->theList.prNext;
  db->cur_item = _3;
  return;

}


fci_rt_db_match_criterion (struct fci_rt_db_t * db, const struct fci_rt_db_entry_t * entry)
{
  bool_t match;
  bool_t D.10996;

  <bb 2> :
  # DEBUG BEGIN_STMT
  match = 0;
  # DEBUG BEGIN_STMT
  _1 = db->cur_crit;
  _2 = (int) _1;
  switch (_2) <default: <L6> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV], case 3: <L3> [INV], case 4: <L4> [INV], case 5: <L5> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  match = 1;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _3 = entry->iface;
  _4 = db->cur_crit_arg.iface;
  _5 = _3 == _4;
  match = (bool_t) _5;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  _6 = &db->cur_crit_arg.outif_name;
  _7 = entry->iface;
  _8 = pfe_phy_if_get_name (_7);
  _9 = strcmp (_6, _8);
  _10 = _9 == 0;
  match = (bool_t) _10;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 6> :
<L3>:
  # DEBUG BEGIN_STMT
  _11 = &db->cur_crit_arg.dst_ip;
  _12 = &entry->dst_ip;
  _13 = memcmp (_11, _12, 22);
  _14 = _13 == 0;
  match = (bool_t) _14;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 7> :
<L4>:
  # DEBUG BEGIN_STMT
  _15 = &db->cur_crit_arg.dst_mac;
  _16 = &entry->dst_mac;
  _17 = memcmp (_15, _16, 6);
  _18 = _17 == 0;
  match = (bool_t) _18;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 8> :
<L5>:
  # DEBUG BEGIN_STMT
  _19 = db->cur_crit_arg.id;
  _20 = entry->id;
  _21 = _19 == _20;
  match = (bool_t) _21;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 9> :
<L6>:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  match = 0;
  # DEBUG BEGIN_STMT

  <bb 10> :
  # DEBUG BEGIN_STMT
  D.10996 = match;
  return D.10996;

}


