SubsystemSession is internal

Oct 25, 2011 at 2:38 PM

Hi,

I've extended SSH.NET with a NetConf-client. I've let my NetConf-client implementation inherit from SubsystemSession. In the future I'd like to put my implementation in another assembly in order to minimize releasework when new versions of SSH.NET are released. However, that's not possible since SubsystemSession is declared internal. As I see it there are two feasible solutions.

1. You remove internal from SubSystemSession.

2. You include my NetConf implementation in SSH.NET. It's not very polished so you might want to make some minor adjustments to it before including it.

Do you like any of these ideas?

Best regards // Magnus  

Coordinator
Oct 25, 2011 at 3:11 PM

Hi,

 

Yeas, and I do actually both.

I didnt know if anybody would like to inherit from SubSystemSession class when I initially wrote it so I could defiantly change it to be public.

And if you  like, once you polish your code I can include it in the library as well, so you dont have to update it every time there is a new release.

 

Unfortunatly I can't get to it for next 2-3 weeks as I have to finish the other project I am working on first, but after that I can do those changes.

 

Thanks,

Oleg

Oct 25, 2011 at 6:57 PM
Hi

I can accept the task of polishing it for you if you'd like.

Also create test cases if possible.

But I need to know if you are available for communication in case I have questions.

On 25. okt. 2011, at 17:11, "olegkap" <notifications@codeplex.com> wrote:

From: olegkap

Hi,

Yeas, and I do actually both.

I didnt know if anybody would like to inherit from SubSystemSession class when I initially wrote it so I could defiantly change it to be public.

And if you like, once you polish your code I can include it in the library as well, so you dont have to update it every time there is a new release.

Unfortunatly I can't get to it for next 2-3 weeks as I have to finish the other project I am working on first, but after that I can do those changes.

Thanks,

Oleg

Coordinator
Oct 25, 2011 at 7:13 PM

 

Yea, sure no problem,

 

Yea go ahead,

I am here , I jsut can't destruct myself with other projects now since I have to finish this app which we have to show in about 3 weeks I think :(

So dont have much time left :(

Oct 26, 2011 at 10:00 AM

Hi,

That's excellent. How do you want me to post my code?

Regards // Magnus

Oct 26, 2011 at 10:04 AM

I guess I can answer my question myself. I found the patch upload feature under the source code tab now :-)

Sorry, I'm new to codeplex.

Coordinator
Oct 26, 2011 at 12:46 PM

No problem,

 

I will try to apply the patch as soon as I can and will let you know.

 

Thanks,

Oleg

Nov 1, 2011 at 11:10 AM

I've been testing to connect to a netconf server and send a few commands as well. I've corrected a few issues in the first draft which I'll upload now. Here's my test client code:

using (NetConfClient client = new NetConfClient("server", 8327, "user", "password"))
{
    client.AutomaticMessageIdHandling = true;   // Default is true
    client.Connect();
    var rpc = new XmlDocument();
    rpc.Load(@"C:\temp\rpc.xml");
    XmlDocument response = client.SendReceiveRpc(rpc);
    //XmlDocument response = client.SendReceiveRpc(File.ReadAllText(@"C:\temp\rpc.xml"));
    Console.WriteLine(response.InnerXml);
    Console.WriteLine(client.SendCloseRpc().InnerXml);
    client.Disconnect();
}
Nov 1, 2011 at 11:19 AM
Edited Nov 1, 2011 at 5:41 PM
You need to call Connect before executing s command.

  On 1. nov. 2011, at 12:10, "punxphil" <notifications@codeplex.com> wrote:

From: punxphil

I've been testing to connect to a netconf server and send a few commands as well. I've corrected a few issues in the first draft which I'll upload now. Here's my test client code:

using (NetConfClient client = new NetConfClient("server", 8327, "user", "password"))
{
    client.AutomaticMessageIdHandling = true;   // Default is true
    client.Connect();
    var rpc = new XmlDocument();
    rpc.Load(@"C:\temp\rpc.xml");
    XmlDocument response = client.SendReceiveRpc(rpc);
    //XmlDocument response = client.SendReceiveRpc(File.ReadAllText(@"C:\temp\rpc.xml"));
    Console.WriteLine(response.InnerXml);
    Console.WriteLine(client.SendCloseRpc().InnerXml);
    client.Disconnect();
}
Nov 1, 2011 at 11:44 AM

Hi Kenneth,

I don't understand what you mean?

// Magnus

Nov 1, 2011 at 5:42 PM

Never mind, I read your code wrong :(

Nov 4, 2011 at 1:26 PM

Hi

Is it possible you could direct me on how to setup a server to test NetConf? It will run in a VM.

Nov 4, 2011 at 2:51 PM

Hi Kenneth,

I've been using a server setup by other who I don't know. That server is inside a company network so you can't connect to it.

I can try to help you setup a server if you fail yourself, but I've never done it before either.

Best regards // Magnus

Nov 4, 2011 at 5:25 PM

Well I think that if we should integrate your patch, we need a system to test the code on.

If it's possible, could you talk to somebody to see if they are willing to give some information about how to set this up? I never heard of NetConf before, and I don't know what it's used for.

Is this the NetConf you are referring to: The Network Configuration Protocol, NETCONF, is an IETF network management protocol.

Do you know of any open source projects that specifically targets this protocol? Because this seems to be on a layer on top of SSH (or others). Like sending HTTP requests over an SSH tunnel, so I'm not sure if this patch is formally valid for this particular project.

If this is the case, and it's not valid for this project, I can leave the patch up, and later make a reference to it for those who need NetConf compatibility. But if you are basing your project on this compatibility layer, and are willing to maintain the patch if any problems should arise, I see no evil so to speak.

The reason I pointed out Formally, is that this is a pure SSH client project. Proxy servers isn't supported as of yet (this is one of my ToDo's thats lagging seriously behind) , so you can't proxy via a ssh tunnel to a HTTP(S) server. Nobody except me has given this feature any interest, so it's kind of low on the priorities. If this is a possible solution you can +1 the Issue.

You could create a project here on CodePlex where you provide a library for this protocol, if I have the time I would like to contribute, both on the core of it and possibly a SSH.Net compatibility layer of sorts.

I'm not against this patch, and it's not up to me if this patch should be applied. I'm just letting you know my perspective on this patch and this project.

 

Nov 7, 2011 at 6:43 AM

Yes, the link you pasted describes the NetConf I've implemented (parts of) the client for. I googled for open source servers and found this: 

http://ensuite.sourceforge.net/index.html

As I see it NetConf is just as valid for this project as SFTP which is included.

 

Dec 15, 2011 at 3:05 PM

You could also set up junos/ios trough gns3 (http://www.gns3.net/), but then you'd need the ios/junos images (which can be found with some googling). Also there is an open source netconf server called netconfd included in the yuma-package (http://www.netconfcentral.org/download)  which, I'd imagine, would suit very well for testing purposes.

Coordinator
Dec 15, 2011 at 3:10 PM

Hi,

 

Thanks,

I actually found yuma package and installed it, but not being a Linux/unix person, I could not configure it, it keep failing on authentication, event so I said it should ignore all authentication at all.

For now I included NetConf server in the code already, at this point I just thought to may be improve it, if I have server to test against.

May be add more functionlity to it, if it make sence etc'.

Thanks,

Oleg