| 227 | == Useful Tips for writing your controller == |
| 228 | In order to make this first experience of writing controller easier, we wrote some helpful functions that will abstract some of the particularities of PoX away. |
| 229 | These functions are locates at `/local/pox/ext/utils.py`, so while you write your controller consult this file for details. |
| 230 | |
| 231 | Functions that are implemented include: |
| 232 | * packetIsIP : Test if the packet is IP |
| 233 | * packetIsARP : Test if the packet is ARP |
| 234 | * packetIsRequestARP : Test if this is an ARP Request packet |
| 235 | * packetIsReplyARP : Test if this is an ARP Reply packet |
| 236 | * packetArpDstIp : Test what is the destination IP in an ARP packet |
| 237 | * packetArpSrcIp : Test what is the sources IP in an ARP packet |
| 238 | * packetIsTCP : Test if a packet is TCP |
| 239 | * packetDstIp : Test the destination IP of a packet |
| 240 | * packetSrcIp : Test the source IP of a packet |
| 241 | * packetDstTCPPort : Test the destination TCP port of a packet |
| 242 | * packetSrcTCPPort : Test the source TCP port of a packet |
| 243 | * createOFAction : Create one OpenFlow action |
| 244 | * getFullMatch : get the full match out of a packet |
| 245 | * createFlowMod : create a flow mod |
| 246 | * createArpRequest : Create an Arp Request for a different destination IP |
| 247 | * createArpReply : Create an Arp Reply for a different source IP |
| 248 | |
| 249 | |