Re: [nox-dev] Change the destination of packets

2011-07-21 Thread kk yap
Hi Ricardo,

Try matching on the old IP, then rewrite to the new IP.

Regards
KK

On 20 July 2011 14:50, Ricardo Bennesby  wrote:
> Hi all. I would like to forward packets from one host to another.
> I have the following topology:
>    c0              c0
>     |                 |
>    s3- s3
>   /    \            /   \
>  h1  h2        h1   h2
> Each host can ping each other. The two networks are connected by their
> switches (s3).
> In net1 h1 and h2 have IP 10.0.0.1 and 10.0.0.2.
> In net2 h1 and h2 have IP 192.168.47.1 and 192.168.47.2
> I want that everytime I ping from some host in 192.168.47.2 the packets be
> forward to 10.0.0.2.
> I am using the switch.cc component and making some modifications on it.
> I set some actions to achieve this, using flow_mod and changing the
> out_port, destination mac_address and destination IP.
> Using wireshark, listening to the port where h2 (10.0.0.2) is, I saw that it
> got an ARP request from h1. So, looks like the packets arrive in the correct
> ethernet address, but it continue asking for 192.168.47.2. The destination
> IP was not modified. The code follows:
>     if (flow.nw_dst == 36677824){//if destination ip=192.168.47.2
>                uint8_t no_of_actions_len = 56;
>                uint8_t action_length = no_of_actions_len/(sizeof(struct
> ofp_action_header));
>                unsigned char *action_type = (unsigned
> char*)malloc(action_length*sizeof(struct ofp_action_header));
>             ofp_flow_mod* ofm;
>                    size_t size = sizeof *ofm + 7*sizeof(ofp_action_output);
>                    boost::shared_array raw_of(new char[size]);
>                    ofm = (ofp_flow_mod*) raw_of.get();
>                    ofm->header.version = OFP_VERSION;
>                    ofm->header.type = OFPT_FLOW_MOD;
>                    ofm->header.length = htons(size);
>                    //ofm->match.wildcards = htonl(0);
>                    ofm->match.wildcards = htonl(1<<20 | 1<<1);
>                    ofm->match.in_port = htons(flow.in_port);
>                    ofm->match.dl_vlan = flow.dl_vlan;
>                    ofm->match.dl_vlan_pcp = flow.dl_vlan_pcp;
>                    memcpy(ofm->match.dl_src, flow.dl_src.octet, sizeof
> ofm->match.dl_src);
>                    memcpy(ofm->match.dl_dst, new_mac.octet, sizeof
> ofm->match.dl_dst);
>                    ofm->match.dl_type = flow.dl_type;
>                    ofm->match.nw_src = flow.nw_src;
>                    ofm->match.nw_dst = new_ip;
>                    ofm->match.tp_src = flow.tp_src;
>                    ofm->match.tp_dst = flow.tp_dst;
>                    ofm->match.nw_proto = flow.nw_proto;
>                    ofm->match.nw_tos = flow.nw_tos;
>                    ofm->match.tp_src = flow.tp_src;
>                    ofm->cookie = htonl(0);
>                    ofm->command = htons(OFPFC_ADD);
>                    ofm->buffer_id = htonl(buffer_id);
>                    ofm->idle_timeout = htons(5);
>                    ofm->hard_timeout = htons(OFP_FLOW_PERMANENT);
>                    ofm->priority = htons(OFP_DEFAULT_PRIORITY);
>                    ofm->flags = htons(ofd_flow_mod_flags());
>                    ofp_action_dl_addr *dlaction = (ofp_action_dl_addr
> *)malloc(sizeof(ofp_action_dl_addr));
>                    dlaction->type = htons(OFPAT_SET_DL_DST);
>                    dlaction->len = htons(sizeof(ofp_action_dl_addr));
>                    memcpy(dlaction->dl_addr, ofm->match.dl_dst,
> sizeof(ofm->match.dl_dst));
>                   ofp_action_nw_tos *nw_tos = (ofp_action_nw_tos
> *)malloc(sizeof(ofp_action_nw_tos));
>                   nw_tos->type = htons(OFPAT_SET_NW_TOS);
>                   nw_tos->len = htons(sizeof(ofp_action_nw_tos));
>                   nw_tos->nw_tos = 0;
>                   ofp_action_tp_port *tp_src = (ofp_action_tp_port
> *)malloc(sizeof(ofp_action_tp_port));
>                   tp_src->type = htons(OFPAT_SET_TP_SRC);
>                   tp_src->len = htons(sizeof(ofp_action_tp_port));
>                   tp_src->tp_port = htons(0);
>                    ofp_action_tp_port *tp_dst = (ofp_action_tp_port
> *)malloc(sizeof(ofp_action_tp_port));
>                   tp_dst->type = htons(OFPAT_SET_TP_DST);
>                   tp_dst->len = htons(sizeof(ofp_action_tp_port));
>                   tp_dst->tp_port = htons(0);
>                   ofp_action_output *action = (ofp_action_output
> *)malloc(sizeof(ofp_action_output));
>                   action->type = htons(OFPAT_OUTPUT);
>                   action->len = htons(sizeof(ofp_action_output));
>                   action->port = htons(port);
>                   action->max_len = htons(0);
>                   ofp_action_nw_addr *nwaction = (ofp_action_nw_addr
> *)malloc(sizeof(ofp_action_nw_addr));
>                   nwaction->type = htons(OFPAT_SET_NW_DST);
>                   nwaction->len = htons(sizeof(ofp_action_nw_addr));
>                   nwaction->nw_addr = new_ip;

Re: [nox-dev] handle_flow_route Event

2011-07-21 Thread kk yap
Hi,

This is a standard procedure in NOX.  You need to include the header file
for the definition of the event, then create the event, populate it and post
it.  One of the lavi component (though I forgot which one) will listen for
that event and send a message to ENVI.  Look at lavi_hosts (I think) for an
example.

Regards
KK

PS>> Sorry, I did not find time to look up the code before replying.

2011/7/18 Min-Hyup KANG 

>   Hi All,
>
>
> I am currently trying to understand relation between LAVI and ENVI.
>
>
> especially, I am looking at part of lavi_flow and lavi_hostflow to add and
> delete on ENVI.
>
>
> To handle event such as add and delete flows on ENVI,
>
>
>  I think I should generate Handle_flow_route event in
> netapps/lavi/lavi_hostflow.cc.
>
>
> so, how can I generate handle_flow_route event ? or where does it operate
> the event ?
>
>
>
>
>
> Best Regards,
> Min-Hyup KANG
>
> 
> ___
> 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] Deleting a rule in userspace openflow switch

