// File: dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::OnThunderNetworkInfoConfirm(CMACAddress const&, HomePlugAvMMEs::ThunderNetworkInfo::CConfirm const&)
void CDlanMonitor::OnThunderNetworkInfoConfirm(
  const CMACAddress& adapter, 
  const HomePlugAvMMEs::ThunderNetworkInfo::CConfirm& mme)
{
  std::map<CMACAddress,NetwAdapter>::iterator itNIC;
  
  if((itNIC = m_mapNICs.find(adapter)) != m_mapNICs.end())
  {

    NetworkInfoResponse nwinfo(mme.GetCCoAddress(), mme.GetStations());

    std::list<HomePlugAvMMEs::ThunderNetworkInfo::StationInfo>::const_iterator itStation = nwinfo.stations.begin();
    for( ; (itStation != nwinfo.stations.end()); itStation++)
    {
      if((itStation->GetTxCodedRate() == 255) || (itStation->GetRxCodedRate() == 255))
        break;
    }
    if(itStation == nwinfo.stations.end())
    {
      ThunderNetworkInfo(itNIC, mme.GetAddress(), nwinfo);
    }
    else if(!itNIC->second.bNetworkInfoV1Sent)
    {
      itNIC->second.bNetworkInfoV1Sent = true;
      itNIC->second.queuePendingPackets.push(
        new HomePlugAvMMEs::ThunderNetworkInfoV1::CRequest(CMACAddress::Broadcast(), itNIC->first));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x193b0
movq -0xe0(%rbp), %rdi
addq $0xa8, %rdi
movq -0x10(%rbp), %rsi
callq 0x17a40
movq -0xe0(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
addq $0xa8, %rdi
callq 0x17a70
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x17cb0
testb $0x1, %al
jne 0x16a2b
jmp 0x16d50
movq -0x18(%rbp), %rsi
leaq -0x56(%rbp), %rdi
callq 0x1a840
movq -0x18(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x1a870
jmp 0x16a47
leaq -0x50(%rbp), %rdi
leaq -0x56(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x1a910
jmp 0x16a5a
leaq -0x70(%rbp), %rdi
callq 0x96e0
leaq -0x56(%rbp), %rdi
callq 0x6b70
leaq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0x1a970
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1a9a0
leaq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0x1a9c0
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x1a9a0
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x18780
testb $0x1, %al
jne 0x16ad6
jmp 0x16b88
leaq -0x88(%rbp), %rdi
callq 0x187e0
movq %rax, %rdi
callq 0x1a9f0
movl %eax, -0xe4(%rbp)
jmp 0x16af2
movl -0xe4(%rbp), %eax
cmpl $0xff, %eax
je 0x16b28
leaq -0x88(%rbp), %rdi
callq 0x187e0
movq %rax, %rdi
callq 0x1aa10
movl %eax, -0xe8(%rbp)
jmp 0x16b1b
movl -0xe8(%rbp), %eax
cmpl $0xff, %eax
jne 0x16b6c
jmp 0x16b88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x16b4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x96e0
leaq -0x56(%rbp), %rdi
callq 0x6b70
jmp 0x16d59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x16d45
jmp 0x16b6e
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
callq 0x1aa30
movq %rax, -0xa8(%rbp)
jmp 0x16a93
leaq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0x1a9c0
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x1a9a0
leaq -0x88(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1aa60
testb $0x1, %al
jne 0x16bc8
jmp 0x16c33
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rsi
leaq -0xc6(%rbp), %rdi
callq 0x1aa90
jmp 0x16be5
movq -0xe0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
leaq -0xc6(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x16d70
jmp 0x16c05
leaq -0xc6(%rbp), %rdi
callq 0x6b70
jmp 0x16d3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xc6(%rbp), %rdi
callq 0x6b70
jmp 0x16d45
leaq -0x20(%rbp), %rdi
callq 0x17d40
testb $0x1, 0x10(%rax)
jne 0x16d38
leaq -0x20(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x17d40
movq -0x100(%rbp), %rdi
movb $0x1, 0x10(%rax)
callq 0x17d40
addq $0x198, %rax            # imm = 0x198
movq %rax, -0xf8(%rbp)
movl $0x28, %edi
callq 0x5320
movq %rax, -0xf0(%rbp)
jmp 0x16c86
movb $0x1, -0xd7(%rbp)
leaq -0xd6(%rbp), %rdi
callq 0x6940
jmp 0x16c9b
leaq -0x20(%rbp), %rdi
callq 0x17d40
movq -0xf0(%rbp), %rdi
movq %rax, %rdx
leaq -0xd6(%rbp), %rsi
callq 0x1aac0
jmp 0x16cbc
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rax
movb $0x0, -0xd7(%rbp)
movq %rax, -0xd0(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0x182a0
jmp 0x16ce6
leaq -0xd6(%rbp), %rdi
callq 0x6b70
jmp 0x16d38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x16d1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xd6(%rbp), %rdi
callq 0x6b70
testb $0x1, -0xd7(%rbp)
jne 0x16d25
jmp 0x16d36
movq -0xf0(%rbp), %rdi
movl $0x28, %esi
callq 0x5330
jmp 0x16d45
jmp 0x16d3a
leaq -0x50(%rbp), %rdi
callq 0x96b0
jmp 0x16d50
leaq -0x50(%rbp), %rdi
callq 0x96b0
jmp 0x16d59
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x5530
nopw %cs:(%rax,%rax)