blob: a721ff2231419c3ceccf56a1332eed3cd262e7c5 [file] [log] [blame]
HIGUCHI Yuta356086e2013-06-12 15:21:19 -07001package net.onrc.onos.ofcontroller.util;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08002
3import net.floodlightcontroller.util.MACAddress;
Pavlin Radoslavovad008e02013-02-21 18:42:42 -08004
5import org.codehaus.jackson.annotate.JsonProperty;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08006
7/**
8 * The class representing the Flow Entry Matching filter.
9 *
10 * The Flow Entry matching filter that is used to specify
11 * the network data that would be forwarded on the data path from
Pavlin Radoslavovede97582013-03-08 18:57:28 -080012 * the source to the destination. Examples: source or destination MAC address,
13 * IP prefix that includes the destination's IP address, etc.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080014 */
15public class FlowEntryMatch {
Pavlin Radoslavovede97582013-03-08 18:57:28 -080016 /**
17 * A class for storing a value to match.
18 */
19 class Field<T> {
20 /**
21 * Default constructor.
22 */
23 public Field() {
24 this.enabled = false;
25 }
26
27 /**
28 * Constructor for a given value to match.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070029 *
30 * @param value the value to match.
Pavlin Radoslavovede97582013-03-08 18:57:28 -080031 */
32 public Field(T value) {
33 this.value = value;
34 this.enabled = true;
35 }
36
37 /**
38 * Get the value.
39 *
40 * @return the value.
41 */
42 public T value() { return this.value; }
43
44 /**
45 * Enable the matching for a given value.
46 *
47 * @param value the value to set.
48 */
49 public void enableMatch(T value) {
50 this.value = value;
51 this.enabled = true;
52 }
53
54 /**
55 * Disable the matching.
56 */
57 public void disableMatch() {
58 this.enabled = false;
59 }
60
61 /**
62 * Test whether matching is enabled.
63 *
64 * @return true if matching is enabled, otherwise false.
65 */
66 public boolean enabled() { return this.enabled; }
67
68 private T value; // The value to match
69 private boolean enabled; // Set to true, if matching is enabled
70 }
71
72 private Field<Port> inPort; // Matching input switch port
73 private Field<MACAddress> srcMac; // Matching source MAC address
74 private Field<MACAddress> dstMac; // Matching destination MAC address
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -070075 private Field<Short> ethernetFrameType; // Matching Ethernet frame type
Pavlin Radoslavovede97582013-03-08 18:57:28 -080076 private Field<Short> vlanId; // Matching VLAN ID
77 private Field<Byte> vlanPriority; // Matching VLAN priority
Pavlin Radoslavovede97582013-03-08 18:57:28 -080078 private Field<IPv4Net> srcIPv4Net; // Matching source IPv4 prefix
79 private Field<IPv4Net> dstIPv4Net; // Matching destination IPv4 prefix
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -070080 private Field<Byte> ipProto; // Matching IP protocol
81 private Field<Byte> ipToS; // Matching IP ToS (DSCP field, 6 bits)
Pavlin Radoslavovede97582013-03-08 18:57:28 -080082 private Field<Short> srcTcpUdpPort; // Matching source TCP/UDP port
83 private Field<Short> dstTcpUdpPort; // Matching destination TCP/UDP port
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080084
85 /**
86 * Default constructor.
87 */
88 public FlowEntryMatch() {
89 }
90
91 /**
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070092 * Copy constructor.
93 *
94 * @param other the object to copy from.
95 */
96 public FlowEntryMatch(FlowEntryMatch other) {
97 if ((other.inPort != null) && other.inPort.enabled())
98 this.enableInPort(other.inPort.value());
99 if ((other.srcMac != null) && other.srcMac.enabled())
100 this.enableSrcMac(other.srcMac.value());
101 if ((other.dstMac != null) && other.dstMac.enabled())
102 this.enableDstMac(other.dstMac.value());
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700103 if ((other.ethernetFrameType != null) && other.ethernetFrameType.enabled())
104 this.enableEthernetFrameType(other.ethernetFrameType.value());
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700105 if ((other.vlanId != null) && other.vlanId.enabled())
106 this.enableVlanId(other.vlanId.value());
107 if ((other.vlanPriority != null) && other.vlanPriority.enabled())
108 this.enableVlanPriority(other.vlanPriority.value());
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700109 if ((other.srcIPv4Net != null) && other.srcIPv4Net.enabled())
110 this.enableSrcIPv4Net(other.srcIPv4Net.value());
111 if ((other.dstIPv4Net != null) && other.dstIPv4Net.enabled())
112 this.enableDstIPv4Net(other.dstIPv4Net.value());
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700113 if ((other.ipProto != null) && other.ipProto.enabled())
114 this.enableIpProto(other.ipProto.value());
115 if ((other.ipToS != null) && other.ipToS.enabled())
116 this.enableIpToS(other.ipToS.value());
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700117 if ((other.srcTcpUdpPort != null) && other.srcTcpUdpPort.enabled())
118 this.enableSrcTcpUdpPort(other.srcTcpUdpPort.value());
119 if ((other.dstTcpUdpPort != null) && other.dstTcpUdpPort.enabled())
120 this.enableDstTcpUdpPort(other.dstTcpUdpPort.value());
121 }
122
123 /**
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800124 * Get the matching input switch port.
125 *
126 * @return the matching input switch port.
127 */
128 @JsonProperty("inPort")
129 public Port inPort() {
130 if (inPort != null)
131 return inPort.value();
132 return null;
133 }
134
135 /**
136 * Enable the matching on input switch port.
137 *
138 * @param inPort the input switch port value to enable for matching.
139 */
140 @JsonProperty("inPort")
141 public void enableInPort(Port inPort) {
142 this.inPort = new Field<Port>(inPort);
143 }
144
145 /**
146 * Disable the matching on input switch port.
147 */
148 public void disableInPort() {
149 this.inPort = null;
150 }
151
152 /**
153 * Test if matching on input switch port is enabled.
154 *
155 * @return true if matching on input switch port is enabled.
156 */
157 @JsonProperty("matchInPort")
158 public boolean matchInPort() {
159 if (inPort != null)
160 return inPort.enabled();
161 return false;
162 }
163
164 /**
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800165 * Get the matching source MAC address.
166 *
167 * @return the matching source MAC address.
168 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800169 @JsonProperty("srcMac")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800170 public MACAddress srcMac() {
171 if (srcMac != null)
172 return srcMac.value();
173 return null;
174 }
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800175
176 /**
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800177 * Enable the matching on source MAC address.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800178 *
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800179 * @param srcMac the source MAC address value to enable for matching.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800180 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800181 @JsonProperty("srcMac")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800182 public void enableSrcMac(MACAddress srcMac) {
183 this.srcMac = new Field<MACAddress>(srcMac);
184 }
185
186 /**
187 * Disable the matching on source MAC address.
188 */
189 public void disableSrcMac() {
190 this.srcMac = null;
191 }
192
193 /**
194 * Test if matching on source MAC address is enabled.
195 *
196 * @return true if matching on source MAC address is enabled.
197 */
198 @JsonProperty("matchSrcMac")
199 public boolean matchSrcMac() {
200 if (srcMac != null)
201 return srcMac.enabled();
202 return false;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800203 }
204
205 /**
206 * Get the matching destination MAC address.
207 *
208 * @return the matching destination MAC address.
209 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800210 @JsonProperty("dstMac")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800211 public MACAddress dstMac() {
212 if (dstMac != null)
213 return dstMac.value();
214 return null;
215 }
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800216
217 /**
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800218 * Enable the matching on destination MAC address.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800219 *
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800220 * @param dstMac the destination MAC address value to enable for matching.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800221 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800222 @JsonProperty("dstMac")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800223 public void enableDstMac(MACAddress dstMac) {
224 this.dstMac = new Field<MACAddress>(dstMac);
225 }
226
227 /**
228 * Disable the matching on destination MAC address.
229 */
230 public void disableDstMac() {
231 this.dstMac = null;
232 }
233
234 /**
235 * Test if matching on destination MAC address is enabled.
236 *
237 * @return true if matching on destination MAC address is enabled.
238 */
239 @JsonProperty("matchDstMac")
240 public boolean matchDstMac() {
241 if (dstMac != null)
242 return dstMac.enabled();
243 return false;
244 }
245
246 /**
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700247 * Get the matching Ethernet frame type.
248 *
249 * @return the matching Ethernet frame type.
250 */
251 @JsonProperty("ethernetFrameType")
252 public Short ethernetFrameType() {
253 if (ethernetFrameType != null)
254 return ethernetFrameType.value();
255 return null;
256 }
257
258 /**
259 * Enable the matching on Ethernet frame type.
260 *
261 * @param ethernetFrameType the Ethernet frame type value to enable for
262 * matching.
263 */
264 @JsonProperty("ethernetFrameType")
265 public void enableEthernetFrameType(Short ethernetFrameType) {
266 this.ethernetFrameType = new Field<Short>(ethernetFrameType);
267 }
268
269 /**
270 * Disable the matching on Ethernet frame type.
271 */
272 public void disableEthernetFrameType() {
273 this.ethernetFrameType = null;
274 }
275
276 /**
277 * Test if matching on Ethernet frame type is enabled.
278 *
279 * @return true if matching on Ethernet frame type is enabled.
280 */
281 @JsonProperty("matchEthernetFrameType")
282 public boolean matchEthernetFrameType() {
283 if (ethernetFrameType != null)
284 return ethernetFrameType.enabled();
285 return false;
286 }
287
288 /**
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800289 * Get the matching VLAN ID.
290 *
291 * @return the matching VLAN ID.
292 */
293 @JsonProperty("vlanId")
294 public Short vlanId() {
295 if (vlanId != null)
296 return vlanId.value();
297 return null;
298 }
299
300 /**
301 * Enable the matching on VLAN ID.
302 *
303 * @param vlanId the VLAN ID value to enable for matching.
304 */
305 @JsonProperty("vlanId")
306 public void enableVlanId(Short vlanId) {
307 this.vlanId = new Field<Short>(vlanId);
308 }
309
310 /**
311 * Disable the matching on VLAN ID.
312 */
313 public void disableVlanId() {
314 this.vlanId = null;
315 }
316
317 /**
318 * Test if matching on VLAN ID is enabled.
319 *
320 * @return true if matching on VLAN ID is enabled.
321 */
322 @JsonProperty("matchVlanId")
323 public boolean matchVlanId() {
324 if (vlanId != null)
325 return vlanId.enabled();
326 return false;
327 }
328
329 /**
330 * Get the matching VLAN priority.
331 *
332 * @return the matching VLAN priority.
333 */
334 @JsonProperty("vlanPriority")
335 public Byte vlanPriority() {
336 if (vlanPriority != null)
337 return vlanPriority.value();
338 return null;
339 }
340
341 /**
342 * Enable the matching on VLAN priority.
343 *
344 * @param vlanPriority the VLAN priority value to enable for matching.
345 */
346 @JsonProperty("vlanPriority")
347 public void enableVlanPriority(Byte vlanPriority) {
348 this.vlanPriority = new Field<Byte>(vlanPriority);
349 }
350
351 /**
352 * Disable the matching on VLAN priority.
353 */
354 public void disableVlanPriority() {
355 this.vlanPriority = null;
356 }
357
358 /**
359 * Test if matching on VLAN priority is enabled.
360 *
361 * @return true if matching on VLAN priority is enabled.
362 */
363 @JsonProperty("matchVlanPriority")
364 public boolean matchVlanPriority() {
365 if (vlanPriority != null)
366 return vlanPriority.enabled();
367 return false;
368 }
369
370 /**
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800371 * Get the matching source IPv4 prefix.
372 *
373 * @return the matching source IPv4 prefix.
374 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800375 @JsonProperty("srcIPv4Net")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800376 public IPv4Net srcIPv4Net() {
377 if (srcIPv4Net != null)
378 return srcIPv4Net.value();
379 return null;
380 }
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800381
382 /**
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800383 * Enable the matching on source IPv4 prefix.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800384 *
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800385 * @param srcIPv4Net the source IPv4 prefix value to enable for matching.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800386 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800387 @JsonProperty("srcIPv4Net")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800388 public void enableSrcIPv4Net(IPv4Net srcIPv4Net) {
389 this.srcIPv4Net = new Field<IPv4Net>(srcIPv4Net);
390 }
391
392 /**
393 * Disable the matching on source IPv4 prefix.
394 */
395 public void disableSrcIPv4Net() {
396 this.srcIPv4Net = null;
397 }
398
399 /**
400 * Test if matching on source IPv4 prefix is enabled.
401 *
402 * @return true if matching on source IPv4 prefix is enabled.
403 */
404 @JsonProperty("matchSrcIPv4Net")
405 public boolean matchSrcIPv4Net() {
406 if (srcIPv4Net != null)
407 return srcIPv4Net.enabled();
408 return false;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800409 }
410
411 /**
412 * Get the matching destination IPv4 prefix.
413 *
414 * @return the matching destination IPv4 prefix.
415 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800416 @JsonProperty("dstIPv4Net")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800417 public IPv4Net dstIPv4Net() {
418 if (dstIPv4Net != null)
419 return dstIPv4Net.value();
420 return null;
421 }
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800422
423 /**
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800424 * Enable the matching on destination IPv4 prefix.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800425 *
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800426 * @param dstIPv4Net the destination IPv4 prefix value to enable for
427 * matching.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800428 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800429 @JsonProperty("dstIPv4Net")
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800430 public void enableDstIPv4Net(IPv4Net dstIPv4Net) {
431 this.dstIPv4Net = new Field<IPv4Net>(dstIPv4Net);
432 }
433
434 /**
435 * Disable the matching on destination IPv4 prefix.
436 */
437 public void disableDstIPv4Net() {
438 this.dstIPv4Net = null;
439 }
440
441 /**
442 * Test if matching on destination IPv4 prefix is enabled.
443 *
444 * @return true if matching on destination IPv4 prefix is enabled.
445 */
446 @JsonProperty("matchDstIPv4Net")
447 public boolean matchDstIPv4Net() {
448 if (dstIPv4Net != null)
449 return dstIPv4Net.enabled();
450 return false;
451 }
452
453 /**
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700454 * Get the matching IP protocol.
455 *
456 * @return the matching IP protocol.
457 */
458 @JsonProperty("ipProto")
459 public Byte ipProto() {
460 if (ipProto != null)
461 return ipProto.value();
462 return null;
463 }
464
465 /**
466 * Enable the matching on IP protocol.
467 *
468 * @param ipProto the IP protocol value to enable for matching.
469 */
470 @JsonProperty("ipProto")
471 public void enableIpProto(Byte ipProto) {
472 this.ipProto = new Field<Byte>(ipProto);
473 }
474
475 /**
476 * Disable the matching on IP protocol.
477 */
478 public void disableIpProto() {
479 this.ipProto = null;
480 }
481
482 /**
483 * Test if matching on IP protocol is enabled.
484 *
485 * @return true if matching on IP protocol is enabled.
486 */
487 @JsonProperty("matchIpProto")
488 public boolean matchIpProto() {
489 if (ipProto != null)
490 return ipProto.enabled();
491 return false;
492 }
493
494 /**
495 * Get the matching IP ToS (DSCP field, 6 bits)
496 *
497 * @return the matching IP ToS.
498 */
499 @JsonProperty("ipToS")
500 public Byte ipToS() {
501 if (ipToS != null)
502 return ipToS.value();
503 return null;
504 }
505
506 /**
507 * Enable the matching on IP ToS (DSCP field, 6 bits).
508 *
509 * @param ipToS the IP ToS value to enable for matching.
510 */
511 @JsonProperty("ipToS")
512 public void enableIpToS(Byte ipToS) {
513 this.ipToS = new Field<Byte>(ipToS);
514 }
515
516 /**
517 * Disable the matching on IP ToS (DSCP field, 6 bits).
518 */
519 public void disableIpToS() {
520 this.ipToS = null;
521 }
522
523 /**
524 * Test if matching on IP ToS (DSCP field, 6 bits) is enabled.
525 *
526 * @return true if matching on IP ToS is enabled.
527 */
528 @JsonProperty("matchIpToS")
529 public boolean matchIpToS() {
530 if (ipToS != null)
531 return ipToS.enabled();
532 return false;
533 }
534
535 /**
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800536 * Get the matching source TCP/UDP port.
537 *
538 * @return the matching source TCP/UDP port.
539 */
540 @JsonProperty("srcTcpUdpPort")
541 public Short srcTcpUdpPort() {
542 if (srcTcpUdpPort != null)
543 return srcTcpUdpPort.value();
544 return null;
545 }
546
547 /**
548 * Enable the matching on source TCP/UDP port.
549 *
550 * @param srcTcpUdpPort the source TCP/UDP port to enable for matching.
551 */
552 @JsonProperty("srcTcpUdpPort")
553 public void enableSrcTcpUdpPort(Short srcTcpUdpPort) {
554 this.srcTcpUdpPort = new Field<Short>(srcTcpUdpPort);
555 }
556
557 /**
558 * Disable the matching on source TCP/UDP port.
559 */
560 public void disableSrcTcpUdpPort() {
561 this.srcTcpUdpPort = null;
562 }
563
564 /**
565 * Test if matching on source TCP/UDP port is enabled.
566 *
567 * @return true if matching on source TCP/UDP port is enabled.
568 */
569 @JsonProperty("matchSrcTcpUdpPort")
570 public boolean matchSrcTcpUdpPort() {
571 if (srcTcpUdpPort != null)
572 return srcTcpUdpPort.enabled();
573 return false;
574 }
575
576 /**
577 * Get the matching destination TCP/UDP port.
578 *
579 * @return the matching destination TCP/UDP port.
580 */
581 @JsonProperty("dstTcpUdpPort")
582 public Short dstTcpUdpPort() {
583 if (dstTcpUdpPort != null)
584 return dstTcpUdpPort.value();
585 return null;
586 }
587
588 /**
589 * Enable the matching on destination TCP/UDP port.
590 *
591 * @param dstTcpUdpPort the destination TCP/UDP port to enable for
592 * matching.
593 */
594 @JsonProperty("dstTcpUdpPort")
595 public void enableDstTcpUdpPort(Short dstTcpUdpPort) {
596 this.dstTcpUdpPort = new Field<Short>(dstTcpUdpPort);
597 }
598
599 /**
600 * Disable the matching on destination TCP/UDP port.
601 */
602 public void disableDstTcpUdpPort() {
603 this.dstTcpUdpPort = null;
604 }
605
606 /**
607 * Test if matching on destination TCP/UDP port is enabled.
608 *
609 * @return true if matching on destination TCP/UDP port is enabled.
610 */
611 @JsonProperty("matchDstTcpUdpPort")
612 public boolean matchDstTcpUdpPort() {
613 if (dstTcpUdpPort != null)
614 return dstTcpUdpPort.enabled();
615 return false;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800616 }
617
618 /**
619 * Convert the matching filter to a string.
620 *
Pavlin Radoslavovad008e02013-02-21 18:42:42 -0800621 * The string has the following form:
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -0800622 * [srcMac=XXX dstMac=XXX srcIPv4Net=XXX dstIPv4Net=XXX]
Pavlin Radoslavovad008e02013-02-21 18:42:42 -0800623 *
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800624 * @return the matching filter as a string.
625 */
626 @Override
627 public String toString() {
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800628 String ret = "[";
629 boolean addSpace = false;
630
631 //
632 // Conditionally add only those matching fields that are enabled
633 //
634 if (matchInPort()) {
635 if (addSpace)
636 ret += " ";
637 addSpace = true;
638 ret += "inPort=" + this.inPort().toString();
639 }
640 if (matchSrcMac()) {
641 if (addSpace)
642 ret += " ";
643 addSpace = true;
644 ret += "srcMac=" + this.srcMac().toString();
645 }
646 if (matchDstMac()) {
647 if (addSpace)
648 ret += " ";
649 addSpace = true;
650 ret += "dstMac=" + this.dstMac().toString();
651 }
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700652 if (matchEthernetFrameType()) {
653 if (addSpace)
654 ret += " ";
655 addSpace = true;
656 ret += "ethernetFrameType=" + this.ethernetFrameType().toString();
657 }
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800658 if (matchVlanId()) {
659 if (addSpace)
660 ret += " ";
661 addSpace = true;
662 ret += "vlanId=" + this.vlanId().toString();
663 }
664 if (matchVlanPriority()) {
665 if (addSpace)
666 ret += " ";
667 addSpace = true;
668 ret += "vlanPriority=" + this.vlanPriority().toString();
669 }
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800670 if (matchSrcIPv4Net()) {
671 if (addSpace)
672 ret += " ";
673 addSpace = true;
674 ret += "srcIPv4Net=" + this.srcIPv4Net().toString();
675 }
676 if (matchDstIPv4Net()) {
677 if (addSpace)
678 ret += " ";
679 addSpace = true;
680 ret += "dstIPv4Net=" + this.dstIPv4Net().toString();
681 }
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700682 if (matchIpProto()) {
683 if (addSpace)
684 ret += " ";
685 addSpace = true;
686 ret += "ipProto=" + this.ipProto().toString();
687 }
688 if (matchIpToS()) {
689 if (addSpace)
690 ret += " ";
691 addSpace = true;
692 ret += "ipToS=" + this.ipToS().toString();
693 }
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800694 if (matchSrcTcpUdpPort()) {
695 if (addSpace)
696 ret += " ";
697 addSpace = true;
698 ret += "srcTcpUdpPort=" + this.srcTcpUdpPort().toString();
699 }
700 if (matchDstTcpUdpPort()) {
701 if (addSpace)
702 ret += " ";
703 addSpace = true;
704 ret += "dstTcpUdpPort=" + this.dstTcpUdpPort().toString();
705 }
706
Pavlin Radoslavovad008e02013-02-21 18:42:42 -0800707 ret += "]";
Pavlin Radoslavovede97582013-03-08 18:57:28 -0800708
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800709 return ret;
710 }
711}