P4 环境配置

文章目录

    • Github 超时
    • 工具包
    • 依赖包
    • p4lang/p4c
    • google/protobuf
    • apache/thrift
    • bmv2
    • google/googletest

Github 超时

192.30.255.112 github.com git  
199.232.69.194 github.global.ssl.fastly.net 

工具包

sudo apt install git  automake cmake pkg-config python3 python3-pip

sudo apt install clang llvm g++ gcc  

sudo apt install bison flex 

sudo apt-get install doxygen graphviz texlive-full 

依赖包

sudo apt install libtool \
                 libfl-dev \
                 libgmp-dev \
                 libboost-dev 
                 libboost-iostreams-dev \
                 libboost-graph-dev \
                 libssl-dev \
                 libnanomsg-dev \
                 libpcap-dev \
                 libboost-thread-dev \
                 libboost-filesystem-dev \
                 libboost-program-options-dev \
                 libnanomsg5 \
                 libelf1 \
                 libelf-dev \
                 zlib1g \
                 zlib1g-dev

p4lang/p4c

P4 环境配置_第1张图片

git clone https://github.com/p4lang/p4c.git
pip3 install ipaddr scapy ply
cd p4c
git submodule update --init --recursive

cd p4c/control-plane 
rm -rf p4runtime && git clone https://github.com/p4lang/p4runtime.git

mkdir build
cd p4c/build
cmake ..
make -j2
sudo make install

google/protobuf

wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protobuf-cpp-3.20.1.tar.gz
cd protobuf-3.20.1
./autogen.sh
./configure
make -j2
sudo make install
sudo ldconfig
protoc --version

apache/thrift

wget https://github.com/apache/thrift/archive/refs/tags/v0.16.0.tar.gz
tar -zxf v0.16.0.tar.gz 
./bootstrap.sh 
make
sudo make install

## libbpf/libbpf
git clone https://github.com/libbpf/libbpf.git
cd libbpf/src

bmv2

git clone https://github.com/p4lang/behavioral-model.git 
./autogen.sh
make
sudo make install

google/googletest

git clone https://github.com/google/googletest
cd googletest
mkdir build
cd build
cmake ..
make

你可能感兴趣的:(p4,网络)