Re: [nox-dev] Nox messenger example for external c++ and nox python

2011-12-21 Thread Murphy McCauley
So NOX's messenger is a fairly generic method for communicating with external 
applications over a socket.  Built on top of this is jsonmessenger which 
communicates JSON messages over a socket.

If you specifically want to use protobufs (and not JSON messages), then you'd 
want to use the plain messenger.  However, the plain messenger is not exposed 
to Python -- only jsonmessenger is.

So I think your options are:
1) Use JSON messages instead of protobufs, and just use jsonmessenger
2) Expose messenger to Python, and then use this to send/receive protobufs
3) Use protobufs and roll your own method for communicating with your external 
application (probably using Twisted)

-- Murphy

On Dec 20, 2011, at 11:02 PM, Harshil Anil Kumar Shah wrote:

 Hi Murphy.
 Yes, I have external C++ module which I want to communicate with Nox python 
 module using protobuf. I am using libjson library at C++ module.
  
 -Harshil.
  
 From: Murphy McCauley [mailto:jam...@nau.edu] 
 Sent: Wednesday, December 21, 2011 1:38 AM
 To: Harshil Anil Kumar Shah
 Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
 Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
  
 Do you mean that you have some external program (written in C++) that you 
 want to communicate with a NOX component (written in Python)?
  
 jsonmessenger works by sending and receiving JSON (http://json.org) messages. 
  So on the NOX side, you use jsonmessenger.  In the external program, you can 
 use any of several libraries for doing JSON encoding/decoding.
  
 -- Murphy
  
 On Dec 20, 2011, at 1:09 AM, Harshil Anil Kumar Shah wrote:
 
 
 Hi,
 In my case where external module is C++ then can I use “pyobject” to interact 
 with python module?
  
 From: Harshil Anil Kumar Shah 
 Sent: Monday, December 19, 2011 3:32 PM
 To: 'Kyriakos Zarifis'
 Cc: nox-dev@noxrepo.org
 Subject: RE: [nox-dev] Nox messenger example for external c++ and nox python
  
 Thanks Zarifis…
  
 I looked at GUI example. It seems very useful. But in my case, client is 
 external C++ module. So in that case do I have to use use messenger.cpp??
  
 -Harshil.
  
 From: nox-dev-boun...@noxrepo.org [mailto:nox-dev-boun...@noxrepo.org] On 
 Behalf Of Kyriakos Zarifis
 Sent: Monday, December 19, 2011 1:38 PM
 To: Harshil Anil Kumar Shah
 Cc: nox-dev@noxrepo.org
 Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
  
 Hi Harshil,
  
 it might not be the simplest example, but the GUI communicates with NOX using 
 the messenger, so taking a look at that code might be a good starting point.
  
 Specifically, the file communication.py is responsible on the GUI side. 
 Similarly on the NOX side, the code that uses the messenger to send messages 
 to the GUI is inside the respective component that talks to the GUI. The 
 component monitoring is one of them.
 
 Some of this is documented on the wiki here:
 http://noxrepo.org/noxwiki/index.php/NOX_GUI#Connecting_a_subview_to_a_NOX_component
 
 On Sun, Dec 18, 2011 at 10:41 PM, Harshil Anil Kumar Shah 
 harshil_s...@infosys.com wrote:
 Hi,
  
 I want to exchange messages between external C++ module and python module  in 
 Nox using protobuf messages. I browsed through couple of posts, I figured out 
 I can  use coreapps/messenger. Can I get some working example how messenger 
 code can be used for message exchange between external c++ and nox python 
 module.
  
 Regards,
 Harshil Shah,
 Convergence Lab, Infosys Labs
 Infosys | Bangalore
 Mob # : +91 97428 87966.
  
  CAUTION - Disclaimer *
 This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
 for the use of the addressee(s). If you are not the intended recipient, 
 please 
 notify the sender by e-mail and delete the original message. Further, you are 
 not 
 to copy, disclose, or distribute this e-mail or its contents to any other 
 person and 
 any such actions are unlawful. This e-mail may contain viruses. Infosys has 
 taken 
 every reasonable precaution to minimize this risk, but is not liable for any 
 damage 
 you may sustain as a result of any virus in this e-mail. You should carry out 
 your 
 own virus checks before opening the e-mail or attachment. Infosys reserves 
 the 
 right to monitor and review the content of all messages sent to or from this 
 e-mail 
 address. Messages sent to or from this e-mail address may be stored on the 
 Infosys e-mail system.
 ***INFOSYS End of Disclaimer INFOSYS***
 
 ___
 nox-dev mailing list
 nox-dev@noxrepo.org
 http://noxrepo.org/mailman/listinfo/nox-dev
 
  
 ___
 nox-dev mailing list
 nox-dev@noxrepo.org
 http://noxrepo.org/mailman/listinfo/nox-dev
  

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] Nox messenger example for external c++ and nox python

