kytos-ng / of_lldp

Kytos LLDP Openflow Network Application (NApp)

Home Page:https://kytos-ng.github.io/api/of_lldp.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change of_lldp to use flow_manager to install flows

ajoaoff opened this issue · comments

Original issue opened by @cmagnobarbosa at kytos#55.

Today, kytos/of_lldp is installing flows without using kytos/flow_manager. It is necessary to change this behavior to use kytos/flow_manager, avoiding problems related to the persistence of the flow (kytos/flow_manager#89).

Possible solution:

Change https://github.com/kytos/of_lldp/blob/master/main.py#L135

        if flow_mod:
            name = 'kytos/of_lldp.messages.out.ofpt_flow_mod'
            content = {'destination': event.content['switch'].connection,
                       'message': flow_mod}

            event_out = KytosEvent(name=name, content=content)
            self.controller.buffers.msg_out.put(event_out)

to

     
   if flow_mod:
       endpoint = '.../flow_manager/v2/flows/{switch.id}'

        data = {"flows": flow_mod}
        requests.post(endpoint, json=data)