repo_name stringlengths 8 74 | repo_path stringlengths 7 155 | content stringlengths 0 557k | id int64 0 42.6k |
|---|---|---|---|
allp4files/praveingk | /DPTP/v_16/p4_src/dptp_headers.p4 | /*******************************************************************************
* DPTP : Headers Declaration
*
*
*
*
******************************************************************************/
#ifndef _DPTP_HEADERS
#define _DPTP_HEADERS
header dptp_t {
bit<16> magic;
bit<8> command; ... | 0 |
allp4files/praveingk | /DPTP/v_16/p4_src/dptp_parser.p4 | /*******************************************************************************
* DPTP : Parser Declaration
*
*
*
*
******************************************************************************/
#ifndef _DPTP_PARSER
#define _DPTP_PARSER
#define DPTP_FOLLOWUP_DIGEST_TYPE 2
#define DPTP_REPLY_DIGEST_TYPE ... | 1 |
allp4files/praveingk | /DPTP/v_16/p4_src/dptp_simple_switch.p4 | /* -*- P4_16 -*- */
/*******************************************************************************
* Switch with DPTP enabled
* This code demonstrates how to integrate DPTP control inside any p4_16 code
*
******************************************************************************/
#include "dptp.p4"
#include... | 2 |
allp4files/L-Law1iet | /P4-SVM/src/include/parsers.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 3 |
allp4files/L-Law1iet | /P4-SVM/src/basic.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 4 |
allp4files/L-Law1iet | /P4-SVM/src/include/wcmp.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 5 |
allp4files/L-Law1iet | /P4-SVM/src/include/headers.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 7 |
allp4files/SilnoEnamored | /2022_2023-network_programming-k34212-demidyuk_o_s/lab4/basic.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
/*************************************************************************
*********************** H E A D E R S ***********************************
*************************************************************************/... | 8 |
allp4files/L-Law1iet | /P4-SVM/src/include/telemetry_report_headers.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 9 |
allp4files/praveingk | /DPTP/v_16/p4_src/dptp.p4 | /* -*- P4_16 -*- */
/*******************************************************************************
* DPTP : Data-Plane Time-synchronization Protocol
*
*
******************************************************************************/
#include <core.p4>
#if __TARGET_TOFINO__ == 2
#include <t2na.p4>
#else
#include <... | 10 |
allp4files/L-Law1iet | /P4-SVM/src/include/checksums.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 11 |
allp4files/L-Law1iet | /P4-SVM/src/include/defines.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 12 |
allp4files/L-Law1iet | /P4-SVM/src/include/port_meters.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 14 |
allp4files/L-Law1iet | /P4-SVM/src/include/actions.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 15 |
allp4files/L-Law1iet | /P4-SVM/src/include/int_definitions.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 16 |
allp4files/L-Law1iet | /P4-SVM/src/include/int_parser.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 17 |
allp4files/L-Law1iet | /P4-SVM/src/include/int_source.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 18 |
allp4files/L-Law1iet | /P4-SVM/src/include/table0.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 19 |
allp4files/L-Law1iet | /P4-SVM/src/include/port_counters.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 20 |
allp4files/L-Law1iet | /P4-SVM/src/include/int_sink.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 21 |
allp4files/L-Law1iet | /P4-SVM/src/include/custom_headers.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 23 |
allp4files/L-Law1iet | /P4-SVM/src/include/host_meter_table.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 24 |
allp4files/L-Law1iet | /P4-SVM/src/include/packet_io.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 25 |
allp4files/L-Law1iet | /P4-SVM/src/include/int_report.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 26 |
allp4files/L-Law1iet | /P4-SVM/src/include/int_headers.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 27 |
allp4files/L-Law1iet | /P4-SVM/src/include/int_transit.p4 | /*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable law or agreed to in writing, so... | 28 |
allp4files/GlaiChen | /p4lang_memcached_load_balancer/memcached.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<8> PROTOCOL_UDP = 0x11;
/*************************************************************************
*********************** H E A D E R S ***********************************
***************************************... | 30 |
allp4files/AkFormat | /up4/include/checksum.p4 | 36 | |
allp4files/AkFormat | /up4/include/define.p4 | /*
* Copyright 2020-2021 Open Networking Foundation
* Copyright 2021-present Princeton University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable... | 37 |
allp4files/L-Law1iet | /P4-SVM/src/main.p4 |
#include <core.p4>
#include <v1model.p4>
#define HASH_BASE 10w0
#define HASH_MAX 10w1023
#define ETH_TYPE_IPV4 0x0800
#define IP_PROTO_TCP 8w6
#define IP_PROTO_UDP 8w17
header ethernet_t {
bit<48> dst_addr;
bit<48> src_addr;
bit<16> ether_type;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
... | 38 |
allp4files/bartoszlomiej | /Mininet-P4-introduction/code/w6/my_code.p4 | #include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<8> TYPE_TCP = 6;
const bit<8> TYPE_UDP = 17;
/*
match_kind {
exact,
ternary,
lpm
}
#define PORT_4 4;
#define PORT_8 8;
*/
typedef bit<9> egressSpec_t;
typedef bit<48> macAddr_t;
typedef bit<32> ip4Addr_t;
typedef bit... | 39 |
allp4files/bartoszlomiej | /Mininet-P4-introduction/code/w7/meters.p4 | #include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<8> TYPE_TCP = 6;
const bit<8> TYPE_UDP = 17;
/*
match_kind {
exact
}
#define PORT_4 4;
#define PORT_8 8;
*/
typedef bit<9> egressSpec_t;
typedef bit<48> macAddr_t;
typedef bit<32> ip4Addr_t;
typedef bit<128> ip6Addr_t;
typed... | 40 |
allp4files/bartoszlomiej | /Mininet-P4-introduction/code/w8/digest.p4 | #include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<16> TYPE_8021Q = 0x8100;
/*
match_kind {
exact
}
#define PORT_4 4;
#define PORT_8 8;
*/
typedef bit<9> egressSpec_t;
typedef bit<48> macAddr_t;
typedef bit<32> ip4Addr_t;
typedef bit<16> tpid_t;
header ethernet_t{
macAdd... | 41 |
allp4files/bartoszlomiej | /Mininet-P4-introduction/code/w5/solution.p4 | #include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<16> TYPE_8021Q = 0x8100;
/*
match_kind {
exact
}
#define PORT_4 4;
#define PORT_8 8;
*/
typedef bit<9> egressSpec_t;
typedef bit<48> macAddr_t;
typedef bit<32> ip4Addr_t;
typedef bit<16> tpid_t;
header ethernet_t{
macAdd... | 42 |
allp4files/zolboo1024 | /sdn_shaping/padding.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
/*************************************************************************
*********************** H E A D E R S ***********************************
*************************************************************************/... | 43 |
allp4files/RicardoParizotto | /Tutorials_P4_TNA/simpleLB/ipv4.p4 | /* -*- P4_16 -*- */
/*******************************************************************************
* BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
*
* Copyright (c) Intel Corporation
* SPDX-License-Identifier: CC-BY-ND-4.0
*/
#include <core.p4>
#if __TARGET_TOFINO__ == 2
#include <t2na.p4>
#else
#include <tna... | 44 |
allp4files/bartoszlomiej | /Mininet-P4-introduction/code/w7/registers.p4 | #include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<16> TYPE_SAVE_PKT = 0x690;
const bit<16> TYPE_READ_PKT = 0x700;
const bit<8> TYPE_TCP = 6;
const bit<8> TYPE_UDP = 17;
/*
match_kind {
exact
}
#define PORT_4 4;
#define PORT_8 8;
*/
typedef bit<9> egressSpec_t;
typedef bit<48>... | 46 |
allp4files/RicardoParizotto | /Tutorials_P4_TNA/simpleLB/util.p4 | /* -*- P4_16 -*- */
/*******************************************************************************
* BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
*
* Copyright (c) Intel Corporation
* SPDX-License-Identifier: CC-BY-ND-4.0
*/
#ifndef _UTIL_
#define _UTIL_
parser TofinoIngressParser(
packet_in pkt,
... | 47 |
allp4files/AkFormat | /up4/include/header.p4 | /*
* Copyright 2020-2021 Open Networking Foundation
* Copyright 2021-present Princeton University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable... | 48 |
allp4files/RicardoParizotto | /Tutorials_P4_TNA/simpleLB/headers.p4 | /* -*- P4_16 -*- */
/*******************************************************************************
* BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
*
* Copyright (c) Intel Corporation
* SPDX-License-Identifier: CC-BY-ND-4.0
*/
#ifndef _HEADERS_
#define _HEADERS_
typedef bit<48> mac_addr_t;
typedef bit<32> ipv... | 49 |
allp4files/zolboo1024 | /sdn_shaping/multi_queueing.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include "./v1model.p4"
/*
* Send packets at a constant rate.
* Inject dummy packets when we cannot reach the given rate with the real traffic.
* 2 queues with different priorities. real packets are given high priority
* and dummy ones are given low priority and whatever leav... | 51 |
allp4files/RicardoParizotto | /CMP610/exercises/source_routing/source_routing.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<16> TYPE_SRCROUTING = 0x1234;
#define MAX_HOPS 9
/*************************************************************************
*********************** H E A D E R S ***********************************
**************... | 55 |
allp4files/AkFormat | /up4/include/parser.p4 | /*
* Copyright 2020-2021 Open Networking Foundation
* Copyright 2021-present Princeton University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable... | 56 |
allp4files/zolboo1024 | /sdn_shaping/v1model.p4 | /*
Copyright 2013-present Barefoot Networks, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:
Unless required by applicable law or agreed to in writing, software
distributed under th... | 57 |
allp4files/RicardoParizotto | /CMP610/exercises/qos/solution/qos.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
/* IP protocols */
const bit<8> IP_PROTOCOLS_ICMP = 1;
const bit<8> IP_PROTOCOLS_IGMP = 2;
const bit<8> IP_PROTOCOLS_IPV4 = 4;
const bit<8> IP_PROTOCOLS_TCP = 6;
const bit<8> IP_PROTOCOLS_UDP... | 59 |
allp4files/RicardoParizotto | /Tutorials_P4_TNA/simpleLB/solution/ipv4.p4 | /* -*- P4_16 -*- */
/*******************************************************************************
* BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
*
* Copyright (c) Intel Corporation
* SPDX-License-Identifier: CC-BY-ND-4.0
*/
#include <core.p4>
#if __TARGET_TOFINO__ == 2
#include <t2na.p4>
#else
#include <tna... | 62 |
allp4files/RicardoParizotto | /CMP610/exercises/load_balance/load_balance.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
/*************************************************************************
*********************** H E A D E R S ***********************************
*************************************************************************/
header ethernet_t {
bit<48> ... | 63 |
allp4files/RicardoParizotto | /CMP610/exercises/mri/solution/mri.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<8> UDP_PROTOCOL = 0x11;
const bit<16> TYPE_IPV4 = 0x800;
const bit<5> IPV4_OPTION_MRI = 31;
#define MAX_HOPS 9
/*************************************************************************
*********************** H E A D E R S *******************... | 68 |
allp4files/RicardoParizotto | /CMP610/exercises/link_monitor/link_monitor.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<16> TYPE_PROBE = 0x812;
#define MAX_HOPS 10
#define MAX_PORTS 8
/*************************************************************************
*********************** H E A D E R S **********************************... | 70 |
allp4files/RicardoParizotto | /CMP610/exercises/calc/solution/calc.p4 | /* -*- P4_16 -*- */
/*
* P4 Calculator
*
* This program implements a simple protocol. It can be carried over Ethernet
* (Ethertype 0x1234).
*
* The Protocol header looks like this:
*
* 0 1 2 3
* +----------------+----------------+----------------+-----------... | 73 |
allp4files/HyperClassifier | /HyperClassifier/hyper_ver3.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <tna.p4>
/*************************************************************************
************* C O N S T A N T S A N D T Y P E S *******************
**************************************************************************/
#define PAYLOAD_LEN hdr.ipv4.total... | 75 |
allp4files/RicardoParizotto | /CMP610/exercises/multicast/multicast.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
/*************************************************************************
*********************** H E A D E R S ***********************************
*************************************************************************/
typedef bit<9> egressSpec_t;
ty... | 76 |
allp4files/RicardoParizotto | /CMP610/exercises/firewall/firewall.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
/* CONSTANTS */
const bit<16> TYPE_IPV4 = 0x800;
const bit<8> TYPE_TCP = 6;
#define BLOOM_FILTER_ENTRIES 4096
#define BLOOM_FILTER_BIT_WIDTH 1
/*************************************************************************
*********************** H E A D E R... | 78 |
allp4files/RicardoParizotto | /Causal-Telemetry/basic.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
#define PKT_INSTANCE_TYPE_NORMAL 0
#define PKT_INSTANCE_TYPE_INGRESS_CLONE 1
#define PKT_INSTANCE_TYPE_EGRESS_CLONE 2
#define PKT_INSTANCE_TYPE_COALESCED 3
#define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4
#define PKT_INSTANCE_TYPE_REPLICATION 5
#define PKT_INSTANC... | 84 |
allp4files/AkFormat | /up4/up4.p4 | /*
* Copyright 2020-2021 Open Networking Foundation
* Copyright 2021-present Princeton University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:
*
* Unless required by applicable... | 92 |
allp4files/zyuuuid | /QPipe/includes/defines.p4 | #define PQ_PORT 8888
#define INSERT_OP 0
#define QUERY_OP 1
#define PRIORITY_NUM 100
#define QUEUE_LEN 1111
#define LEFT_BOUND 1
#define RIGHT_BOUND 1000
#define RECIRCULATED 1
#define LOWER_BOUND 0
#define UPPER_BOUND 255
#define MINIMUM_VALUE 0
#define MAXLEN ... | 94 |
allp4files/zyuuuid | /QPipe/tables.p4 | table get_pkt_info_table {
actions { get_pkt_info_action; }
default_action: get_pkt_info_action;
}
table sample_table {
actions { sample_action; }
default_action: sample_action;
}
table sample_01_table {
actions { sample_01_action; }
default_action: sample_01_action;
}
@pragma stage 0
table g... | 95 |
allp4files/zyuuuid | /QPipe/actions.p4 | action get_pkt_info_action() {
modify_field(meta.value, pq_hdr.value);
}
action sample_action() {
modify_field_rng_uniform(meta.sample, LOWER_BOUND, UPPER_BOUND);
}
action sample_01_action() {
modify_field_rng_uniform(meta.sample_01, 0, 1);
}
action get_array_to_operate_action() {
register_read(meta.... | 98 |
allp4files/oscarr777 | /comp596/l3-router.p4 | #include <core.p4>
#include <v1model.p4>
typedef bit<48> EthernetAddress;
typedef bit<32> IPv4Address;
header ethernet_t {
EthernetAddress dst_addr;
EthernetAddress src_addr;
bit<16> ether_type;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
bit<8> diffserv;
bit<16> ... | 99 |
allp4files/oscarr777 | /comp596/l2-switch.p4 | #include <core.p4>
#include <v1model.p4>
typedef bit<48> EthernetAddress;
header ethernet_t {
EthernetAddress dst_addr;
EthernetAddress src_addr;
bit<16> ether_type;
}
struct headers_t {
ethernet_t ethernet;
}
struct metadata_t {
}
error {
IPv4IncorrectVersion,
IPv4OptionsNotSupport... | 100 |
allp4files/p4-programs | /MatReduce-examples/c2/p4src/origin.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
header ethernet_t {
bit<48> dstAddr;
bit<48> srcAddr;
bit<16> etherType;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
bit<8> diffserv;
bit<16> totalLen;
bit<16> identification;
bit<3> flags;
bit<13> fragOffset;
... | 103 |
allp4files/p4-programs | /MatReduce-examples/c2/p4src/optimize.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
header ethernet_t {
bit<48> dstAddr;
bit<48> srcAddr;
bit<16> etherType;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
bit<8> diffserv;
bit<16> totalLen;
bit<16> identification;
bit<3> flags;
bit<13> fragOffset;
... | 104 |
allp4files/p4-programs | /MatReduce-examples/c1/p4src/optimize.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
header ethernet_t {
bit<48> dstAddr;
bit<48> srcAddr;
bit<16> etherType;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
bit<8> diffserv;
bit<16> totalLen;
bit<16> identification;
bit<3> flags;
bit<13> fragOffset;
... | 105 |
allp4files/p4-programs | /MatReduce-examples/c3/p4src/origin.p4 | #include <core.p4>
#include <v1model.p4>
struct meta_t {
bit<8> packet_category;
bit<32> nhop_ipv4;
bit<16> tcp_length;
}
header ethernet_t {
bit<48> dst_addr;
bit<48> src_addr;
bit<16> ether_type;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
bit<8> diffserv;
bit<16> tota... | 106 |
allp4files/p4-programs | /MatReduce-examples/c3/p4src/optimize.p4 | #include <core.p4>
#include <v1model.p4>
struct meta_t {
bit<8> packet_category;
bit<32> nhop_ipv4;
bit<16> tcp_length;
}
header ethernet_t {
bit<48> dst_addr;
bit<48> src_addr;
bit<16> ether_type;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
bit<8> diffserv;
bit<16> tota... | 107 |
allp4files/opencord | /p4se/generic/platf_p4netfpga/src/header_16.p4 | /*
* Copyright 2019-present Open Networking Foundation
*
* Contributed and sponsored by Deutsche Telekom AG.
* Originally developed as part of the D-Nets 6 P4 Service Edge project
* in collaboration with Technische Universitaet Darmstadt.
* Authors: Leonhard Nobach, Jeremias Blendin, Ralf Kundel
*
* Licensed under the ... | 109 |
allp4files/opencord | /p4se/fabric/p4src/constants.p4 | /*
* Copyright 2018-present Open Networking Foundation
*
* Contributed and sponsored by Deutsche Telekom AG.
* Originally developed as part of the D-Nets 6 P4 Service Edge project
* in collaboration with Technische Universitaet Darmstadt.
* Authors: Jeremias Blendin, Leonhard Nobach
*
* Licensed under the Apache Licens... | 113 |
allp4files/opencord | /p4se/generic/platf_p4netfpga/src/p4-BNG.p4 | /*
* Copyright 2019-present Open Networking Foundation
*
* Contributed and sponsored by Deutsche Telekom AG.
* Originally developed as part of the D-Nets 6 P4 Service Edge project
* in collaboration with Technische Universitaet Darmstadt.
* Authors: Leonhard Nobach, Jeremias Blendin, Ralf Kundel
*
* Licensed under the ... | 116 |
allp4files/andresgl-UNEX | /CCA-p4/checksum.p4 |
/*************************************************************************
************ C H E C K S U M V E R I F I C A T I O N *************
*************************************************************************/
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
apply { }
}
/****... | 118 |
allp4files/andresgl-UNEX | /CCA-p4/ingress.p4 | /*************************************************************************
************** I N G R E S S P R O C E S S I N G *******************
*************************************************************************/
control MyIngress(inout headers hdr,
inout metadata meta,
i... | 119 |
allp4files/andresgl-UNEX | /CCA-p4/parser.p4 | #include "headers.p4"
/*************************************************************************
*********************** P A R S E R ***********************************
*************************************************************************/
parser MyParser(packet_in packet,
out headers hdr,
... | 121 |
allp4files/andresgl-UNEX | /CCA-p4/headers.p4 | const bit<16> TYPE_IPV4 = 0x0800;
const bit<8> TYPE_TCP = 6;
const bit<8> TYPE_UDP = 17;
const bit<16> TYPE_CUSTOM = 2001;
const bit<8> TYPE_CUSTOM_I = 0xFF;
#define MAX_HOPS 8
#define PKT_TYPE_SEQ true
#define PKT_TYPE_ACK false
typedef bit<9> egressSpec_t;
typedef bit<48> macAddr_t;
typedef bit<32> ip4Addr_t;
typ... | 122 |
allp4files/andresgl-UNEX | /CCA-p4/deparser.p4 | /*************************************************************************
*********************** D E P A R S E R *******************************
*************************************************************************/
control MyDeparser(packet_out packet, in headers hdr) {
apply {
packet.emit(hdr.eth... | 123 |
allp4files/andresgl-UNEX | /CCA-p4/basic.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
#include "parser.p4"
#include "checksum.p4"
#include "ingress.p4"
#include "egress.p4"
#include "deparser.p4"
V1Switch(
MyParser(),
MyVerifyChecksum(),
MyIngress(),
MyEgress(),
MyComputeChecksum(),
MyDeparser()
) main;
| 124 |
allp4files/andresgl-UNEX | /CCA-p4/egress.p4 | /*************************************************************************
**************** E G R E S S P R O C E S S I N G *******************
*************************************************************************/
#define PKT_INSTANCE_TYPE_INGRESS_CLONE 1
control MyEgress(inout headers hdr,
... | 125 |
allp4files/hc-tec | /p4asm_p4code/instruction.p4 | /**********************************************************************************
*********************** I N S T R U C T I O N ************************************
**********************************************************************************/
action save_one_intruction(in bit<32> index, in bit<32> high_32, in... | 131 |
allp4files/hc-tec | /p4asm_p4code/headers.p4 |
/*************************************************************************
*********************** H E A D E R S ***********************************
*************************************************************************/
typedef bit<9> egressSpec_t;
typedef bit<48> macAddr_t;
typedef bit<32> ip4Addr_t;
header e... | 132 |
allp4files/ElhNoah | /INT/INT-MX/int_mx.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
#include "include/headers.p4"
#include "include/parsers.p4"
#include "include/checksum.p4"
#include "include/sink.p4"
#include "include/transit.p4"
#include "include/source.p4"
#include "include/forward.p4"
/*************************************************... | 135 |
allp4files/ElhNoah | /INT/INT-MX/include/checksum.p4 | control MyVerifyChecksum(inout headers hdr, inout local_metadata_t local_metadata) {
apply {
verify_checksum(
hdr.ipv4.isValid(),
{ hdr.ipv4.version,
hdr.ipv4.ihl,
hdr.ipv4.dscp,
hdr.ipv4.ecn,
hdr.ipv4.len,
hdr.ipv... | 137 |
allp4files/ElhNoah | /INT/INT-MX/include/source.p4 |
control process_int_source_sink (
inout headers hdr,
inout local_metadata_t local_metadata,
inout standard_metadata_t standard_metadata) {
action int_set_source () {
local_metadata.int_meta.source = true;
}
action int_set_sink () {
local_metadata.int_meta.sink = true;
}
... | 138 |
allp4files/ElhNoah | /INT/INT-MX/include/parsers.p4 | /**********************************************************
*********************** P A R S E R ***********************
**********************************************************/
parser MyIngressParser( packet_in packet,
out headers hdr,
inout local_metadata_t local_met... | 139 |
allp4files/ElhNoah | /INT/INT-MX/include/headers.p4 | /********************************************************************
*************** C O N S T A N T S A N D T Y P E S ***************
********************************************************************/
#define MAX_PORTS 511
#define CLONE_PKT 1
const bit<6> HW_ID = 1;
const bit<16> TYPE_IPV4 = 0x0800;
const bi... | 140 |
allp4files/ElhNoah | /INT/INT-MX/include/forward.p4 |
control l3_forward(inout headers hdr,
inout local_metadata_t local_metadata,
inout standard_metadata_t standard_metadata) {
action drop(){
mark_to_drop(standard_metadata);
}
action ipv4_forward(mac_t dstAddr, mac_t srcAddr, port_t port) {
stan... | 141 |
allp4files/ElhNoah | /INT/INT-MX/include/transit.p4 |
control process_int_transit (
inout headers hdr,
inout local_metadata_t local_metadata,
inout standard_metadata_t standard_metadata) {
action init_metadata(node_id_t node_id) {
local_metadata.int_meta.node_id = node_id;
}
action int_set_header_0() {
hdr.int_node_id.set... | 142 |
allp4files/WuJiansong | /test/test.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <tna.p4>
/*************************************************************************
*********************** H E A D E R S ***********************************
*************************************************************************/
typedef bit<48> macAddr_t;
typedef ... | 143 |
allp4files/ElhNoah | /INT/INT-MX/include/sink.p4 |
control process_int_sink (
inout headers hdr,
inout local_metadata_t local_metadata,
inout standard_metadata_t standard_metadata) {
action restore_header () {
hdr.ipv4.dscp = hdr.intl4_shim.original_dscp;
hdr.ipv4.len = hdr.ipv4.len - INT_TOTAL_HEADER_SIZE;
if(hdr.... | 145 |
allp4files/ElhNoah | /INT/INT-MD/include/source.p4 |
control process_int_source_sink (
inout headers hdr,
inout local_metadata_t local_metadata,
inout standard_metadata_t standard_metadata) {
action int_set_source () {
local_metadata.int_meta.source = true;
}
action int_set_sink () {
local_metadata.int_meta.sink = true;
}
... | 147 |
allp4files/ElhNoah | /INT/INT-MD/include/parsers.p4 | /**********************************************************
*********************** P A R S E R ***********************
**********************************************************/
parser MyParser( packet_in packet,
out headers hdr,
inout local_metadata_t local_metadata,
... | 148 |
allp4files/ElhNoah | /INT/INT-MD/include/sink.p4 | control process_int_sink (
inout headers hdr) {
action restore_header () {
hdr.ipv4.dscp = hdr.intl4_shim.original_dscp;
bit<16> len_bytes = (((bit<16>)hdr.intl4_shim.len) << 2) + INT_SHIM_HEADER_SIZE;
hdr.ipv4.len = hdr.ipv4.len - len_bytes;
if(hdr.udp.isValid()) {
... | 151 |
allp4files/hc-tec | /p4asm_p4code/main.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
#include "headers.p4"
#define MEMORY_UNIT_BIT 32
#define MEMORY_MAX_SIZE 2048
/** INSTRUCTION START **/
#define INSTRUCTION_BIT 64
#define INSTRUCTION_OP_BIT 8
#define INSTRUCTION_SRC1_MODE_BIT 4
#define INSTRUCTION_SRC1_BIT 24
#define INSTRUCTION_SRC2_MOD... | 153 |
allp4files/seanpm2001 | /Learn-P4/LICENSE.p4 | GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https:
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The ... | 154 |
allp4files/obventio56 | /acf_stateful_firewall/tna_random.p4 | /*******************************************************************************
* INTEL CONFIDENTIAL
*
* Copyright (c) 2021 Intel Corporation
* All Rights Reserved.
*
* This software and the related documents are Intel copyrighted materials,
* and your use of them is governed by the express license under w... | 170 |
allp4files/obventio56 | /acf_stateful_firewall/common/util.p4 | /*******************************************************************************
* INTEL CONFIDENTIAL
*
* Copyright (c) 2021 Intel Corporation
* All Rights Reserved.
*
* This software and the related documents are Intel copyrighted materials,
* and your use of them is governed by the express license under w... | 171 |
allp4files/obventio56 | /acf_stateful_firewall/common/headers.p4 | /*******************************************************************************
* INTEL CONFIDENTIAL
*
* Copyright (c) 2021 Intel Corporation
* All Rights Reserved.
*
* This software and the related documents are Intel copyrighted materials,
* and your use of them is governed by the express license under w... | 176 |
allp4files/nagmat1 | /arp_experiment/arp2.p4 | /* -*- P4_17 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<8> UDP_PROTOCOL = 0x11;
const bit<8> TCP_PROTOCOL = 0x06;
const bit<16> ETHERTYPE_ARP = 0x0806;
const bit<8> IPPROTO_ICMP = 0x01;
/*************************************************************************
*****... | 179 |
allp4files/nagmat1 | /p4_tutorials/pl_mri/mri.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<8> UDP_PROTOCOL = 0x11;
const bit<16> TYPE_IPV4 = 0x800;
const bit<5> IPV4_OPTION_MRI = 31;
#define MAX_HOPS 9
/*************************************************************************
*********************** H E A D E R S *******************... | 184 |
allp4files/nagmat1 | /hello_world_simple_prog_in_P4/simple_l3.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <tna.p4>
/*************************************************************************
************* C O N S T A N T S A N D T Y P E S *******************
*************************************************************************/
typedef bit<48> mac_addr_t;
typedef ... | 185 |
allp4files/nagmat1 | /p4_tutorials/pl_basic/basic.p4 | /* -*- P4_17 -*- */
#include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<8> UDP_PROTOCOL = 0x11;
const bit<8> TCP_PROTOCOL = 0x06;
/*************************************************************************
*********************** H E A D E R S ***********************************
******... | 204 |
allp4files/nagmat1 | /p4_tutorials/pl_basic/basic2.p4 | #include <core.p4>
#include <v1model.p4>
const bit<16> TYPE_IPV4 = 0x800;
const bit<8> UDP_PROTOCOL = 0x11;
const bit<8> TCP_PROTOCOL = 0x06;
const bit<16> ETHERTYPE_ARP = 0x0806;
const bit<8> IPPROTO_ICMP = 0x01;
const bit<16> ARP_HTYPE_ETHERNET = 0x0001;
const bit<16> ARP_PTYPE_IPV4 = 0x0800;
const bit<8> AR... | 206 |
allp4files/nagmat1 | /P4_counters/in_network_caching.p4 | /* -*- P4_16 -*- */
#include <core.p4>
#include <tna.p4>
/*************************************************************************
************* C O N S T A N T S A N D T Y P E S *******************
*************************************************************************/
/* Header Stuff */
enum bit<16> eth... | 221 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.