Menu

problem building my own subsystem

Help
Simon Chen
2008-12-17
2013-04-29
  • Simon Chen

    Simon Chen - 2008-12-17

    Hi all,

    I am trying to build my own subsystem class, following the example of SftpSubsystemChannel. The subsystem I am dealing with is called "netconf", a configuration method for Juniper routers. Basically, if you do "ssh -s <IP> netconf", you'll be able to type in RPC requests in XML format and get responses in XML as well.

    The syntax of the messages is actually very simple. Basically a request is:
    <rpc>
    blabla
    </rpc>
    ]]>]]>

    A response is:
    <rpc-reply>
    blabla
    </rpc-reply>
    ]]>]]>

    I have two questions. I looked at the code for SubsystemMessageStore() class. It seems that it assumes that each message starts with the message type. Also, in SubsystemChannel() class, each message start with a length. Is this true for all subsystems?

    Second, I built my own "netconf" subsystem. The debug info showed that "Channel request succeeded". But I got onMsgChannelEOF after exactly 30 seconds. Does anyone know why?

    Thanks.
    -Simon

     
    • Simon Chen

      Simon Chen - 2008-12-17

      Hi guys,

      I found where the problem is. The "netconf" subsystem just sends ascii back and forth. So, in this case, the onChannelData() function in SubsystemChannel() class will mishandle the data stream, because it tries to first read a 4-byte message size and then read byte stream of that size.

      Should we consider modify the subsystem branch to make it more general?

      Thanks.
      -Simon

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.