[nox-dev] how to add a new component

2010-12-26 Thread 谢峰
Hi, all
I have download tha Spanning_Tree component, but I don't know how to use
it.
someone can help me?
thanks,
xiefeng
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org


Re: [nox-dev] how to add a new component

2010-12-26 Thread Kyriakos Zarifis
Hi Xiefeng,

have you taken a look at this? (
http://www.openflowswitch.org/wk/index.php/Basic_Spanning_Tree#Installation)
there are a few minor outdated instructions ( for example cd noxcore
should be cd nox and nox.xml should be nox.json) but the main idea is
described there.

On Sun, Dec 26, 2010 at 3:27 PM, 谢峰 xiefen...@gmail.com wrote:

 Hi, all
 I have download tha Spanning_Tree component, but I don't know how to use
 it.
 someone can help me?
 thanks,
 xiefeng


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


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


Re: [nox-dev] how to add a new component

2010-12-26 Thread 谢峰
I've done as the steps and I modified the nox.json, after the installation,
In this file *build/src/etc/nox.json, I see packet-in-event first say
spanning_tree component.*

2010/12/26 Kyriakos Zarifis kyr.zari...@gmail.com

 Hi Xiefeng,

 have you taken a look at this? (
 http://www.openflowswitch.org/wk/index.php/Basic_Spanning_Tree#Installation)
 there are a few minor outdated instructions ( for example cd noxcore
 should be cd nox and nox.xml should be nox.json) but the main idea is
 described there.

   On Sun, Dec 26, 2010 at 3:27 PM, 谢峰 xiefen...@gmail.com wrote:

   Hi, all
 I have download tha Spanning_Tree component, but I don't know how to use
 it.
 someone can help me?
 thanks,
 xiefeng


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





-- 
Feng Xie
Ph.D. Candidate
Network Security Lab, Research Institute of Information Technology
Tsinghua National Laboratory for Information Science and Technology
Dept. of Automation, Tsinghua Univ., Beijing, China, 100084.
Tel.: +86-010-6277-2656
Email: xiefen...@gmail.com
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org


Re: [nox-dev] how to add a new component

2010-12-26 Thread Kyriakos Zarifis
 Are you running nox_core with spanning_tree? What are the sings that
spanning_tree is not working? Can you attach a log with any relevant error
messages?

2010/12/26 谢峰 xiefen...@gmail.com

 I modified the file:spanning_tree/Makefile.am as follow:


 include ../../../Make.vars
 EXTRA_DIST =\
 meta.json\
 __init__.py \
 spanning_tree.py
 NOX_RUNTIMEFILES = meta.json\
 __init__.py \
 spanning_tree.py
 all-local:
 @dlist=$(NOX_RUNTIMEFILES);for f in $$dlist; do \
   if test -f $(srcdir)/$$f  test ! -f $$f; then \
 ln -sf $(srcdir)/$$f $(builddir)/$$f;\
   fi;\
 done;
 and I modified the file spanning_tree/meta.json as follow:


 {
 components: [
 {
 python: nox.apps.spanning_tree.spanning_tree,
 dependencies: [
 python,
 discovery
 ],
 name: spanning_tree,
 }
 ]
 }

 Is there some problem, but during the installation, there is no error.
 however, it seems the spanning_tree doesn't work.
 Thanks for your help.

 regards

 xiefeng
 在 2010年12月26日 下午10:37,谢峰 xiefen...@gmail.com写道:

 I've done as the steps and I modified the nox.json, after the installation,
 In this file *build/src/etc/nox.json, I see packet-in-event first say
 spanning_tree component.*

 2010/12/26 Kyriakos Zarifis kyr.zari...@gmail.com

 Hi Xiefeng,

 have you taken a look at this? (
 http://www.openflowswitch.org/wk/index.php/Basic_Spanning_Tree#Installation)
 there are a few minor outdated instructions ( for example cd noxcore
 should be cd nox and nox.xml should be nox.json) but the main idea is
 described there.

   On Sun, Dec 26, 2010 at 3:27 PM, 谢峰 xiefen...@gmail.com wrote:

   Hi, all
 I have download tha Spanning_Tree component, but I don't know how to
 use it.
 someone can help me?
 thanks,
 xiefeng


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









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


Re: [nox-dev] Contributing to Nox

2010-12-26 Thread Derek Cormier

Hi KK,

I've attached the patch. Sorry for taking so long to reply, I was away 
for the holidays. The patch is for destiny. I have seen Murphy's patch, 
and this patch is based off of it. Murphy added the ability to use the 
component's register_handler method for error events, and mine just adds 
a convenience methods for registering errors, since they exist for other 
events as well.


-Derek

On 12/23/2010 03:20 AM, kk yap wrote:

Thanks Alec.  That's a useful feature I did not know about.
Appreciate the advice.

Hi Derek,

Is this patch against destiny?  We tend to patch the unstable branch
(destiny), so if I can have a patch against destiny, that would be
best.

Also, have you seen Murphy's patch in the destiny branch?

Regards
KK


commit a2efd049da9f0d0d8dc4e56dc1aaa64930c1d257
Author: Murphy McCauleymurphy.mccau...@gmail.com
Date:   Tue Dec 14 11:49:18 2010 -0800

 Pythonize OpenFlow error messages

 OpenFlow error messages (ofp_error_msg / OFPT_ERROR_MSG) were previously
 only available in C++.  They're now available in Python as well.



On 22 December 2010 10:09, Alec Storyav...@cornell.edu  wrote:

If you click the little down arrow on the top right, and select Show
original you get the non-formatted version of the message and should be
able to get the patch out of there.

On Wed, Dec 22, 2010 at 6:29 AM, kk yapyap...@stanford.edu  wrote:

Hi Derek,

Many thanks for the patch.  Do you mind sending me the patch zipped or
tarballed?  Sorry Gmail reformats things a little, so the
git-format-patch output is distorted.

Regards
KK

On 21 December 2010 23:38, Derek Cormierderek.corm...@lab.ntt.co.jp
wrote:

Hello,

I would like to start contributing to the Nox code. This is my first
time
contributing to open source software, and I'm still new to git, so I
don't
know the exact process. I've seen some people post patch files, so I'll
include a small change I made here.

Recently the Error_event was made available in the python API, but
core.py
didn't have an easier member function to register errors (had to
register
using the Error_event.get_static_name() etc..). This isn't incredibly
useful, but I just wanted to try contributing for the first time. Please
let
me know if I didn't do this right.

Thanks!
Derek


 From ea590df29ae342bb9029b90829fa1ddf3ff36d10 Mon Sep 17 00:00:00 2001
From: Derek Cormiercormier.de...@gmail.com
Date: Wed, 22 Dec 2010 16:18:33 +0900
Subject: [PATCH] Allow python components to register for error events
through a class method.

---
  src/nox/lib/core.py |   10 ++
  src/nox/lib/util.py |9 +
  2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/nox/lib/core.py b/src/nox/lib/core.py
index 3b994c6..70cdb48 100644
--- a/src/nox/lib/core.py
+++ b/src/nox/lib/core.py
@@ -678,6 +678,16 @@ class Component:
 self.register_handler(Switch_mgr_leave_event.static_get_name(),
   gen_switch_mgr_leave_cb(handler))

+def register_for_error(self, handler):
+
+register a handler to be called on every error
+event handler will be called with the following args:
+
+handler(type, code, data, xid)
+
+self.register_handler(Error_event.static_get_name(),
+  gen_error_cb(handler))
+
 def unregister_handler(self, rule_id):
 
 Unregister a handler for match.
diff --git a/src/nox/lib/util.py b/src/nox/lib/util.py
index a192826..aa4b807 100644
--- a/src/nox/lib/util.py
+++ b/src/nox/lib/util.py
@@ -239,6 +239,15 @@ def gen_switch_mgr_leave_cb(handler):
 f.cb = handler
 return f

+def gen_error_cb(handler):
+def f(event):
+ret = f.cb(event.type, event.code, event.data, event.xid)
+if ret == None:
+return CONTINUE
+return ret
+f.cb = handler
+return f
+
  def set_match(attrs):
 m = openflow.ofp_match()
 wildcards = 0
--
1.7.0.4



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


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



--
Alec Story
Cornell University
Biological Sciences, Computer Science 2012


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






py-comp-reg-errors.patch.gz
Description: GNU Zip compressed data
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org


Re: [nox-dev] how to add a new component

2010-12-26 Thread 谢峰
When I'm running nox_core with spanning_tree, it says the description is
not found. so I  run nox_core with routing, it's okay. but it seems not
to have the function of spanning_tree.

在 2010年12月27日 上午1:44,Kyriakos Zarifis kyr.zari...@gmail.com写道:

  Are you running nox_core with spanning_tree? What are the sings that
 spanning_tree is not working? Can you attach a log with any relevant error
 messages?

 2010/12/26 谢峰 xiefen...@gmail.com

  I modified the file:spanning_tree/Makefile.am as follow:


 include ../../../Make.vars
 EXTRA_DIST =\
 meta.json\
 __init__.py \
 spanning_tree.py
 NOX_RUNTIMEFILES = meta.json\
 __init__.py \
 spanning_tree.py
 all-local:
 @dlist=$(NOX_RUNTIMEFILES);for f in $$dlist; do \
   if test -f $(srcdir)/$$f  test ! -f $$f; then \
 ln -sf $(srcdir)/$$f $(builddir)/$$f;\
   fi;\
 done;
 and I modified the file spanning_tree/meta.json as follow:


 {
 components: [
 {
 python: nox.apps.spanning_tree.spanning_tree,
 dependencies: [
 python,
 discovery
 ],
 name: spanning_tree,
 }
 ]
 }

 Is there some problem, but during the installation, there is no error.
 however, it seems the spanning_tree doesn't work.
 Thanks for your help.

 regards

 xiefeng
 在 2010年12月26日 下午10:37,谢峰 xiefen...@gmail.com写道:

 I've done as the steps and I modified the nox.json, after the
 installation, In this file *build/src/etc/nox.json, I see
 packet-in-event first say spanning_tree component.*

 2010/12/26 Kyriakos Zarifis kyr.zari...@gmail.com

 Hi Xiefeng,

 have you taken a look at this? (
 http://www.openflowswitch.org/wk/index.php/Basic_Spanning_Tree#Installation)
 there are a few minor outdated instructions ( for example cd noxcore
 should be cd nox and nox.xml should be nox.json) but the main idea is
 described there.

   On Sun, Dec 26, 2010 at 3:27 PM, 谢峰 xiefen...@gmail.com wrote:

   Hi, all
 I have download tha Spanning_Tree component, but I don't know how to
 use it.
 someone can help me?
 thanks,
 xiefeng


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












-- 
Feng Xie
Ph.D. Candidate
Network Security Lab, Research Institute of Information Technology
Tsinghua National Laboratory for Information Science and Technology
Dept. of Automation, Tsinghua Univ., Beijing, China, 100084.
Tel.: +86-010-6277-2656
Email: xiefen...@gmail.com
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org


Re: [nox-dev] how to add a new component

2010-12-26 Thread 谢峰
I've updated the file configure.ac.in and src/etc/nox.json. And then I
modified the file spanning_tree/Makefile.am and spanning_tree/meta.json as
follow:


include ../../../Make.vars
EXTRA_DIST =\
meta.json\
__init__.py \
spanning_tree.py
NOX_RUNTIMEFILES = meta.json\
__init__.py \
spanning_tree.py
all-local:
@dlist=$(NOX_RUNTIMEFILES);for f in $$dlist; do \
  if test -f $(srcdir)/$$f  test ! -f $$f; then \
ln -sf $(srcdir)/$$f $(builddir)/$$f;\
  fi;\
done;
and I modified the file spanning_tree/meta.json as follow:


{
components: [
{
python: nox.apps.spanning_tree.spanning_tree,
dependencies: [
python,
discovery
],
name: spanning_tree,
}
]
}

Is there any problem?
在 2010年12月27日 上午9:42,kk yap yap...@stanford.edu写道:

 Hi,

 Did you update configure.ac.in?

 Regards
 KK


 2010/12/26 谢峰 xiefen...@gmail.com

 When I'm running nox_core with spanning_tree, it says the description
 is not found. so I  run nox_core with routing, it's okay. but it seems
 not to have the function of spanning_tree.

 在 2010年12月27日 上午1:44,Kyriakos Zarifis kyr.zari...@gmail.com写道:

  Are you running nox_core with spanning_tree? What are the sings that
 spanning_tree is not working? Can you attach a log with any relevant error
 messages?

 2010/12/26 谢峰 xiefen...@gmail.com

  I modified the file:spanning_tree/Makefile.am as follow:


 include ../../../Make.vars
 EXTRA_DIST =\
 meta.json\
 __init__.py \
 spanning_tree.py
 NOX_RUNTIMEFILES = meta.json\
 __init__.py \
 spanning_tree.py
 all-local:
 @dlist=$(NOX_RUNTIMEFILES);for f in $$dlist; do \
   if test -f $(srcdir)/$$f  test ! -f $$f; then \
 ln -sf $(srcdir)/$$f $(builddir)/$$f;\
   fi;\
 done;
 and I modified the file spanning_tree/meta.json as follow:


 {
 components: [
 {
 python: nox.apps.spanning_tree.spanning_tree,
 dependencies: [
 python,
 discovery
 ],
 name: spanning_tree,
 }
 ]
 }

 Is there some problem, but during the installation, there is no error.
 however, it seems the spanning_tree doesn't work.
 Thanks for your help.

 regards

 xiefeng
 在 2010年12月26日 下午10:37,谢峰 xiefen...@gmail.com写道:

 I've done as the steps and I modified the nox.json, after the
 installation, In this file *build/src/etc/nox.json, I see
 packet-in-event first say spanning_tree component.*

 2010/12/26 Kyriakos Zarifis kyr.zari...@gmail.com

 Hi Xiefeng,

 have you taken a look at this? (
 http://www.openflowswitch.org/wk/index.php/Basic_Spanning_Tree#Installation)
 there are a few minor outdated instructions ( for example cd noxcore
 should be cd nox and nox.xml should be nox.json) but the main idea 
 is
 described there.

   On Sun, Dec 26, 2010 at 3:27 PM, 谢峰 xiefen...@gmail.com wrote:

   Hi, all
 I have download tha Spanning_Tree component, but I don't know how
 to use it.
 someone can help me?
 thanks,
 xiefeng


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












 --
 Feng Xie
 Ph.D. Candidate
 Network Security Lab, Research Institute of Information Technology
 Tsinghua National Laboratory for Information Science and Technology
 Dept. of Automation, Tsinghua Univ., Beijing, China, 100084.
 Tel.: +86-010-6277-2656
 Email: xiefen...@gmail.com


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





-- 
Feng Xie
Ph.D. Candidate
Network Security Lab, Research Institute of Information Technology
Tsinghua National Laboratory for Information Science and Technology
Dept. of Automation, Tsinghua Univ., Beijing, China, 100084.
Tel.: +86-010-6277-2656
Email: xiefen...@gmail.com
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org


Re: [nox-dev] how to add a new component

2010-12-26 Thread 谢峰
It's ok, I've done re-run ./boot.sh, ./configure and the installation is
successful.

thanks KK.

xiefeng

在 2010年12月27日 上午10:17,kk yap yap...@stanford.edu写道:

 Sorry to ask the obvious, but you did re-run ./boot.sh, ./configure and
 make right?  You can tell that I cannot find obvious problems in the files
 you posted.

 Regards
 KK

 2010/12/26 谢峰 xiefen...@gmail.com

 I've updated the file configure.ac.in and src/etc/nox.json. And then I
 modified the file spanning_tree/Makefile.am and spanning_tree/meta.json as
 follow:


 include ../../../Make.vars
 EXTRA_DIST =\
 meta.json\
 __init__.py \
 spanning_tree.py
 NOX_RUNTIMEFILES = meta.json\
 __init__.py \
 spanning_tree.py
 all-local:
 @dlist=$(NOX_RUNTIMEFILES);for f in $$dlist; do \
   if test -f $(srcdir)/$$f  test ! -f $$f; then \
 ln -sf $(srcdir)/$$f $(builddir)/$$f;\
   fi;\
 done;
 and I modified the file spanning_tree/meta.json as follow:


  {
 components: [
 {
 python: nox.apps.spanning_tree.spanning_tree,
 dependencies: [
 python,
 discovery
 ],
 name: spanning_tree,
 }
 ]
 }

 Is there any problem?
 在 2010年12月27日 上午9:42,kk yap yap...@stanford.edu写道:

 Hi,

 Did you update configure.ac.in?

 Regards
 KK


 2010/12/26 谢峰 xiefen...@gmail.com

 When I'm running nox_core with spanning_tree, it says the description
 is not found. so I  run nox_core with routing, it's okay. but it seems
 not to have the function of spanning_tree.

 在 2010年12月27日 上午1:44,Kyriakos Zarifis kyr.zari...@gmail.com写道:

  Are you running nox_core with spanning_tree? What are the sings that
 spanning_tree is not working? Can you attach a log with any relevant error
 messages?

 2010/12/26 谢峰 xiefen...@gmail.com

  I modified the file:spanning_tree/Makefile.am as follow:


 include ../../../Make.vars
 EXTRA_DIST =\
 meta.json\
 __init__.py \
 spanning_tree.py
 NOX_RUNTIMEFILES = meta.json\
 __init__.py \
 spanning_tree.py
 all-local:
 @dlist=$(NOX_RUNTIMEFILES);for f in $$dlist; do \
   if test -f $(srcdir)/$$f  test ! -f $$f; then \
 ln -sf $(srcdir)/$$f $(builddir)/$$f;\
   fi;\
 done;
 and I modified the file spanning_tree/meta.json as follow:


 {
 components: [
 {
 python: nox.apps.spanning_tree.spanning_tree,
 dependencies: [
 python,
 discovery
 ],
 name: spanning_tree,
 }
 ]
 }

 Is there some problem, but during the installation, there is no error.
 however, it seems the spanning_tree doesn't work.
 Thanks for your help.

 regards

 xiefeng
 在 2010年12月26日 下午10:37,谢峰 xiefen...@gmail.com写道:

 I've done as the steps and I modified the nox.json, after the
 installation, In this file *build/src/etc/nox.json, I see
 packet-in-event first say spanning_tree component.*

 2010/12/26 Kyriakos Zarifis kyr.zari...@gmail.com

 Hi Xiefeng,

 have you taken a look at this? (
 http://www.openflowswitch.org/wk/index.php/Basic_Spanning_Tree#Installation)
 there are a few minor outdated instructions ( for example cd
 noxcore should be cd nox and nox.xml should be nox.json) but 
 the main
 idea is described there.

   On Sun, Dec 26, 2010 at 3:27 PM, 谢峰 xiefen...@gmail.com wrote:

   Hi, all
 I have download tha Spanning_Tree component, but I don't know how
 to use it.
 someone can help me?
 thanks,
 xiefeng


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












 --
 Feng Xie
 Ph.D. Candidate
 Network Security Lab, Research Institute of Information Technology
 Tsinghua National Laboratory for Information Science and Technology
 Dept. of Automation, Tsinghua Univ., Beijing, China, 100084.
 Tel.: +86-010-6277-2656
 Email: xiefen...@gmail.com


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





 --
 Feng Xie
 Ph.D. Candidate
 Network Security Lab, Research Institute of Information Technology
 Tsinghua National Laboratory for Information Science and Technology
 Dept. of Automation, Tsinghua Univ., Beijing, China, 100084.
 Tel.: +86-010-6277-2656
 Email: xiefen...@gmail.com





-- 
Feng Xie
Ph.D. Candidate
Network Security Lab, Research Institute of Information Technology
Tsinghua National Laboratory for Information Science and Technology
Dept. of Automation, Tsinghua Univ., Beijing, China, 100084.
Tel.: +86-010-6277-2656
Email: xiefen...@gmail.com
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org


[nox-dev] NOX's API Documentation online

2010-12-26 Thread kk yap
Hi All,

The last release of NOX (zaku) has come with doxygen-generated
documentation, which can be a rich source of information for those trying to
figure out what individual components do (e.g., routing).  Judging from
recent questions on the list (and to make my friends' TA job easier), I have
decided put up the documentation online @ http://noxrepo.org/~yapkke/doc.

Hope this will come in useful.

Merry Christmas and Happy New Year.
KK

PS
This online version has Graphviz generated diagrams and extracts all
functions.  To generate this, I run
   make EXTRACT_ALL=YES HAVE_DOT=YES html
in nox/doc/doxygen for the curious.
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org


Re: [nox-dev] Contributing to Nox

2010-12-26 Thread Derek Cormier
Great. Should I post any future changes here on the Nox board or send 
them to a developer like yourself?


-Derek

On 12/27/2010 02:54 PM, kk yap wrote:

Hi Derek,

Thanks.  I pushed this to destiny (unstable).

Regards
KK

On 26 December 2010 16:56, Derek Cormier derek.corm...@lab.ntt.co.jp 
mailto:derek.corm...@lab.ntt.co.jp wrote:


Woops! I'm not sure how it happened but I somehow messed up the
patch file. Please use this attached one instead.

-Derek


On 12/27/2010 09:48 AM, Derek Cormier wrote:

Hi KK,

I've attached the patch. Sorry for taking so long to reply, I was
away for the holidays. The patch is for destiny. I have seen
Murphy's patch, and this patch is based off of it. Murphy added
the ability to use the component's register_handler method for
error events, and mine just adds a convenience methods for
registering errors, since they exist for other events as well.

-Derek

On 12/23/2010 03:20 AM, kk yap wrote:

Thanks Alec.  That's a useful feature I did not know about.
Appreciate the advice.

Hi Derek,

Is this patch against destiny?  We tend to patch the unstable
branch
(destiny), so if I can have a patch against destiny, that would be
best.

Also, have you seen Murphy's patch in the destiny branch?

Regards
KK


commit a2efd049da9f0d0d8dc4e56dc1aaa64930c1d257
Author: Murphy McCauleymurphy.mccau...@gmail.com
mailto:murphy.mccau...@gmail.com
Date:   Tue Dec 14 11:49:18 2010 -0800

 Pythonize OpenFlow error messages

 OpenFlow error messages (ofp_error_msg / OFPT_ERROR_MSG)
were previously
 only available in C++.  They're now available in Python as
well.



On 22 December 2010 10:09, Alec Storyav...@cornell.edu
mailto:av...@cornell.edu  wrote:

If you click the little down arrow on the top right, and select
Show
original you get the non-formatted version of the message and
should be
able to get the patch out of there.

On Wed, Dec 22, 2010 at 6:29 AM, kk yapyap...@stanford.edu
mailto:yap...@stanford.edu  wrote:

Hi Derek,

Many thanks for the patch.  Do you mind sending me the patch
zipped or
tarballed?  Sorry Gmail reformats things a little, so the
git-format-patch output is distorted.

Regards
KK

On 21 December 2010 23:38, Derek
Cormierderek.corm...@lab.ntt.co.jp
mailto:derek.corm...@lab.ntt.co.jp
wrote:

Hello,

I would like to start contributing to the Nox code. This is
my first
time
contributing to open source software, and I'm still new to
git, so I
don't
know the exact process. I've seen some people post patch
files, so I'll
include a small change I made here.

Recently the Error_event was made available in the python
API, but
core.py
didn't have an easier member function to register errors (had to
register
using the Error_event.get_static_name() etc..). This isn't
incredibly
useful, but I just wanted to try contributing for the first
time. Please
let
me know if I didn't do this right.

Thanks!
Derek


 From ea590df29ae342bb9029b90829fa1ddf3ff36d10 Mon Sep 17
00:00:00 2001
From: Derek Cormiercormier.de...@gmail.com
mailto:cormier.de...@gmail.com
Date: Wed, 22 Dec 2010 16:18:33 +0900
Subject: [PATCH] Allow python components to register for
error events
through a class method.

---
  src/nox/lib/core.py |   10 ++
  src/nox/lib/util.py |9 +
  2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/nox/lib/core.py b/src/nox/lib/core.py
index 3b994c6..70cdb48 100644
--- a/src/nox/lib/core.py
+++ b/src/nox/lib/core.py
@@ -678,6 +678,16 @@ class Component:

self.register_handler(Switch_mgr_leave_event.static_get_name(),

   gen_switch_mgr_leave_cb(handler))

+def register_for_error(self, handler):
+
+register a handler to be called on every error
+event handler will be called with the following args:
+
+handler(type, code, data, xid)
+
+self.register_handler(Error_event.static_get_name(),
+  gen_error_cb(handler))
+
 def unregister_handler(self, rule_id):
 
 Unregister a handler for match.
diff --git a/src/nox/lib/util.py b/src/nox/lib/util.py
index a192826..aa4b807 100644
--- a/src/nox/lib/util.py
+++ b/src/nox/lib/util.py
@@ -239,6 +239,15 @@ def gen_switch_mgr_leave_cb(handler):
 f.cb = handler
 return f

+def gen_error_cb(handler):
+def f(event):
+ret = f.cb(event.type, event.code, event.data,
event.xid)
+if ret == None:
+return CONTINUE
+