Begin to write defines for netpfga instead of actions
This commit is contained in:
parent
a3dd7ee106
commit
5478e9fad7
3 changed files with 31 additions and 56 deletions
|
|
@ -2,33 +2,10 @@
|
|||
#include <sume_switch.p4>
|
||||
#include "headers.p4"
|
||||
|
||||
/* required for netfpga */
|
||||
#define USE_NICO_DELTA_CHECKSUM 1
|
||||
|
||||
|
||||
// typedef bit<48> EthAddr_t;
|
||||
// header Ethernet_h {
|
||||
// EthAddr_t dstAddr;
|
||||
// EthAddr_t srcAddr;
|
||||
// bit<16> etherType;
|
||||
// }
|
||||
|
||||
//typedef struct headers Parsed_packet;
|
||||
|
||||
#define Parsed_packet headers
|
||||
#define user_metadata_t metadata
|
||||
|
||||
//struct Parsed_packet {
|
||||
// Ethernet_h ethernet;
|
||||
//}
|
||||
|
||||
// user defined metadata: can be used to share information between
|
||||
// TopParser, TopPipe, and TopDeparser
|
||||
//struct user_metadata_t {
|
||||
// bit<8> unused;
|
||||
//}
|
||||
|
||||
// digest_data, MUST be 256 bits -- what is this used for?
|
||||
// digest_data, MUST be 256 bits -- not using it
|
||||
struct digest_data_t {
|
||||
bit<256> unused;
|
||||
}
|
||||
|
|
@ -127,6 +104,7 @@ control RealMain(
|
|||
}
|
||||
|
||||
apply {
|
||||
bit<17> tmp17 = 0;
|
||||
if(hdr.ipv6.isValid()) {
|
||||
if(nat64.apply().hit) { /* generic / static nat64 done */
|
||||
if(hdr.icmp6.isValid()) {
|
||||
|
|
@ -143,20 +121,12 @@ control RealMain(
|
|||
}
|
||||
|
||||
if(hdr.udp.isValid()) {
|
||||
bit<17> tmp17 = 0;
|
||||
//delta_prepare();
|
||||
//delta_udp_from_v6_to_v4();
|
||||
//stupid();
|
||||
delta_udp_from_v6_to_v4
|
||||
}
|
||||
// if(hdr.tcp.isValid()) {
|
||||
// #ifdef USE_NICO_DELTA_CHECKSUM
|
||||
// delta_tcp_from_v6_to_v4();
|
||||
// #else
|
||||
|
||||
// meta.chk_tcp_v4 = 1;
|
||||
// #endif
|
||||
// }
|
||||
if(hdr.tcp.isValid()) {
|
||||
delta_tcp_from_v6_to_v4
|
||||
}
|
||||
|
||||
v4_networks.apply(); /* apply egress for IPv4 */
|
||||
exit; /* no further v6 processing */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue