// File: dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::UpdateAdapters(bool&, std::set<CMACAddress, std::less<CMACAddress>, std::allocator<CMACAddress>> const&)
void CDlanMonitor::UpdateAdapters(
  bool& bUpdate,
  const std::set<CMACAddress>& setAdapters)
{
  for(std::set<CMACAddress>::const_iterator itAdapter = setAdapters.begin(); 
    (itAdapter != setAdapters.end()); ++itAdapter)
  {
    if((*itAdapter != CMACAddress::Null()) && (m_mapNICs.find(*itAdapter) == m_mapNICs.end()))
      m_mapNICs.insert(std::make_pair(*itAdapter,NetwAdapter()));
  }

  std::map<CMACAddress,NetwAdapter>::iterator itNIC = m_mapNICs.begin();
  while(itNIC != m_mapNICs.end())
  {
    if(setAdapters.find(itNIC->first) == setAdapters.end())
    {
      while(!itNIC->second.mapLocalDevices.empty())
      {
        bUpdate = true;
        m_listLocalDevices.erase(itNIC->second.mapLocalDevices.begin()->second.itPublicDevice);
        itNIC->second.mapLocalDevices.erase(itNIC->second.mapLocalDevices.begin());
      }

      while(!itNIC->second.queuePendingPackets.empty()) 
      {
        delete itNIC->second.queuePendingPackets.front();
        itNIC->second.queuePendingPackets.pop();
      }

      m_mapNICs.erase(itNIC++);      
    }
    else
    {
      ++itNIC;
    }
  } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x510, %rsp            # imm = 0x510
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x488(%rbp)
movq -0x18(%rbp), %rdi
callq 0x179b0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x179e0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xe190
testb $0x1, %al
jne 0x111a2
jmp 0x1138a
leaq -0x20(%rbp), %rdi
callq 0xe1c0
movq %rax, -0x4a0(%rbp)
leaq -0x2e(%rbp), %rdi
movq %rdi, -0x498(%rbp)
callq 0xb750
movq -0x4a0(%rbp), %rdi
movq -0x498(%rbp), %rsi
callq 0xd590
movb %al, -0x489(%rbp)
jmp 0x111dd
movb -0x489(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x4a1(%rbp)
jne 0x111f2
jmp 0x1125c
movq -0x488(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x4b8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xe1c0
movq -0x4b8(%rbp), %rdi
movq %rax, %rsi
callq 0x17a40
movq %rax, -0x4b0(%rbp)
jmp 0x11227
movq -0x488(%rbp), %rdi
movq -0x4b0(%rbp), %rax
movq %rax, -0x48(%rbp)
addq $0xa8, %rdi
callq 0x17a70
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x17a10
movb %al, -0x4a1(%rbp)
movb -0x4a1(%rbp), %al
movb %al, -0x4b9(%rbp)
leaq -0x2e(%rbp), %rdi
callq 0x6b70
movb -0x4b9(%rbp), %al
testb $0x1, %al
jne 0x11280
jmp 0x1137a
movq -0x488(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x4d8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xe1c0
movq %rax, -0x4d0(%rbp)
leaq -0x418(%rbp), %rdi
movq %rdi, -0x4c8(%rbp)
callq 0x17b20
movq -0x4d0(%rbp), %rsi
movq -0x4c8(%rbp), %rdx
leaq -0x238(%rbp), %rdi
callq 0x17ae0
jmp 0x112d3
movq -0x4d8(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x17aa0
movb %dl, -0x4e1(%rbp)
movq %rax, -0x4e0(%rbp)
jmp 0x112f5
movb -0x4e1(%rbp), %al
movq -0x4e0(%rbp), %rcx
movq %rcx, -0x428(%rbp)
movb %al, -0x420(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x17c50
leaq -0x418(%rbp), %rdi
callq 0x86d0
jmp 0x1137a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2e(%rbp), %rdi
callq 0x6b70
jmp 0x1162b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x11369
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x17c50
leaq -0x418(%rbp), %rdi
callq 0x86d0
jmp 0x1162b
jmp 0x1137c
leaq -0x20(%rbp), %rdi
callq 0xe1f0
jmp 0x1117f
movq -0x488(%rbp), %rdi
addq $0xa8, %rdi
callq 0x17c80
movq %rax, -0x430(%rbp)
movq -0x488(%rbp), %rdi
addq $0xa8, %rdi
callq 0x17a70
movq %rax, -0x438(%rbp)
leaq -0x430(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0x17cb0
testb $0x1, %al
jne 0x113da
jmp 0x11622
movq -0x18(%rbp), %rax
movq %rax, -0x4f0(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x17d40
movq -0x4f0(%rbp), %rdi
movq %rax, %rsi
callq 0x17d10
movq %rax, -0x440(%rbp)
movq -0x18(%rbp), %rdi
callq 0x179e0
movq %rax, -0x448(%rbp)
leaq -0x440(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x17ce0
testb $0x1, %al
jne 0x11433
jmp 0x11611
jmp 0x11435
leaq -0x430(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x160, %rdi            # imm = 0x160
callq 0x17d60
xorb $-0x1, %al
testb $0x1, %al
jne 0x1145f
jmp 0x1153f
movq -0x488(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x1, (%rcx)
addq $0x90, %rax
movq %rax, -0x500(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x160, %rdi            # imm = 0x160
callq 0x17dd0
movq %rax, -0x458(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x17e00
movq %rax, %rsi
addq $0x8, %rsi
addq $0x8, %rsi
leaq -0x450(%rbp), %rdi
callq 0x17e20
movq -0x500(%rbp), %rdi
movq -0x450(%rbp), %rsi
callq 0x17d80
movq %rax, -0x460(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x17d40
addq $0x8, %rax
addq $0x160, %rax            # imm = 0x160
movq %rax, -0x4f8(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x160, %rdi            # imm = 0x160
callq 0x17dd0
movq -0x4f8(%rbp), %rdi
movq %rax, -0x468(%rbp)
movq -0x468(%rbp), %rsi
callq 0x17e40
movq %rax, -0x470(%rbp)
jmp 0x11435
jmp 0x11541
leaq -0x430(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x190, %rdi            # imm = 0x190
callq 0x17e80
xorb $-0x1, %al
testb $0x1, %al
jne 0x11568
jmp 0x115cc
leaq -0x430(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x190, %rdi            # imm = 0x190
callq 0x17ea0
movq (%rax), %rax
movq %rax, -0x508(%rbp)
cmpq $0x0, %rax
je 0x115a8
movq -0x508(%rbp), %rdi
movl $0x8, %esi
callq 0x5330
leaq -0x430(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x190, %rdi            # imm = 0x190
callq 0x17ec0
jmp 0x11541
movq -0x488(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x510(%rbp)
leaq -0x430(%rbp), %rdi
xorl %esi, %esi
callq 0x17f20
movq -0x510(%rbp), %rdi
movq %rax, -0x478(%rbp)
movq -0x478(%rbp), %rsi
callq 0x17ee0
movq %rax, -0x480(%rbp)
jmp 0x1161d
leaq -0x430(%rbp), %rdi
callq 0x17f60
jmp 0x113a4
addq $0x510, %rsp            # imm = 0x510
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5530
nopw %cs:(%rax,%rax)