Skip to content

Commit

Permalink
Update net-next as of v6.8
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Mar 14, 2024
1 parent 828b4e0 commit fe5f558
Show file tree
Hide file tree
Showing 43 changed files with 43,891 additions and 1 deletion.
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-License-Identifier: GPL-2.0

CC=gcc
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow
ifeq ("$(DEBUG)","1")
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
endif

include $(wildcard *.d)

GEN_SRCS=$(wildcard generated/*.c)
GENERATED=$(patsubst %.c,%.o,${GEN_SRCS})

all: ynl.a

generated:
$(MAKE) -C $@

ynl.a: ynl.o generated
@echo -e "\tAR $@"
@ar rcs $@ ynl.o $(GENERATED)

clean:
rm -f *.o *.d *~
$(MAKE) -C generated $@

distclean: clean
rm -f *.a

%.o: %.c
@echo -e "\tCC $@"
@$(COMPILE.c) -MMD -c -o $@ $<

.PHONY: all clean generated
.DEFAULT_GOAL=all
27 changes: 27 additions & 0 deletions Makefile.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-License-Identifier: GPL-2.0

# Try to include uAPI headers from the kernel uapi/ path.
# Most code under tools/ requires the respective kernel uAPI headers
# to be copied to tools/include. The duplication is annoying.
# All the family headers should be self-contained. We avoid the copying
# by selectively including just the uAPI header of the family directly
# from the kernel sources.

UAPI_PATH:=../uapi/

# scripts/headers_install.sh strips "_UAPI" from header guards so we
# need the explicit -D matching what's in /usr, to avoid multiple definitions.

get_hdr_inc=-D$(1) -include $(UAPI_PATH)/linux/$(2)

CFLAGS_devlink:=$(call get_hdr_inc,_LINUX_DEVLINK_H_,devlink.h)
CFLAGS_dpll:=$(call get_hdr_inc,_LINUX_DPLL_H,dpll.h)
CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h)
CFLAGS_handshake:=$(call get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h)
CFLAGS_mptcp_pm:=$(call get_hdr_inc,_LINUX_MPTCP_PM_H,mptcp_pm.h)
CFLAGS_netdev:=$(call get_hdr_inc,_LINUX_NETDEV_H,netdev.h)
CFLAGS_nfsd:=$(call get_hdr_inc,_LINUX_NFSD_NETLINK_H,nfsd_netlink.h)
CFLAGS_ovs_datapath:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
CFLAGS_ovs_flow:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
CFLAGS_ovs_vport:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
CFLAGS_psp:=$(call get_hdr_inc,_LINUX_PSP_H,psp.h)
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# ynl-c
Standalone copy of generated YNL C lib

Standalone copy of generated YNL C lib.

Development happens in the Linux kernel:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/tools/net/ynl/

This repo contains just the C parts, excluding all Python and
scripts, even the code generator which generated the code.

Basic intro:

https://docs.kernel.org/next/userspace-api/netlink/intro-specs.html#ynl-lib

Using the library
=================

Building the library generates an archive for static linking called ``ynl.a``.
26 changes: 26 additions & 0 deletions generated/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-License-Identifier: GPL-2.0

CC=gcc
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
-I../ -idirafter $(UAPI_PATH)
ifeq ("$(DEBUG)","1")
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
endif

include ../Makefile.deps

SRCS=$(wildcard *.c)
HDRS=$(wildcard *.h)
OBJS=$(patsubst %-user.c,%-user.o,${SRCS})

all: $(OBJS)

%-user.o: %-user.c %-user.h
@echo -e "\tCC $@"
@$(COMPILE.c) $(CFLAGS_$*) -o $@ $<

clean:
rm -f *.o

.PHONY: all clean
.DEFAULT_GOAL: all
Loading

0 comments on commit fe5f558

Please sign in to comment.