2011-12-21 Thread Harshil Anil Kumar Shah
Thanks Murphy.
I guess 2nd option is the better to go with.
Can I use boost.python for that?
And I guess plain messenger is exposed to python. There are messenger.py  and 
messenger.cpp/hh files corresponding to plain messenger.

-Harshil

From: Murphy McCauley [mailto:jam...@nau.edu]
Sent: Wednesday, December 21, 2011 2:33 PM
To: Harshil Anil Kumar Shah
Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python

So NOX's messenger is a fairly generic method for communicating with external 
applications over a socket.  Built on top of this is jsonmessenger which 
communicates JSON messages over a socket.

If you specifically want to use protobufs (and not JSON messages), then you'd 
want to use the plain messenger.  However, the plain messenger is not exposed 
to Python -- only jsonmessenger is.

So I think your options are:
1) Use JSON messages instead of protobufs, and just use jsonmessenger
2) Expose messenger to Python, and then use this to send/receive protobufs
3) Use protobufs and roll your own method for communicating with your external 
application (probably using Twisted)

-- Murphy

On Dec 20, 2011, at 11:02 PM, Harshil Anil Kumar Shah wrote:


Hi Murphy.
Yes, I have external C++ module which I want to communicate with Nox python 
module using protobuf. I am using libjson library at C++ module.

-Harshil.

From: Murphy McCauley [mailto:jam...@nau.edu]
Sent: Wednesday, December 21, 2011 1:38 AM
To: Harshil Anil Kumar Shah
Cc: Kyriakos Zarifis; nox-dev@noxrepo.orgmailto:nox-dev@noxrepo.org
Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python

Do you mean that you have some external program (written in C++) that you want 
to communicate with a NOX component (written in Python)?

