-
Notifications
You must be signed in to change notification settings - Fork 0
/
switch.py
25 lines (23 loc) · 997 Bytes
/
switch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
[555 Comments]
Your switch code and any other helper functions related to switch should be written in this file
"""
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.packet.arp import arp
from pox.lib.packet.ethernet import *
from pox.lib.addresses import *
from pox.lib.packet.icmp import *
from pox.lib.packet.ipv4 import *
log = core.getLogger()
"""
[555 Comments]
Function : switch_handler
Input Parameters:
sw_object : The switch object. This will be initialized in the controller file corresponding to the scenario in __init__
function of tutorial class. Any data structures you would like to use for a switch should be initialized
in the contoller file corresponding to the scenario.
packet : The packet that is received from the packet forwarding switch.
packet_in : The packet_in object that is received from the packet forwarding switch
"""
def switch_handler(sw_object, packet, packet_in):