mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 02:17:58 +00:00 
			
		
		
		
	ucentral: development update
* add support for xBPF driven data planes Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
		
							
								
								
									
										34
									
								
								feeds/ucentral/ucentral-dataplane/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								feeds/ucentral/ucentral-dataplane/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | |||||||
|  | include $(TOPDIR)/rules.mk | ||||||
|  |  | ||||||
|  | PKG_NAME:=ucentral-dataplane | ||||||
|  | PKG_RELEASE:=1 | ||||||
|  |  | ||||||
|  | PKG_MAINTAINER:=John Crispin <john@phrozen.org> | ||||||
|  |  | ||||||
|  | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
|  | define Package/ucentral-dataplane | ||||||
|  |   SECTION:=ucentral | ||||||
|  |   CATEGORY:=uCentral | ||||||
|  |   TITLE:=uCentral xBPF loader | ||||||
|  |   DEPENDS:=+tc-full +kmod-ifb @!TARGET_ipq807x | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define Package/ucentral-dataplane/description | ||||||
|  | 	Allow loading cBPF and eBPF programs | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define Build/Prepare | ||||||
|  | 	mkdir -p $(PKG_BUILD_DIR) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define Build/Compile/Default | ||||||
|  |  | ||||||
|  | endef | ||||||
|  | Build/Compile = $(Build/Compile/Default) | ||||||
|  |  | ||||||
|  | define Package/ucentral-dataplane/install | ||||||
|  | 	$(CP) ./files/* $(1) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call BuildPackage,ucentral-dataplane)) | ||||||
| @@ -0,0 +1,6 @@ | |||||||
|  | #config program 'example' | ||||||
|  | #	option type 'ingress' | ||||||
|  | #	option program '/tmp/ucentral/~1services~1data_plane/ingress_0' | ||||||
|  |  | ||||||
|  | #config interface 'up0v0' | ||||||
|  | #	list program 'example' | ||||||
| @@ -0,0 +1,10 @@ | |||||||
|  | [ "$ACTION" == 'ifup' ] || exit 0 | ||||||
|  | dev=$(ubus call network.interface.$INTERFACE status | jsonfilter -e '@.l3_device') | ||||||
|  | program=$(uci get dataplane.$INTERFACE.program) | ||||||
|  | tc qdisc del dev $dev handle ffff: ingress | ||||||
|  | tc qdisc add dev $dev handle ffff: ingress | ||||||
|  | for p in $program; do                      | ||||||
|  |         path=$(uci get dataplane.$p.program) | ||||||
|  |         [ -f "$path" ] || continue           | ||||||
|  |         tc filter add dev $dev parent ffff: bpf obj $path verbose direct-action | ||||||
|  | done  | ||||||
							
								
								
									
										19
									
								
								feeds/ucentral/ucentral-dataplane/files/etc/init.d/dataplane
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										19
									
								
								feeds/ucentral/ucentral-dataplane/files/etc/init.d/dataplane
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | #!/bin/sh /etc/rc.common | ||||||
|  |  | ||||||
|  | START=19 | ||||||
|  | USE_PROCD=1 | ||||||
|  | PROG=/usr/libexec/dataplane.sh | ||||||
|  |  | ||||||
|  | reload_service() { | ||||||
|  | 	restart | ||||||
|  | } | ||||||
|  |  | ||||||
|  | service_triggers() { | ||||||
|  | 	procd_add_reload_trigger dataplane | ||||||
|  | } | ||||||
|  |  | ||||||
|  | start_service() { | ||||||
|  | 	procd_open_instance | ||||||
|  | 	procd_set_param command "$PROG" | ||||||
|  | 	procd_close_instance | ||||||
|  | } | ||||||
							
								
								
									
										11
									
								
								feeds/ucentral/ucentral-dataplane/files/usr/libexec/dataplane.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								feeds/ucentral/ucentral-dataplane/files/usr/libexec/dataplane.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
|  | . /lib/functions.sh | ||||||
|  |  | ||||||
|  | load() { | ||||||
|  | 	INTERFACE=$1 ACTION=ifup . /etc/hotplug.d/iface/80-dataplane | ||||||
|  | } | ||||||
|  |  | ||||||
|  | config_load dataplane | ||||||
|  | config_foreach load interface | ||||||
|  |  | ||||||
| @@ -6,7 +6,7 @@ PKG_RELEASE:=1 | |||||||
| PKG_SOURCE_URL=https://github.com/blogic/ucentral-schema.git | PKG_SOURCE_URL=https://github.com/blogic/ucentral-schema.git | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_DATE:=2021-02-15 | PKG_SOURCE_DATE:=2021-02-15 | ||||||
| PKG_SOURCE_VERSION:=1022c4a364298bfadfc0a1bfaeaa16b3a4792efb | PKG_SOURCE_VERSION:=15ffad87068ce3ef304d6b4cb2f9d6acf5775139 | ||||||
|  |  | ||||||
| PKG_MAINTAINER:=John Crispin <john@phrozen.org> | PKG_MAINTAINER:=John Crispin <john@phrozen.org> | ||||||
| PKG_LICENSE:=BSD-3-Clause | PKG_LICENSE:=BSD-3-Clause | ||||||
|   | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -30,11 +30,11 @@ packages: | |||||||
|   - ratelimit |   - ratelimit | ||||||
|   - rtty-openssl |   - rtty-openssl | ||||||
|   - sqm-scripts |   - sqm-scripts | ||||||
|   - tc-full |  | ||||||
|   - tcpdump |   - tcpdump | ||||||
|   - tip-defaults |   - tip-defaults | ||||||
|   - tmate |   - tmate | ||||||
|   - ucentral-client |   - ucentral-client | ||||||
|  |   - ucentral-dataplane | ||||||
|   - ucentral-event |   - ucentral-event | ||||||
|   - ucentral-schema |   - ucentral-schema | ||||||
|   - ucentral-wifi |   - ucentral-wifi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 John Crispin
					John Crispin