tools/testing/selftests/net/cmsg_so_priority.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/cmsg_so_priority.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/cmsg_so_priority.sh- Extension
.sh- Size
- 4022 bytes
- Lines
- 152
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function check_resultfunction create_filter
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
source lib.sh
readonly KSFT_SKIP=4
IP4=192.0.2.1/24
TGT4=192.0.2.2
TGT4_RAW=192.0.2.3
IP6=2001:db8::1/64
TGT6=2001:db8::2
TGT6_RAW=2001:db8::3
PORT=1234
TOTAL_TESTS=0
FAILED_TESTS=0
if ! command -v jq &> /dev/null; then
echo "SKIP cmsg_so_priroity.sh test: jq is not installed." >&2
exit "$KSFT_SKIP"
fi
check_result() {
((TOTAL_TESTS++))
if [ "$1" -ne 0 ]; then
((FAILED_TESTS++))
fi
}
cleanup()
{
cleanup_ns $NS
}
trap cleanup EXIT
setup_ns NS
create_filter() {
local handle=$1
local vlan_prio=$2
local ip_type=$3
local proto=$4
local dst_ip=$5
local ip_proto
if [[ "$proto" == "u" ]]; then
ip_proto="udp"
elif [[ "$ip_type" == "ipv4" && "$proto" == "i" ]]; then
ip_proto="icmp"
elif [[ "$ip_type" == "ipv6" && "$proto" == "i" ]]; then
ip_proto="icmpv6"
fi
tc -n $NS filter add dev dummy1 \
egress pref 1 handle "$handle" proto 802.1q \
flower vlan_prio "$vlan_prio" vlan_ethtype "$ip_type" \
dst_ip "$dst_ip" ${ip_proto:+ip_proto $ip_proto} \
action pass
}
ip -n $NS link set dev lo up
ip -n $NS link add name dummy1 up type dummy
ip -n $NS link add link dummy1 name dummy1.10 up type vlan id 10 \
egress-qos-map 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
ip -n $NS address add $IP4 dev dummy1.10
ip -n $NS address add $IP6 dev dummy1.10 nodad
Annotation
- Detected declarations: `function check_result`, `function create_filter`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.