arch/um/drivers/vector_transports.c
Source file repositories/reference/linux-study-clean/arch/um/drivers/vector_transports.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/drivers/vector_transports.c- Extension
.c- Size
- 11911 bytes
- Lines
- 495
- Domain
- Architecture Layer
- Bucket
- arch/um
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/netdevice.hlinux/skbuff.hlinux/slab.hasm/byteorder.huapi/linux/ip.huapi/linux/virtio_net.hlinux/virtio_net.hlinux/virtio_byteorder.hlinux/netdev_features.hvector_user.hvector_kern.h
Detected Declarations
struct gre_minimal_headerstruct uml_gre_datastruct uml_l2tpv3_datafunction l2tpv3_form_headerfunction gre_form_headerfunction raw_form_headerfunction l2tpv3_verify_headerfunction gre_verify_headerfunction raw_verify_headerfunction get_uint_paramfunction get_ulong_paramfunction build_gre_transport_datafunction build_l2tpv3_transport_datafunction build_raw_transport_datafunction build_hybrid_transport_datafunction build_tap_transport_datafunction build_bess_transport_datafunction build_transport_data
Annotated Snippet
struct gre_minimal_header {
uint16_t header;
uint16_t arptype;
};
struct uml_gre_data {
uint32_t rx_key;
uint32_t tx_key;
uint32_t sequence;
bool ipv6;
bool has_sequence;
bool pin_sequence;
bool checksum;
bool key;
struct gre_minimal_header expected_header;
uint32_t checksum_offset;
uint32_t key_offset;
uint32_t sequence_offset;
};
struct uml_l2tpv3_data {
uint64_t rx_cookie;
uint64_t tx_cookie;
uint64_t rx_session;
uint64_t tx_session;
uint32_t counter;
bool udp;
bool ipv6;
bool has_counter;
bool pin_counter;
bool cookie;
bool cookie_is_64;
uint32_t cookie_offset;
uint32_t session_offset;
uint32_t counter_offset;
};
static int l2tpv3_form_header(uint8_t *header,
struct sk_buff *skb, struct vector_private *vp)
{
struct uml_l2tpv3_data *td = vp->transport_data;
uint32_t *counter;
if (td->udp)
*(uint32_t *) header = cpu_to_be32(L2TPV3_DATA_PACKET);
(*(uint32_t *) (header + td->session_offset)) = td->tx_session;
if (td->cookie) {
if (td->cookie_is_64)
(*(uint64_t *)(header + td->cookie_offset)) =
td->tx_cookie;
else
(*(uint32_t *)(header + td->cookie_offset)) =
td->tx_cookie;
}
if (td->has_counter) {
counter = (uint32_t *)(header + td->counter_offset);
if (td->pin_counter) {
*counter = 0;
} else {
td->counter++;
*counter = cpu_to_be32(td->counter);
}
}
return 0;
}
static int gre_form_header(uint8_t *header,
struct sk_buff *skb, struct vector_private *vp)
{
struct uml_gre_data *td = vp->transport_data;
uint32_t *sequence;
*((uint32_t *) header) = *((uint32_t *) &td->expected_header);
if (td->key)
(*(uint32_t *) (header + td->key_offset)) = td->tx_key;
if (td->has_sequence) {
sequence = (uint32_t *)(header + td->sequence_offset);
if (td->pin_sequence)
*sequence = 0;
else
*sequence = cpu_to_be32(++td->sequence);
}
return 0;
}
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/netdevice.h`, `linux/skbuff.h`, `linux/slab.h`, `asm/byteorder.h`, `uapi/linux/ip.h`, `uapi/linux/virtio_net.h`, `linux/virtio_net.h`.
- Detected declarations: `struct gre_minimal_header`, `struct uml_gre_data`, `struct uml_l2tpv3_data`, `function l2tpv3_form_header`, `function gre_form_header`, `function raw_form_header`, `function l2tpv3_verify_header`, `function gre_verify_header`, `function raw_verify_header`, `function get_uint_param`.
- Atlas domain: Architecture Layer / arch/um.
- Implementation status: source implementation candidate.
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.