Loading src/tests/tools/dhcp_tftp_infra/servers/data/dhcpd.conf +15 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # DHCP server configuration option default-url code 114 = text; option ztp_json_url code 225 = text; # locally defined option since the 209 didnt work Loading src/tests/tools/dhcp_tftp_infra/servers/docker-compose.yml +36 −20 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. version: '3.8' networks: wblabnet17231: name: wblabnet17231 driver: bridge ipam: config: - subnet: 172.31.0.0/24 gateway: 172.31.0.1 services: dhcp-server: image: networkboot/dhcpd Loading @@ -24,6 +48,17 @@ services: - wblabnet17231 restart: unless-stopped http-server: image: nginx:alpine container_name: http-server volumes: - ./http:/usr/share/nginx/html:ro networks: - wblabnet17231 restart: unless-stopped #ports: # - "443:443" whitebox: build: context: ./whitebox Loading @@ -37,23 +72,4 @@ services: depends_on: - dhcp-server - tftp-server http-server: image: nginx:alpine container_name: http-server volumes: - ./http:/usr/share/nginx/html:ro networks: - wblabnet17231 restart: unless-stopped #ports: # - "443:443" networks: wblabnet17231: name: wblabnet17231 driver: bridge ipam: config: - subnet: 172.31.0.0/24 gateway: 172.31.0.1 - http-server src/tests/tools/dhcp_tftp_infra/servers/tftp/Dockerfile +25 −4 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends tftpd-hpa \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /tftpboot RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install --no-install-recommends tftpd-hpa && \ apt-get --yes clean && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /tftpboot WORKDIR /tftpboot EXPOSE 69/udp # -L foreground, -v verbose, -a bind, -s secure root ENTRYPOINT ["/usr/sbin/in.tftpd", "-L", "-v", "-v", "-a", "0.0.0.0:69", "-s", "/tftpboot"] src/tests/tools/dhcp_tftp_infra/servers/whitebox/Dockerfile +23 −4 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FROM python:3.11-slim RUN apt-get update && apt-get install -y --no-install-recommends \ iproute2 tcpdump libpcap-dev build-essential python3-dev \ && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir scapy==2.5.0 pcapy-ng tftpy RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install --no-install-recommends iproute2 tcpdump libpcap-dev build-essential python3-dev && \ apt-get --yes clean && \ rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir 'scapy==2.5.0' 'pcapy-ng' 'tftpy' WORKDIR /whitebox COPY whitebox.py /whitebox/whitebox.py ENTRYPOINT ["python", "/whitebox/whitebox.py"] src/tests/tools/dhcp_tftp_infra/servers/whitebox/whitebox.py +14 −0 Original line number Diff line number Diff line #!/usr/bin/env python3 # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os, random, time, subprocess, socket, pathlib from scapy.all import Ether, IP, UDP, BOOTP, DHCP, sendp, AsyncSniffer, conf, get_if_hwaddr import tftpy Loading Loading
src/tests/tools/dhcp_tftp_infra/servers/data/dhcpd.conf +15 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # DHCP server configuration option default-url code 114 = text; option ztp_json_url code 225 = text; # locally defined option since the 209 didnt work Loading
src/tests/tools/dhcp_tftp_infra/servers/docker-compose.yml +36 −20 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. version: '3.8' networks: wblabnet17231: name: wblabnet17231 driver: bridge ipam: config: - subnet: 172.31.0.0/24 gateway: 172.31.0.1 services: dhcp-server: image: networkboot/dhcpd Loading @@ -24,6 +48,17 @@ services: - wblabnet17231 restart: unless-stopped http-server: image: nginx:alpine container_name: http-server volumes: - ./http:/usr/share/nginx/html:ro networks: - wblabnet17231 restart: unless-stopped #ports: # - "443:443" whitebox: build: context: ./whitebox Loading @@ -37,23 +72,4 @@ services: depends_on: - dhcp-server - tftp-server http-server: image: nginx:alpine container_name: http-server volumes: - ./http:/usr/share/nginx/html:ro networks: - wblabnet17231 restart: unless-stopped #ports: # - "443:443" networks: wblabnet17231: name: wblabnet17231 driver: bridge ipam: config: - subnet: 172.31.0.0/24 gateway: 172.31.0.1 - http-server
src/tests/tools/dhcp_tftp_infra/servers/tftp/Dockerfile +25 −4 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends tftpd-hpa \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /tftpboot RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install --no-install-recommends tftpd-hpa && \ apt-get --yes clean && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /tftpboot WORKDIR /tftpboot EXPOSE 69/udp # -L foreground, -v verbose, -a bind, -s secure root ENTRYPOINT ["/usr/sbin/in.tftpd", "-L", "-v", "-v", "-a", "0.0.0.0:69", "-s", "/tftpboot"]
src/tests/tools/dhcp_tftp_infra/servers/whitebox/Dockerfile +23 −4 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FROM python:3.11-slim RUN apt-get update && apt-get install -y --no-install-recommends \ iproute2 tcpdump libpcap-dev build-essential python3-dev \ && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir scapy==2.5.0 pcapy-ng tftpy RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install --no-install-recommends iproute2 tcpdump libpcap-dev build-essential python3-dev && \ apt-get --yes clean && \ rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir 'scapy==2.5.0' 'pcapy-ng' 'tftpy' WORKDIR /whitebox COPY whitebox.py /whitebox/whitebox.py ENTRYPOINT ["python", "/whitebox/whitebox.py"]
src/tests/tools/dhcp_tftp_infra/servers/whitebox/whitebox.py +14 −0 Original line number Diff line number Diff line #!/usr/bin/env python3 # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os, random, time, subprocess, socket, pathlib from scapy.all import Ether, IP, UDP, BOOTP, DHCP, sendp, AsyncSniffer, conf, get_if_hwaddr import tftpy Loading