tools/testing/selftests/net/mptcp/pm_netlink.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/mptcp/pm_netlink.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/mptcp/pm_netlink.sh- Extension
.sh- Size
- 6825 bytes
- Lines
- 299
- 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 format_limits
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
. "$(dirname "${0}")/mptcp_lib.sh"
ret=0
usage() {
echo "Usage: $0 [ -i ] [ -h ]"
echo -e "\t-i: use 'ip mptcp' instead of 'pm_nl_ctl'"
echo -e "\t-h: help"
}
optstring=hi
while getopts "$optstring" option;do
case "$option" in
"h")
usage "$0"
exit ${KSFT_PASS}
;;
"i")
mptcp_lib_set_ip_mptcp
;;
"?")
usage "$0"
exit ${KSFT_FAIL}
;;
esac
done
ns1=""
err=$(mktemp)
# This function is used in the cleanup trap
#shellcheck disable=SC2317,SC2329
cleanup()
{
rm -f "${err}"
mptcp_lib_ns_exit "${ns1}"
}
mptcp_lib_check_mptcp
mptcp_lib_check_tools ip
trap cleanup EXIT
mptcp_lib_ns_init ns1
format_limits() {
local accept="${1}"
local subflows="${2}"
if mptcp_lib_is_ip_mptcp; then
# with a space at the end
printf "add_addr_accepted %d subflows %d \n" "${accept}" "${subflows}"
else
printf "accept %d\nsubflows %d\n" "${accept}" "${subflows}"
fi
}
get_limits() {
if mptcp_lib_is_ip_mptcp; then
ip -n "${ns1}" mptcp limits
else
ip netns exec "${ns1}" ./pm_nl_ctl limits
fi
}
get_limits_nb() {
if mptcp_lib_is_ip_mptcp; then
Annotation
- Detected declarations: `function format_limits`.
- 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.