PERFORCE change 150638 for review
Ryan French
rfrench at FreeBSD.org
Mon Sep 29 02:53:15 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=150638
Change 150638 by rfrench at rfrench_mpls on 2008/09/29 02:52:48
Made some changed to mpls-needle for debugging to check that the correctethertype was being assigned to the packet.
Affected files ...
.. //depot/projects/soc2008/rfrench_mpls/mpls-needle/mpls-needle.c#6 edit
Differences ...
==== //depot/projects/soc2008/rfrench_mpls/mpls-needle/mpls-needle.c#6 (text+ko) ====
@@ -35,6 +35,7 @@
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_dl.h>
+#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
@@ -366,32 +367,34 @@
/*
* The following lines are used during debugging to check the values extracted from the
* config file are correct. Uncomment these when debugging.
- * printf("\nbuilt packets values\n");
- *
- * printf("dst_mac = %s\n", ether_ntoa(&dst_mac));
- * printf("src_mac = %s\n", ether_ntoa(&src_mac));
+ */
+ printf("\nbuilt packets values\n");
+
+ printf("dst_mac = %s\n", ether_ntoa(&dst_mac));
+ printf("src_mac = %s\n", ether_ntoa(&src_mac));
+ printf("ethertype = %x\n", ntohs(eth->ether_type));
+
+ printf("ip_hl = %d\n", iph->ip_hl);
+ printf("ip_v = %d\n", iph->ip_v);
+ printf("ip_tos = %d\n", iph->ip_tos);
+ printf("ip_len = %d\n", iph->ip_len);
+ printf("ip_id = %d\n", iph->ip_id);
+ printf("ip_off = %d\n", iph->ip_off);
+ printf("ip_ttl = %d\n", iph->ip_ttl);
+ printf("ip_p = %d\n", iph->ip_p);
+ printf("ip_sum = %d\n", iph->ip_sum);
+ printf("ip_src = %s\n", inet_ntoa(iph->ip_src));
+ printf("ip_dst = %s\n", inet_ntoa(iph->ip_dst));
+
+ printf("icmp_type = %d\n", icmph->icmp_type);
+ printf("icmp_code = %d\n", icmph->icmp_code);
+ printf("icmp_cksum = %d\n", icmph->icmp_cksum);
- * printf("ip_hl = %d\n", iph->ip_hl);
- * printf("ip_v = %d\n", iph->ip_v);
- * printf("ip_tos = %d\n", iph->ip_tos);
- * printf("ip_len = %d\n", iph->ip_len);
- * printf("ip_id = %d\n", iph->ip_id);
- * printf("ip_off = %d\n", iph->ip_off);
- * printf("ip_ttl = %d\n", iph->ip_ttl);
- * printf("ip_p = %d\n", iph->ip_p);
- * printf("ip_sum = %d\n", iph->ip_sum);
- * printf("ip_src = %s\n", inet_ntoa(iph->ip_src));
- * printf("ip_dst = %s\n", inet_ntoa(iph->ip_dst));
- *
- * printf("icmp_type = %d\n", icmph->icmp_type);
- * printf("icmp_code = %d\n", icmph->icmp_code);
- * printf("icmp_cksum = %d\n", icmph->icmp_cksum);
- *
- * printf("mpls_label = %d\n", mpls_label);
- * printf("mpls_qos = %d\n", mpls_qos);
- * printf("mpls_bos_flag = %d\n", mpls_bos_flag);
- * printf("mpls_ttl = %d\n", mpls_ttl);
- */
+ printf("mpls_label = %d\n", mpls_label);
+ printf("mpls_qos = %d\n", mpls_qos);
+ printf("mpls_bos_flag = %d\n", mpls_bos_flag);
+ printf("mpls_ttl = %d\n", mpls_ttl);
+
return 0;
}
More information about the p4-projects
mailing list