Menu

Fixed crash with new Netmsg / added Decoder

2014-01-09
2014-03-29
  • Andreas Becker

    Andreas Becker - 2014-01-09

    Hi all,

    we created some patches, to prevent the VTS from crashing, when it receives some new Netmsgs.
    We fixed the problem (unhandled Exception)
    add the Names of the new Netmsgs
    * updated the decoder

    Could somebody of the developers please import these patches?

    Thanks,
    Andreas

    Fix the problem:

    diff --git a/BACnetLibrary/BACnet.hpp b/BACnetLibrary/BACnet.hpp
    index b09c35f..34ba6a6 100644
    --- a/BACnetLibrary/BACnet.hpp
    +++ b/BACnetLibrary/BACnet.hpp
    @@ -2017,6 +2017,18 @@ enum BACnetNetworkMessageType
    , InitializeRoutingTableAck = 0x07
    , EstablishConnectionToNetwork = 0x08
    , DisconnectConnectionToNetwork = 0x09
    +
    + , ChallengeRequest = 0x0A
    + , SecurityPayload = 0x0B
    + , SecurityResponse = 0x0C
    + , RequestKeyUpdate = 0x0D
    + , UpdateKeySet = 0x0E
    +
    + , UpdateDistributionKey = 0x0F
    + , RequestMasterKey = 0x10
    + , SetMasterKey = 0x11
    + , WhatIsNetworkNumber = 0x12
    + , NetworkNumberIs = 0x13
    };

    class BACnetNetClient;
    diff --git a/BACnetLibrary/BACnetRouter.cpp b/BACnetLibrary/BACnetRouter.cpp
    index 07aa378..3dbb65f 100644
    --- a/BACnetLibrary/BACnetRouter.cpp
    +++ b/BACnetLibrary/BACnetRouter.cpp
    @@ -651,7 +651,37 @@ void BACnetRouter::ProcessNetMessage(

        case DisconnectConnectionToNetwork:
            break;
    
    • +
    • case ChallengeRequest:
    • break;
      +
    • case SecurityPayload:
    • break;
      +
    • case SecurityResponse:
    • break;
      +
    • case RequestKeyUpdate:
    • break;
      +
    • case UpdateKeySet:
    • break;
      +
    • case UpdateDistributionKey:
    • break;
      +
    • case RequestMasterKey:
    • break;
      +
    • case SetMasterKey:
    • break;
      +
    • case WhatIsNetworkNumber:
    • break;
      +
    • case NetworkNumberIs:
    • break;
      +
      default:
      throw_(5); // unknown message type
      }
      --

    REMOVE unhandled throw_(5) ??

    Add Name Strings

    diff --git a/Sniffer/StringTables.cpp b/Sniffer/StringTables.cpp
    index 7588742..eeadea6 100644
    --- a/Sniffer/StringTables.cpp
    +++ b/Sniffer/StringTables.cpp
    @@ -2026,6 +2026,19 @@ STRING_TABLE NL_msgs[] = {
    "Initialize-Routing-Table-Ack",
    "Establish-Connection-To-Network",
    "Disconnect-Connection-To-Network",
    +
    + "Challenge-Request",
    + "Security-Payload ",
    + "Security-Response",
    + "Request-Key-Update",
    + "Update-Key-Set",
    +
    + "Update-Distribution-Key",
    + "Request-Master-Key",
    + "Set-Master-Key",
    + "What-Is-Network-Number",
    + "Network-Number-Is",
    +
    "ASHRAE-Reserved",
    "Vendor-Proprietary-Message"
    };

    Add Decoder

    diff --git a/Sniffer/BACSN015.cpp b/Sniffer/BACSN015.cpp
    index e04a4f7..e26c279 100644
    --- a/Sniffer/BACSN015.cpp
    +++ b/Sniffer/BACSN015.cpp
    @@ -1166,6 +1166,21 @@ int interp_bacnet_NL( char header, int length) / Network Layer interpreter /
    sprintf(outstr,"%"FW"s = %%u","Network Number");
    pif_show_word_hl(outstr);
    break;
    +
    + /
    0x0A .. 0x11 to default /
    +
    + case 0x12: /
    What is network number /
    + pif_show_byte("Message Type = %u What-Is-Network-Number");
    + break;
    + case 0x13: /
    Network-Number-Is/
    + pif_show_byte("Message Type = %u Network-Number-Is");
    + sprintf(outstr,"%"FW"s = %%u","Network Number");
    + pif_show_word_hl(outstr);
    + if(pif_get_byte(0) == 0)
    + pif_show_byte("learned: %u");
    + else
    + pif_show_byte("configured: %u");
    + break;
    default: pif_show_byte("Invalid Message Type = %u");
    } /
    End of switch /
    } /
    End of if proprietary message type else branch */

     
  • John Hartman

    John Hartman - 2014-02-25

    Thanks for the updates.
    I will merge them once I remember how to build VTS...

     
  • John Hartman

    John Hartman - 2014-03-29

    These changes have been merged. I also added Send dialogs for WhatIsNetworkNumber and NetworkNumberIs, and extended the "Send Vendor NPDU" dialog to allow hex entry of any network message. Not yet a release, so you need to get the source from svn.

     

Log in to post a comment.