jsonmessenger works by sending and receiving JSON (http://json.org) messages.  
So on the NOX side, you use jsonmessenger.  In the external program, you can 
use any of several libraries for doing JSON encoding/decoding.

-- Murphy

On Dec 20, 2011, at 1:09 AM, Harshil Anil Kumar Shah wrote:



Hi,
In my case where external module is C++ then can I use pyobject to interact 
with python module?

From: Harshil Anil Kumar Shah
Sent: Monday, December 19, 2011 3:32 PM
To: 'Kyriakos Zarifis'
Cc: nox-dev@noxrepo.orgmailto:nox-dev@noxrepo.org
Subject: RE: [nox-dev] Nox messenger example for external c++ and nox python

Thanks Zarifis...

I looked at GUI example. It seems very useful. But in my case, client is 
external C++ module. So in that case do I have to use use messenger.cpp??

-Harshil.

From: nox-dev-boun...@noxrepo.orgmailto:nox-dev-boun...@noxrepo.org 
[mailto:nox-dev-boun...@noxrepo.org] On Behalf Of Kyriakos Zarifis
Sent: Monday, December 19, 2011 1:38 PM
To: Harshil Anil Kumar Shah
Cc: nox-dev@noxrepo.orgmailto:nox-dev@noxrepo.org
Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python

Hi Harshil,

it might not be the simplest example, but the GUI communicates with NOX using 
the messenger, so taking a look at that code might be a good starting point.

Specifically, the file communication.py is responsible on the GUI side. 
Similarly on the NOX side, the code that uses the messenger to send messages to 
the GUI is inside the respective component that talks to the GUI. The component 
monitoring is one of them.

Some of this is documented on the wiki here:
http://noxrepo.org/noxwiki/index.php/NOX_GUI#Connecting_a_subview_to_a_NOX_component
On Sun, Dec 18, 2011 at 10:41 PM, Harshil Anil Kumar Shah 
harshil_s...@infosys.commailto:harshil_s...@infosys.com wrote:
Hi,

I want to exchange messages between external C++ module and python module  in 
Nox using protobuf messages. I browsed through couple of posts, I figured out I 
can  use coreapps/messenger. Can I get some working example how messenger code 
can be used for message exchange between external c++ and nox python module.

Regards,
Harshil Shah,
Convergence Lab, Infosys Labs
Infosys | Bangalore
Mob # : +91 97428 87966tel:%2B91%2097428%2087966.


 CAUTION - Disclaimer *

This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely

for the use of the addressee(s). If you are not the intended recipient, please

notify the sender by e-mail and delete the original message. Further, you are 
not

to copy, disclose, or distribute this e-mail or its contents to any other 
person and

any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken

every reasonable precaution to minimize this risk, but is not liable for any 
damage

you may sustain as a result of any virus in this e-mail. You should carry out 
your

own virus checks before opening the e-mail or attachment. Infosys reserves the

right to monitor and review the content of all messages sent to or from this 
e-mail

address. Messages sent to or from this e-mail address may be stored on the

Infosys e-mail system.

***INFOSYS End of 

Re: [nox-dev] NOX UnicodeDecodeError in nox/coreapps/pyrt/pyoxidereactor.py

2011-12-21 Thread Bernd Wittefeld
Hi, I'm currently not in the office. Thanks for the logging hint. I will look 
further into that and keep you posted as soon as I'm back.
My module is written in Python and does some minimal logging. Maybe there is 
the error. I will try to execute the same module in the old and working 
environment. Thank you very much!

Bernd
-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.



Murphy McCauley jam...@nau.edu schrieb:

It looks like some Python component is trying to log something unprintable. Is 
your prrt module in Python? Does it do any logging?

Is that the full stack trace that you pasted? It'd be nice to see where emit() 
was being called from.

If you just want a quick fix, you could try just commenting out lines 337-339 
in pyrt. But if this is happening because of something in monitoring or 
spanning_tree, I'd like to understand the problem better so that we could fix 
it.

-- Murphy

On Dec 20, 2011, at 4:50 AM, Bernd Wittefeld wrote:

 Hi,
 I have another problem with my NOX installation. When I start it using
 
 ./nox_core -i ptcp:6633 spanning_tree switch prrt monitoring
 
 it worked flawlessly all the time with the standard openflow switch from 
 openflow.org in my old environment. Now I have moved to a new environment 
 using an exact copy of the previous setup only with vmware installations, I 
 have the following problem appearing in the NOX logs:
 
 Traceback (most recent call last):
 File ./nox/coreapps/pyrt/pyoxidereactor.py, line 339, in emit
 msg = unicode(msg, 'utf-8')
 UnicodeDecodeError: 'utf8' codec can't decode bytes in position 127-129: 
 invalid data
 
 prrt is a module that I am currently working on. It does nothing with pyrt 
 and stuff. Currently only gathering information from discovery and filling 
 some datastructures.
 Does anyone know where this can come from? Do I miss some dependencies upon 
 installation? It seems like NOX cannot understand the data it gets from a 
 switch?!
 I have checked the configure scripts for dependencies and searched the web 
 but could not find anything useful on this.
 
 Thanks in advance!
 Bernd
_

 nox-dev mailing list
 nox-dev@noxrepo.org
 http://noxrepo.org/mailman/listinfo/nox-dev

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] Running nox with a pcap file as input

2011-12-21 Thread Murphy McCauley
If I recall correctly, this is enabled or disabled automatically during 
configure based on whether the pcap header and/or library can be found.

On Ubuntu, you should be good if you have... I think it's libpcap-dev 
installed.  If you don't, please install it and then re-run configure.

If you have the appropriate package installed and it still doesn't work, check 
the output of configure to see if there's anything useful about pcap in there.

Hope that helps.

-- Murphy

On Dec 21, 2011, at 1:18 PM, Bharath Madhusudan wrote:

 I am just getting started with nox and before I throw real traffic at
 my setup, I would like to be able to use a pcap file as input.
 
 When I try:
 
 ./nox_core -i pcap:162.pcap:162.out
 
 I get:
 
 1|openflow|ERR:pcap support not built in.  Ensure you have pcap
 installed and rebuild
 
 Looking at the nox config files, its non-obvious to me how I would go
 about doing this
 
 Thanks a lot in advance for anything anyone might have to say about this.
 
 Regards, Bharath
 ___
 nox-dev mailing list
 nox-dev@noxrepo.org
 http://noxrepo.org/mailman/listinfo/nox-dev

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev