tools/testing/selftests/net/forwarding/mirror_topo_lib.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/forwarding/mirror_topo_lib.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/forwarding/mirror_topo_lib.sh- Extension
.sh- Size
- 2796 bytes
- Lines
- 103
- 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
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
# SPDX-License-Identifier: GPL-2.0
# This is the standard topology for testing mirroring. The tests that use it
# tweak it in one way or another--typically add more devices to the topology.
#
# +---------------------+ +---------------------+
# | H1 | | H2 |
# | + $h1 | | $h2 + |
# | | 192.0.2.1/28 | | 192.0.2.2/28 | |
# +-----|---------------+ +---------------|-----+
# | |
# +-----|-------------------------------------------------------------|-----+
# | SW o--> mirror | |
# | +---|-------------------------------------------------------------|---+ |
# | | + $swp1 BR $swp2 + | |
# | +---------------------------------------------------------------------+ |
# | |
# | + $swp3 |
# +-----|-------------------------------------------------------------------+
# |
# +-----|-------------------------------------------------------------------+
# | H3 + $h3 |
# | |
# +-------------------------------------------------------------------------+
mirror_topo_h1_create()
{
simple_if_init $h1 192.0.2.1/28
}
mirror_topo_h1_destroy()
{
simple_if_fini $h1 192.0.2.1/28
}
mirror_topo_h2_create()
{
simple_if_init $h2 192.0.2.2/28
}
mirror_topo_h2_destroy()
{
simple_if_fini $h2 192.0.2.2/28
}
mirror_topo_h3_create()
{
simple_if_init $h3
tc qdisc add dev $h3 clsact
}
mirror_topo_h3_destroy()
{
tc qdisc del dev $h3 clsact
simple_if_fini $h3
}
mirror_topo_switch_create()
{
ip link set dev $swp3 up
ip link add name br1 type bridge vlan_filtering 1
ip link set dev br1 addrgenmode none
ip link set dev br1 up
ip link set dev $swp1 master br1
ip link set dev $swp1 up
ip link set dev $swp2 master br1
ip link set dev $swp2 up
Annotation
- 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.