Skip to content

Commit

Permalink
Merge branch 'ospf'
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Nov 23, 2023
2 parents 8a1c927 + 4672c86 commit 7a16a3b
Show file tree
Hide file tree
Showing 62 changed files with 2,779 additions and 56 deletions.
8 changes: 8 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ router:
- make -C Homework/tftp/pc2
- make -C Homework/tftp/r2
- make -C Homework/dhcpv6/r1
- make -C Homework/ospf/r1
- make -C Homework/ospf/r2
- make -C Homework/ospf/r3
- make -C Homework/ospf/interconnect-r2
artifacts:
paths:
- Homework/router/r1/router
Expand All @@ -48,5 +52,9 @@ router:
- Homework/tftp/r2/client
- Homework/tftp/r2/server
- Homework/dhcpv6/r1/router
- Homework/ospf/r1/router
- Homework/ospf/r2/router
- Homework/ospf/r3/router
- Homework/ospf/interconnect-r2/router
when: always
expire_in: 1 year
16 changes: 8 additions & 8 deletions .gitlab-ci.yml.asc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEE4r5HYZJqvbepUleQ2QBvE9fbMRoFAmUvbu0ACgkQ2QBvE9fb
MRqYrQf/Zyrrn94H3igkejF08G680HFQksiGb1RrSRm3ujpGbuAGZOLf/h/BbPAf
pd5n4E9o31NYBDmIXWGrSLUVIeSXBHoM82U60ySSori0CkPDqe98U4Jd4PdDc0C7
XBCzSCmYtyz+98Vnv/X+JCDTGckQee12G6R/kF3112ZEMPyFi0Niv8Ac9gG9k0r0
hluHGWPWjp4bfE+v6lYSBCCQuaDzfQn/lcfdAmBHJJ8XZXvc+SMg6k9zIUrmYd/O
IdZjbZ9ADc8tOk0W23mBsfSweeQz3w03fwN7WluA30EOXIML2xS/hkHzzXc9PWrs
5hx8bwHMKMNbuAzRbzbXqUAHR0kn5A==
=sO3a
iQEzBAABCAAdFiEE4r5HYZJqvbepUleQ2QBvE9fbMRoFAmVOQNAACgkQ2QBvE9fb
MRr2cAf/e9FNyTB+1uWaQOpH7ZXrmowsPn+8xB7tc50Er6lAfQXpeppsMEzs25K3
FYGywC4jmIj1MqEo29S3+JhIrV3PMNO96HJU6z3I/79PO70iTrM9NURQarzZ4Ia0
cAi0YTRzx3KPksCeTC3Snzmrv++XRgJjyvQKiDz1RiaRQ0iwUZyrmgw6V3ue0pz1
O7vWP/KrFv9NnODYUOftGjLofAsm0zi1pXn5PQ9ZtjvYxeFADhWAQSdfLINPtpiw
lnA0cZLUkYC0OTO2MvofVa3bhPMU8x08b0ep6Y8IjpE09gIonPTDakon5Ok64WN0
r3InprBG8d1y/v/C15CG+45Ko0Cxgg==
=mIu+
-----END PGP SIGNATURE-----
5 changes: 5 additions & 0 deletions Homework/ospf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.o
router
std
std.cpp
!Makefile
Empty file added Homework/ospf/HONOR-CODE.md
Empty file.
45 changes: 45 additions & 0 deletions Homework/ospf/common/Makefrag
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CXX ?= g++
LAB_ROOT ?= ../../..
BACKEND ?= LINUX

CXXFLAGS += --std=c++11 -I $(LAB_ROOT)/HAL/include -DROUTER_BACKEND_$(BACKEND) -Wno-psabi -static -O2 -I../../protocol-ospf -I../../lookup -I../../internet-checksum -I../../eui64
LDFLAGS += -lpcap
ifeq ($(CI),)
CXXFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
else
LDFLAGS += -static
endif

.PHONY: all clean
all: router

clean:
rm -f *.o router std

%.o: ../%.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@

common.o: $(LAB_ROOT)/HAL/src/common.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

hal.o: $(LAB_ROOT)/HAL/src/linux/router_hal.cpp $(LAB_ROOT)/HAL/src/linux/platform/standard.h
$(CXX) $(CXXFLAGS) -c $< -o $@

eui64.o: ../../eui64/eui64.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

checksum.o: ../../internet-checksum/checksum.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

lookup.o: ../../lookup/lookup.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

protocol_ospf.o: ../../protocol-ospf/protocol_ospf.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

ospf_lsa_csum.o: ../../protocol-ospf/ospf_lsa_csum.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

router: main.o hal.o eui64.o checksum.o lookup.o protocol_ospf.o ospf_lsa_csum.o common.o
$(CXX) $^ -o $@ $(LDFLAGS)
1 change: 1 addition & 0 deletions Homework/ospf/custom/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../common/Makefrag
2 changes: 2 additions & 0 deletions Homework/ospf/interconnect-r2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CXXFLAGS += -DROUTER_R2 -DROUTER_INTERCONNECT
include ../common/Makefrag
Loading

0 comments on commit 7a16a3b

Please sign in to comment.