2011-07-21 Thread Vishal
Hi All,

I am not able to delete a flow entry. Following is my code snippet, I have
added to the "switch" module in NOX.

Basically, I store the flows that I want to delete.

The delete is sending flow_mod to switch. But, I am not receiving Flow
Removed or a New Packet In for the deleted flows. Dpctl dump flows also
still shows the flow. Which means it is not deleted.

Is this a bug with userspace openflow switch (ofprotocol/ofdatapath) or I am
doing something wrong.

Thanks a lot,
Vishal


Call back function:
delete_rule ( ) {


*/* *
*Retrieving information needed to delete a flow rule.*
*Stored from a previously received Packet IN, rule corresponding to which is
being deleted now.*
*
*
**/*
Flow flow = (Flow)flow_list[0];
uint32_t buffer_id = (uint32_t)buffer_id_list[0];
int out_port = (int) out_port_list[0];
datapathid datapath_id = (datapathid) datapath_id_list[0];



ofp_flow_mod* ofm;
size_t size = sizeof *ofm ;//+ sizeof(ofp_action_output);
boost::shared_array raw_of(new char[size]);
ofm = (ofp_flow_mod*) raw_of.get();

*// Populating OF header*
ofm->header.version = OFP_VERSION;
ofm->header.type = OFPT_FLOW_MOD;
ofm->header.length = htons(size);
//ofm->match.wildcards = htonl(0);
//ofm->match.in_port = htons(flow.in_port);
//VLOG_DBG(log, "Input Port %d",(int)flow.in_port);
//ofm->match.dl_vlan = flow.dl_vlan;
//ofm->match.dl_vlan_pcp = flow.dl_vlan_pcp;
//memcpy(ofm->match.dl_src, flow.dl_src.octet, sizeof
ofm->match.dl_src);
//memcpy(ofm->match.dl_dst, flow.dl_dst.octet, sizeof
ofm->match.dl_dst);
//ofm->match.dl_type = flow.dl_type;
ofm->match.nw_src = flow.nw_src;
ofm->match.nw_dst = flow.nw_dst;
//VLOG_DBG(log, "Nw Src %d",flow.nw_src);
//VLOG_DBG(log, "Nw Dst %d",flow.nw_dst);
//ofm->match.nw_proto = flow.nw_proto;
//ofm->match.nw_tos = flow.nw_tos;
ofm->match.tp_src = flow.tp_src;
ofm->match.tp_dst = flow.tp_dst;
ofm->cookie = htonl(0);
//ofm->out_group = htonl(OFPG_ANY); //version 1.1.0
ofm->out_port = htonl(OFPP_NONE);
ofm->command = htons(OFPFC_DELETE);
//ofm->buffer_id = htonl(buffer_id);
ofm->idle_timeout = htons(5);
ofm->hard_timeout = htons(OFP_FLOW_PERMANENT);
ofm->priority = htons(OFP_DEFAULT_PRIORITY);
ofm->flags = htons(ofd_flow_mod_flags());

  //  ofp_action_output& action = *((ofp_action_output*)ofm->actions);
  //  memset(&action, 0, sizeof(ofp_action_output));
  //  action.type = htons(OFPAT_OUTPUT);
  //  action.len = htons(sizeof(ofp_action_output));
  //  action.max_len = htons(0);
  //  action.port = htons(out_port);
  //  VLOG_DBG(log, "Output Port %d",(int)action.port);*/

send_openflow_command(datapath_id, &ofm->header, true);

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


Re: [nox-dev] Change the destination of packets

2011-07-21 Thread Ricardo Bennesby
Hi KK. I tested as you suggested.

*ofm->match.nw_dst = htons(36677824); // I tested also ofm->match.nw_dst =
flow.nw_dst;*

and in the action I did:
*
*
*nwaction->nw_addr = htons(new_ip);*
*
*
But it continue trying to send to IP *192.168.47.2...*

The Wireshark continues showing these:

*Ethernet II, Src: 5a:8c:01:8b:e0:fb (5a:8c:01:8b:e0:fb), Dst:
62:4c:de:97:90:e4 (62:4c:de:97:90:e4)*
*Internet Protocol, Src: 192.168.47.1 (192.168.47.1), Dst: 192.168.47.2
(192.168.47.2)
*
The MAC adress is of host with IP 10.0.0.2. So the dataframes arrive in this
host. But the destination IP continues without midifications.

Any suggestion?

Thank you very much.

Best Regards.

2011/7/21 kk yap 

> Hi Ricardo,
>
> Try matching on the old IP, then rewrite to the new IP.
>
> Regards
> KK
>
> On 20 July 2011 14:50, Ricardo Bennesby 
> wrote:
> > Hi all. I would like to forward packets from one host to another.
> > I have the following topology:
> >c0  c0
> > | |
> >s3- s3
> >   /\/   \
> >  h1  h2h1   h2
> > Each host can ping each other. The two networks are connected by their
> > switches (s3).
> > In net1 h1 and h2 have IP 10.0.0.1 and 10.0.0.2.
> > In net2 h1 and h2 have IP 192.168.47.1 and 192.168.47.2
> > I want that everytime I ping from some host in 192.168.47.2 the packets
> be
> > forward to 10.0.0.2.
> > I am using the switch.cc component and making some modifications on it.
> > I set some actions to achieve this, using flow_mod and changing the
> > out_port, destination mac_address and destination IP.
> > Using wireshark, listening to the port where h2 (10.0.0.2) is, I saw that
> it
> > got an ARP request from h1. So, looks like the packets arrive in the
> correct
> > ethernet address, but it continue asking for 192.168.47.2. The
> destination
> > IP was not modified. The code follows:
> > if (flow.nw_dst == 36677824){//if destination ip=192.168.47.2
> >uint8_t no_of_actions_len = 56;
> >uint8_t action_length = no_of_actions_len/(sizeof(struct
> > ofp_action_header));
> >unsigned char *action_type = (unsigned
> > char*)malloc(action_length*sizeof(struct ofp_action_header));
> > ofp_flow_mod* ofm;
> >size_t size = sizeof *ofm +
> 7*sizeof(ofp_action_output);
> >boost::shared_array raw_of(new char[size]);
> >ofm = (ofp_flow_mod*) raw_of.get();
> >ofm->header.version = OFP_VERSION;
> >ofm->header.type = OFPT_FLOW_MOD;
> >ofm->header.length = htons(size);
> >//ofm->match.wildcards = htonl(0);
> >ofm->match.wildcards = htonl(1<<20 | 1<<1);
> >ofm->match.in_port = htons(flow.in_port);
> >ofm->match.dl_vlan = flow.dl_vlan;
> >ofm->match.dl_vlan_pcp = flow.dl_vlan_pcp;
> >memcpy(ofm->match.dl_src, flow.dl_src.octet, sizeof
> > ofm->match.dl_src);
> >memcpy(ofm->match.dl_dst, new_mac.octet, sizeof
> > ofm->match.dl_dst);
> >ofm->match.dl_type = flow.dl_type;
> >ofm->match.nw_src = flow.nw_src;
> >ofm->match.nw_dst = new_ip;
> >ofm->match.tp_src = flow.tp_src;
> >ofm->match.tp_dst = flow.tp_dst;
> >ofm->match.nw_proto = flow.nw_proto;
> >ofm->match.nw_tos = flow.nw_tos;
> >ofm->match.tp_src = flow.tp_src;
> >ofm->cookie = htonl(0);
> >ofm->command = htons(OFPFC_ADD);
> >ofm->buffer_id = htonl(buffer_id);
> >ofm->idle_timeout = htons(5);
> >ofm->hard_timeout = htons(OFP_FLOW_PERMANENT);
> >ofm->priority = htons(OFP_DEFAULT_PRIORITY);
> >ofm->flags = htons(ofd_flow_mod_flags());
> >ofp_action_dl_addr *dlaction = (ofp_action_dl_addr
> > *)malloc(sizeof(ofp_action_dl_addr));
> >dlaction->type = htons(OFPAT_SET_DL_DST);
> >dlaction->len = htons(sizeof(ofp_action_dl_addr));
> >memcpy(dlaction->dl_addr, ofm->match.dl_dst,
> > sizeof(ofm->match.dl_dst));
> >   ofp_action_nw_tos *nw_tos = (ofp_action_nw_tos
> > *)malloc(sizeof(ofp_action_nw_tos));
> >   nw_tos->type = htons(OFPAT_SET_NW_TOS);
> >   nw_tos->len = htons(sizeof(ofp_action_nw_tos));
> >   nw_tos->nw_tos = 0;
> >   ofp_action_tp_port *tp_src = (ofp_action_tp_port
> > *)malloc(sizeof(ofp_action_tp_port));
> >   tp_src->type = htons(OFPAT_SET_TP_SRC);
> >   tp_src->len = htons(sizeof(ofp_action_tp_port));
> >   tp_src->tp_port = htons(0);
> >ofp_action_tp_p

Re: [nox-dev] Change the destination of packets

2011-07-21 Thread kk yap
A tcpdump of the control traffic will be useful and easier.

Regards
KK

On 21 July 2011 16:04, Ricardo Bennesby  wrote:
> Hi KK. I tested as you suggested.
> ofm->match.nw_dst = htons(36677824); // I tested also ofm->match.nw_dst =
> flow.nw_dst;
> and in the action I did:
> nwaction->nw_addr = htons(new_ip);
> But it continue trying to send to IP 192.168.47.2...
> The Wireshark continues showing these:
> Ethernet II, Src: 5a:8c:01:8b:e0:fb (5a:8c:01:8b:e0:fb), Dst:
> 62:4c:de:97:90:e4 (62:4c:de:97:90:e4)
> Internet Protocol, Src: 192.168.47.1 (192.168.47.1), Dst: 192.168.47.2
> (192.168.47.2)
>
> The MAC adress is of host with IP 10.0.0.2. So the dataframes arrive in this
> host. But the destination IP continues without midifications.
> Any suggestion?
> Thank you very much.
> Best Regards.
> 2011/7/21 kk yap 
>>
>> Hi Ricardo,
>>
>> Try matching on the old IP, then rewrite to the new IP.
>>
>> Regards
>> KK
>>
>> On 20 July 2011 14:50, Ricardo Bennesby 
>> wrote:
>> > Hi all. I would like to forward packets from one host to another.
>> > I have the following topology:
>> >    c0              c0
>> >     |                 |
>> >    s3- s3
>> >   /    \            /   \
>> >  h1  h2        h1   h2
>> > Each host can ping each other. The two networks are connected by their
>> > switches (s3).
>> > In net1 h1 and h2 have IP 10.0.0.1 and 10.0.0.2.
>> > In net2 h1 and h2 have IP 192.168.47.1 and 192.168.47.2
>> > I want that everytime I ping from some host in 192.168.47.2 the packets
>> > be
>> > forward to 10.0.0.2.
>> > I am using the switch.cc component and making some modifications on it.
>> > I set some actions to achieve this, using flow_mod and changing the
>> > out_port, destination mac_address and destination IP.
>> > Using wireshark, listening to the port where h2 (10.0.0.2) is, I saw
>> > that it
>> > got an ARP request from h1. So, looks like the packets arrive in the
>> > correct
>> > ethernet address, but it continue asking for 192.168.47.2. The
>> > destination
>> > IP was not modified. The code follows:
>> >     if (flow.nw_dst == 36677824){//if destination ip=192.168.47.2
>> >                uint8_t no_of_actions_len = 56;
>> >                uint8_t action_length = no_of_actions_len/(sizeof(struct
>> > ofp_action_header));
>> >                unsigned char *action_type = (unsigned
>> > char*)malloc(action_length*sizeof(struct ofp_action_header));
>> >             ofp_flow_mod* ofm;
>> >                    size_t size = sizeof *ofm +
>> > 7*sizeof(ofp_action_output);
>> >                    boost::shared_array raw_of(new char[size]);
>> >                    ofm = (ofp_flow_mod*) raw_of.get();
>> >                    ofm->header.version = OFP_VERSION;
>> >                    ofm->header.type = OFPT_FLOW_MOD;
>> >                    ofm->header.length = htons(size);
>> >                    //ofm->match.wildcards = htonl(0);
>> >                    ofm->match.wildcards = htonl(1<<20 | 1<<1);
>> >                    ofm->match.in_port = htons(flow.in_port);
>> >                    ofm->match.dl_vlan = flow.dl_vlan;
>> >                    ofm->match.dl_vlan_pcp = flow.dl_vlan_pcp;
>> >                    memcpy(ofm->match.dl_src, flow.dl_src.octet, sizeof
>> > ofm->match.dl_src);
>> >                    memcpy(ofm->match.dl_dst, new_mac.octet, sizeof
>> > ofm->match.dl_dst);
>> >                    ofm->match.dl_type = flow.dl_type;
>> >                    ofm->match.nw_src = flow.nw_src;
>> >                    ofm->match.nw_dst = new_ip;
>> >                    ofm->match.tp_src = flow.tp_src;
>> >                    ofm->match.tp_dst = flow.tp_dst;
>> >                    ofm->match.nw_proto = flow.nw_proto;
>> >                    ofm->match.nw_tos = flow.nw_tos;
>> >                    ofm->match.tp_src = flow.tp_src;
>> >                    ofm->cookie = htonl(0);
>> >                    ofm->command = htons(OFPFC_ADD);
>> >                    ofm->buffer_id = htonl(buffer_id);
>> >                    ofm->idle_timeout = htons(5);
>> >                    ofm->hard_timeout = htons(OFP_FLOW_PERMANENT);
>> >                    ofm->priority = htons(OFP_DEFAULT_PRIORITY);
>> >                    ofm->flags = htons(ofd_flow_mod_flags());
>> >                    ofp_action_dl_addr *dlaction = (ofp_action_dl_addr
>> > *)malloc(sizeof(ofp_action_dl_addr));
>> >                    dlaction->type = htons(OFPAT_SET_DL_DST);
>> >                    dlaction->len = htons(sizeof(ofp_action_dl_addr));
>> >                    memcpy(dlaction->dl_addr, ofm->match.dl_dst,
>> > sizeof(ofm->match.dl_dst));
>> >                   ofp_action_nw_tos *nw_tos = (ofp_action_nw_tos
>> > *)malloc(sizeof(ofp_action_nw_tos));
>> >                   nw_tos->type = htons(OFPAT_SET_NW_TOS);
>> >                   nw_tos->len = htons(sizeof(ofp_action_nw_tos));
>> >                   nw_tos->nw_tos = 0;
>> >                   ofp_action_tp_port *tp_src = (ofp_action_tp_port
>> > *)malloc(sizeof(ofp_action_tp_por

Re: [nox-dev] handle_flow_route Event

2011-07-21 Thread kk yap
Is there a question in this email?

KK

2011/7/21 Min-Hyup KANG 

>   Thank you for your response.
>
>
> 1. " You need to include the header file for the definition of the event,
> then create the event, populate it and post it."
>
> ->Basically, there is part of flow_route_event in lavi_hostflow.cc. so I
> don't have to include the header file, right ?
>
> .
>
> register_handler
>
>   (boost::bind(&lavi_hostflow::handle_flow_route, this, _1));
>
>   Disposition lavi_hostflow::handle_flow_route(const Event& e)
>
> .
>
>
> 2, "One of the lavi component (though I forgot which one) will listen for
> that event and send a message to ENVI.  "
>
> -> lavi_hostflow inherit lavi_flows, so lavi_hostflow has JSONmsg_event
> handler.
>
> I think JSONmsg_event handler seems to check type, command, node_type.
>
> if command is request,  send_list->send_flow_list(reply add)
>
> if subscribe , interested.push_back
>
> if unsubscribe, interested.erase,
>
> so, I don't know flow_route_event is run at some point,
>
> 
>
>  register_handler
>
>  (boost::bind(&lavi_flows::handle_req, this, _1));
>
>
>   Disposition lavi_flows::handle_req(const Event& e)
>
>   {
>
> const JSONMsg_event& jme = assert_cast(e)
>
> 
>
>
> Thanks,
>
>
> - 원본 메일 -
>
> *보낸사람*: kk yap 
> *받는사람* : Min-Hyup KANG 
> *참조* : NOX-dev 
> *날짜*: 2011년 7월 22일 금요일, 01시 59분 28초 +0900
> *제목*: Re: [nox-dev] handle_flow_route Event
>
> Hi,
>
> This is a standard procedure in NOX.  You need to include the header file
> for the definition of the event, then create the event, populate it and post
> it.  One of the lavi component (though I forgot which one) will listen for
> that event and send a message to ENVI.  Look at lavi_hosts (I think) for an
> example.
>
> Regards
> KK
>
> PS>> Sorry, I did not find time to look up the code before replying.
>
> 2011/7/18 Min-Hyup KANG 
> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
> >
>
>>   Hi All,
>>
>>
>> I am currently trying to understand relation between LAVI and ENVI.
>>
>>
>> especially, I am looking at part of lavi_flow and lavi_hostflow to add and
>> delete on ENVI.
>>
>>
>> To handle event such as add and delete flows on ENVI,
>>
>>
>>  I think I should generate Handle_flow_route event in
>> netapps/lavi/lavi_hostflow.cc.
>>
>>
>> so, how can I generate handle_flow_route event ? or where does it operate
>> the event ?
>>
>>
>>
>>
>>
>> Best Regards,
>> Min-Hyup KANG
>>
>> 
>> ___
>> nox-dev mailing list
>> nox-dev@noxrepo.org
>> http://noxrepo.org/mailman/listinfo/nox-dev
>>
>>
>
>
>
>
>
>
> Best Regards,
> Min-Hyup KANG
>
> 
>
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] handle_flow_route Event

2011-07-21 Thread kk yap
Sorry, I continue to be lost.

if you want to send flows to ENVI, look at lavi_hostflow.cc line 34 to 60
for an example.  Basically, a list of flow is created and the send_flow_list
function is called.

Regards
KK

2011/7/21 Min-Hyup KANG 

>   Yes, sorry for not clearness.
>
>
> 2, "One of the lavi component (though I forgot which one) will listen for
> that event and send a message to ENVI.  "
>
> 
>
> 
>
> so, I don't know flow_route_event is run at some point in lavi_hostflow.cc
>
> can you give me some tips ?
>
>
> thanks,
>
>
> - 원본 메일 -
>
> *보낸사람*: kk yap 
> *받는사람* : Min-Hyup KANG 
> *참조* : NOX-dev 
> *날짜*: 2011년 7월 22일 금요일, 09시 36분 46초 +0900, and which one of the lavi com
>
> *제목*: Re: [nox-dev] handle_flow_route Event
> Is there a question in this email?
>
> KK
>
> 2011/7/21 Min-Hyup KANG 
> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
> >
>
>>   Thank you for your response.
>>
>>
>> 1. " You need to include the header file for the definition of the event,
>> then create the event, populate it and post it."
>>
>> ->Basically, there is part of flow_route_event in lavi_hostflow.cc. so I
>> don't have to include the header file, right ?
>>
>> .
>>
>> register_handler
>>
>>   (boost::bind(&lavi_hostflow::handle_flow_route, this, _1));
>>
>>   Disposition lavi_hostflow::handle_flow_route(const Event& e)
>>
>> .
>>
>>
>> 2, "One of the lavi component (though I forgot which one) will listen for
>> that event and send a message to ENVI.  "
>>
>> -> lavi_hostflow inherit lavi_flows, so lavi_hostflow has JSONmsg_event
>> handler.
>>
>> I think JSONmsg_event handler seems to check type, command, node_type.
>>
>> if command is request,  send_list->send_flow_list(reply add)
>>
>> if subscribe , interested.push_back
>>
>> if unsubscribe, interested.erase,
>>
>> so, I don't know flow_route_event is run at some point,
>>
>> 
>>
>>  register_handler
>>
>>  (boost::bind(&lavi_flows::handle_req, this, _1));
>>
>>
>>   Disposition lavi_flows::handle_req(const Event& e)
>>
>>   {
>>
>> const JSONMsg_event& jme = assert_cast(e)
>>
>> 
>>
>>
>> Thanks,
>>
>>
>> - 원본 메일 -
>>
>> *보낸사람*: kk yap 
>> http://hanmail/mail/MailComposeFrame.daum?TO=yap...@stanford.edu>
>> >
>> *받는사람* : Min-Hyup KANG 
>> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
>> >
>> *참조* : NOX-dev 
>> http://hanmail/mail/MailComposeFrame.daum?TO=nox-dev@noxrepo.org>
>> >
>> *날짜*: 2011년 7월 22일 금요일, 01시 59분 28초 +0900
>> *제목*: Re: [nox-dev] handle_flow_route Event
>>
>> Hi,
>>
>> This is a standard procedure in NOX.  You need to include the header file
>> for the definition of the event, then create the event, populate it and post
>> it.  One of the lavi component (though I forgot which one) will listen for
>> that event and send a message to ENVI.  Look at lavi_hosts (I think) for an
>> example.
>>
>> Regards
>> KK
>>
>> PS>> Sorry, I did not find time to look up the code before replying.
>>
>> 2011/7/18 Min-Hyup KANG 
>> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
>> >
>>
>>>   Hi All,
>>>
>>>
>>> I am currently trying to understand relation between LAVI and ENVI.
>>>
>>>
>>> especially, I am looking at part of lavi_flow and lavi_hostflow to add
>>> and delete on ENVI.
>>>
>>>
>>> To handle event such as add and delete flows on ENVI,
>>>
>>>
>>>  I think I should generate Handle_flow_route event in
>>> netapps/lavi/lavi_hostflow.cc.
>>>
>>>
>>> so, how can I generate handle_flow_route event ? or where does it operate
>>> the event ?
>>>
>>>
>>>
>>>
>>>
>>> Best Regards,
>>> Min-Hyup KANG
>>>
>>> 
>>> ___
>>> nox-dev mailing list
>>> nox-dev@noxrepo.org
>>> http://noxrepo.org/mailman/listinfo/nox-dev
>>>
>>>
>>
>>
>>
>>
>>
>>
>> Best Regards,
>> Min-Hyup KANG
>>
>> 
>>
>
>
>
>
>
>
>
> Best Regards,
> Min-Hyup KANG
>
> 
>
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] handle_flow_route Event

2011-07-21 Thread Min-Hyup KANG



	
	
Thank you for your great response.Yes, handle_flow_route is existing in lavi_hostflow.cc line 34~60.and handle_flow_route event call send_flow_list_function.My main question is "when does handle_flow_route event occur? "for example handle_req handling JSON event occur, when lavi receive json message from envi.- ¿øº» ¸ÞÀÏ -º¸³½»ç¶÷: kk yap ¹Þ´Â»ç¶÷ : Min-Hyup KANG ÂüÁ¶ : NOX-dev ³¯Â¥: 2011³â 7¿ù 22ÀÏ ±Ý¿äÀÏ, 10½Ã 25ºÐ 34ÃÊ +0900Á¦¸ñ: Re: [nox-dev] handle_flow_route Event

	Sorry, I continue to be lost.if you want to send flows to ENVI, look at lavi_hostflow.cc line 34 to 60 for an example.  Basically, a list of flow is created and the send_flow_list function is called.

RegardsKK2011/7/21 Min-Hyup KANG 




	
	
Yes, sorry for not clearness.2, "One of the lavi component (though I forgot which one) will listen for that event and send a message to ENVI.  " 

so, I don't know flow_route_event is run at some point in lavi_hostflow.cccan you give me some tips ?thanks, - ¿øº» ¸ÞÀÏ -

º¸³½»ç¶÷: kk yap 

¹Þ´Â»ç¶÷ : Min-Hyup KANG ÂüÁ¶ : NOX-dev 

³¯Â¥: 2011³â 7¿ù 22ÀÏ ±Ý¿äÀÏ, 09½Ã 36ºÐ 46ÃÊ +0900, and which one of the lavi comÁ¦¸ñ: Re: [nox-dev] handle_flow_route Event

	Is there a question in this email?KK2011/7/21 Min-Hyup KANG 






	
	
Thank you for your response.1. " You need to include the header file for the definition of the event, then create the event, populate it and post it."



->Basically, there is part of flow_route_event in lavi_hostflow.cc. so I don't have to include the header file, right ?. register_handler      (boost::bind(&lavi_hostflow::handle_flow_route, this, _1));



  Disposition lavi_hostflow::handle_flow_route(const Event& e).2, "One of the lavi component (though I forgot which one) will listen for that event and send a message to ENVI.  "



-> lavi_hostflow inherit lavi_flows, so lavi_hostflow has JSONmsg_event handler.I think JSONmsg_event handler seems to check type, command, node_type.if command is request,  send_list->send_flow_list(reply add)



if subscribe , interested.push_backif unsubscribe, interested.erase,so, I don't know flow_route_event is run at some point,   register_handler     (boost::bind(&lavi_flows::handle_req, this, _1));



  Disposition lavi_flows::handle_req(const Event& e)  {    const JSONMsg_event& jme = assert_cast(e)Thanks,



- ¿øº» ¸ÞÀÏ -



º¸³½»ç¶÷: kk yap ¹Þ´Â»ç¶÷ : Min-Hyup KANG 



ÂüÁ¶ : NOX-dev ³¯Â¥: 2011³â 7¿ù 22ÀÏ ±Ý¿äÀÏ, 01½Ã 59ºÐ 28ÃÊ +0900Á¦¸ñ: Re: [nox-dev] handle_flow_route Event





	Hi,This is a standard procedure in NOX.  You need to include the header file for the definition of the event, then create the event, populate it and post it.  One of the lavi component (though I forgot which one) will listen for that event and send a message to ENVI.  Look at lavi_hosts (I think) for an example.





RegardsKKPS>> Sorry, I did not find time to look up the code before replying. 2011/7/18 Min-Hyup KANG 








	
	
Hi All,I am currently trying to understand relation between LAVI and ENVI.

especially, I am looking at part of lavi_flow and lavi_hostflow to add and delete on ENVI.To handle event such as add and delete flows on ENVI, I think I should generate Handle_flow_route event in netapps/lavi/lavi_hostflow.cc.





so, how can I generate handle_flow_route event ? or where does it operate the event ?






			Best Regards,
Min-Hyup KANG  


 

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


		







			Best Regards,
Min-Hyup KANG  


 



		







			Best Regards,
Min-Hyup KANG  


 



		







			Best Regards,
Min-Hyup KANG  


 

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


Re: [nox-dev] handle_flow_route Event

2011-07-21 Thread kk yap
2011/7/21 Min-Hyup KANG 

>   Thank you for your great response.
>
> Yes,
>
> handle_flow_route is existing in lavi_hostflow.cc line 34~60.
>
> and handle_flow_route event call send_flow_list_function.
>
>
> My main question is "when does handle_flow_route event occur? "
>

I guess the answer is when there is a flow mod to the host.  You can verify
by doing a grep to see which component post the event.

Hope this is useful.

Regards
KK


> for example handle_req handling JSON event occur, when lavi receive json
> message from envi.
>
>
>
> - 원본 메일 -
>
> *보낸사람*: kk yap 
> *받는사람* : Min-Hyup KANG 
> *참조* : NOX-dev 
> *날짜*: 2011년 7월 22일 금요일, 10시 25분 34초 +0900
>
> *제목*: Re: [nox-dev] handle_flow_route Event
>  Sorry, I continue to be lost.
>
> if you want to send flows to ENVI, look at lavi_hostflow.cc line 34 to 60
> for an example.  Basically, a list of flow is created and the send_flow_list
> function is called.
>
> Regards
> KK
>
> 2011/7/21 Min-Hyup KANG 
> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
> >
>
>>   Yes, sorry for not clearness.
>>
>>
>> 2, "One of the lavi component (though I forgot which one) will listen for
>> that event and send a message to ENVI.  "
>>
>> 
>>
>> 
>>
>> so, I don't know flow_route_event is run at some point in lavi_hostflow.cc
>>
>> can you give me some tips ?
>>
>>
>> thanks,
>>
>>
>> - 원본 메일 -
>>
>> *보낸사람*: kk yap 
>> http://hanmail/mail/MailComposeFrame.daum?TO=yap...@stanford.edu>
>> >
>> *받는사람* : Min-Hyup KANG 
>> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
>> >
>> *참조* : NOX-dev 
>> http://hanmail/mail/MailComposeFrame.daum?TO=nox-dev@noxrepo.org>
>> >
>> *날짜*: 2011년 7월 22일 금요일, 09시 36분 46초 +0900, and which one of the lavi com
>>
>> *제목*: Re: [nox-dev] handle_flow_route Event
>> Is there a question in this email?
>>
>> KK
>>
>> 2011/7/21 Min-Hyup KANG 
>> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
>> >
>>
>>>   Thank you for your response.
>>>
>>>
>>> 1. " You need to include the header file for the definition of the
>>> event, then create the event, populate it and post it."
>>>
>>> ->Basically, there is part of flow_route_event in lavi_hostflow.cc. so I
>>> don't have to include the header file, right ?
>>>
>>> .
>>>
>>> register_handler
>>>
>>>   (boost::bind(&lavi_hostflow::handle_flow_route, this, _1));
>>>
>>>   Disposition lavi_hostflow::handle_flow_route(const Event& e)
>>>
>>> .
>>>
>>>
>>> 2, "One of the lavi component (though I forgot which one) will listen
>>> for that event and send a message to ENVI.  "
>>>
>>> -> lavi_hostflow inherit lavi_flows, so lavi_hostflow has JSONmsg_event
>>> handler.
>>>
>>> I think JSONmsg_event handler seems to check type, command, node_type.
>>>
>>> if command is request,  send_list->send_flow_list(reply add)
>>>
>>> if subscribe , interested.push_back
>>>
>>> if unsubscribe, interested.erase,
>>>
>>> so, I don't know flow_route_event is run at some point,
>>>
>>> 
>>>
>>>  register_handler
>>>
>>>  (boost::bind(&lavi_flows::handle_req, this, _1));
>>>
>>>
>>>   Disposition lavi_flows::handle_req(const Event& e)
>>>
>>>   {
>>>
>>> const JSONMsg_event& jme = assert_cast(e)
>>>
>>> 
>>>
>>>
>>> Thanks,
>>>
>>>
>>> - 원본 메일 -
>>>
>>> *보낸사람*: kk yap 
>>> http://hanmail/mail/MailComposeFrame.daum?TO=yap...@stanford.edu>
>>> >
>>> *받는사람* : Min-Hyup KANG 
>>> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
>>> >
>>> *참조* : NOX-dev 
>>> http://hanmail/mail/MailComposeFrame.daum?TO=nox-dev@noxrepo.org>
>>> >
>>> *날짜*: 2011년 7월 22일 금요일, 01시 59분 28초 +0900
>>> *제목*: Re: [nox-dev] handle_flow_route Event
>>>
>>> Hi,
>>>
>>> This is a standard procedure in NOX.  You need to include the header file
>>> for the definition of the event, then create the event, populate it and post
>>> it.  One of the lavi component (though I forgot which one) will listen for
>>> that event and send a message to ENVI.  Look at lavi_hosts (I think) for an
>>> example.
>>>
>>> Regards
>>> KK
>>>
>>> PS>> Sorry, I did not find time to look up the code before replying.
>>>
>>> 2011/7/18 Min-Hyup KANG 
>>> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
>>> >
>>>
   Hi All,


 I am currently trying to understand relation between LAVI and ENVI.


 especially, I am looking at part of lavi_flow and lavi_hostflow to add
 and delete on ENVI.


 To handle event such as add and delete flows on ENVI,


  I think I should generate Handle_flow_route event in
 netapps/lavi/lavi_hostflow.cc.


 so, how can I generate handle_flow_route event ? or where does it
 operate the event ?





 Best Regards,
 Min-Hyup KANG

 
 ___
 nox-dev 

Re: [nox-dev] handle_flow_route Event

2011-07-21 Thread Min-Hyup KANG



	
	
thank you so much !I will try it !!- 원본 메일 -보낸사람: kk yap 받는사람 : Min-Hyup KANG 참조 : NOX-dev 날짜: 2011년 7월 22일 금요일, 12시 44분 27초 +0900제목: Re: [nox-dev] handle_flow_route Event

	2011/7/21 Min-Hyup KANG 




	
	
Thank you for your great response.Yes, handle_flow_route is existing in lavi_hostflow.cc line 34~60.

and handle_flow_route event call send_flow_list_function.My main question is "when does handle_flow_route event occur? "

I guess the answer is when there is a flow mod to the host.  You can verify by doing a grep to see which component post the event.Hope this is useful.

RegardsKK 

for example handle_req handling JSON event occur, when lavi receive json message from envi.

- 원본 메일 -

보낸사람: kk yap 받는사람 : Min-Hyup KANG 

참조 : NOX-dev 날짜: 2011년 7월 22일 금요일, 10시 25분 34초 +0900제목: Re: [nox-dev] handle_flow_route Event



	Sorry, I continue to be lost.if you want to send flows to ENVI, look at lavi_hostflow.cc line 34 to 60 for an example.  Basically, a list of flow is created and the send_flow_list function is called.



RegardsKK2011/7/21 Min-Hyup KANG 






	
	
Yes, sorry for not clearness.2, "One of the lavi component (though I forgot which one) will listen for that event and send a message to ENVI.  " 



so, I don't know flow_route_event is run at some point in lavi_hostflow.cccan you give me some tips ?thanks, - 원본 메일 -



보낸사람: kk yap 



받는사람 : Min-Hyup KANG 참조 : NOX-dev 



날짜: 2011년 7월 22일 금요일, 09시 36분 46초 +0900, and which one of the lavi com제목: Re: [nox-dev] handle_flow_route Event

	Is there a question in this email?KK2011/7/21 Min-Hyup KANG 








	
	
Thank you for your response.1. " You need to include the header file for the definition of the event, then create the event, populate it and post it."





->Basically, there is part of flow_route_event in lavi_hostflow.cc. so I don't have to include the header file, right ?. register_handler      (boost::bind(&lavi_hostflow::handle_flow_route, this, _1));





  Disposition lavi_hostflow::handle_flow_route(const Event& e).2, "One of the lavi component (though I forgot which one) will listen for that event and send a message to ENVI.  "





-> lavi_hostflow inherit lavi_flows, so lavi_hostflow has JSONmsg_event handler.I think JSONmsg_event handler seems to check type, command, node_type.if command is request,  send_list->send_flow_list(reply add)





if subscribe , interested.push_backif unsubscribe, interested.erase,so, I don't know flow_route_event is run at some point,   register_handler     (boost::bind(&lavi_flows::handle_req, this, _1));





  Disposition lavi_flows::handle_req(const Event& e)  {    const JSONMsg_event& jme = assert_cast(e)Thanks,





- 원본 메일 -





보낸사람: kk yap 받는사람 : Min-Hyup KANG 





참조 : NOX-dev 날짜: 2011년 7월 22일 금요일, 01시 59분 28초 +0900제목: Re: [nox-dev] handle_flow_route Event







	Hi,This is a standard procedure in NOX.  You need to include the header file for the definition of the event, then create the event, populate it and post it.  One of the lavi component (though I forgot which one) will listen for that event and send a message to ENVI.  Look at lavi_hosts (I think) for an example.







RegardsKKPS>> Sorry, I did not find time to look up the code before replying. 2011/7/18 Min-Hyup KANG 










	
	
Hi All,I am currently trying to understand relation between LAVI and ENVI.

especially, I am looking at part of lavi_flow and lavi_hostflow to add and delete on ENVI.To handle event such as add and delete flows on ENVI, I think I should generate Handle_flow_route event in netapps/lavi/lavi_hostflow.cc.







so, how can I generate handle_flow_route event ? or where does it operate the event ?






			Best Regards,
Min-Hyup KANG  


 

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


		







			Best Regards,
Min-Hyup KANG  


 



		







			Best Regards,
Min-Hyup KANG  


 



		







			Best Regards,
Min-Hyup KANG  


 



		







			Best Regards,
Min-Hyup KANG  


 

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