net/lapb/lapb_in.c
Source file repositories/reference/linux-study-clean/net/lapb/lapb_in.c
File Facts
- System
- Linux kernel
- Corpus path
net/lapb/lapb_in.c- Extension
.c- Size
- 15015 bytes
- Lines
- 557
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/types.hlinux/socket.hlinux/in.hlinux/kernel.hlinux/timer.hlinux/string.hlinux/sockios.hlinux/net.hlinux/inet.hlinux/netdevice.hlinux/skbuff.hlinux/slab.hnet/sock.hlinux/uaccess.hlinux/fcntl.hlinux/mm.hlinux/interrupt.hnet/lapb.h
Detected Declarations
function timerfunction timerfunction timerfunction timerfunction timerfunction lapb_data_input
Annotated Snippet
if (lapb->mode & LAPB_EXTENDED) {
lapb_dbg(1, "(%p) S0 TX DM(%d)\n",
lapb->dev, frame->pf);
lapb_send_control(lapb, LAPB_DM, frame->pf,
LAPB_RESPONSE);
} else {
lapb_dbg(1, "(%p) S0 TX UA(%d)\n",
lapb->dev, frame->pf);
lapb_dbg(0, "(%p) S0 -> S3\n", lapb->dev);
lapb_send_control(lapb, LAPB_UA, frame->pf,
LAPB_RESPONSE);
lapb_stop_t1timer(lapb);
lapb_stop_t2timer(lapb);
lapb->state = LAPB_STATE_3;
lapb->condition = 0x00;
lapb->n2count = 0;
lapb->vs = 0;
lapb->vr = 0;
lapb->va = 0;
lapb_connect_indication(lapb, LAPB_OK);
}
break;
case LAPB_SABME:
lapb_dbg(1, "(%p) S0 RX SABME(%d)\n", lapb->dev, frame->pf);
if (lapb->mode & LAPB_EXTENDED) {
lapb_dbg(1, "(%p) S0 TX UA(%d)\n",
lapb->dev, frame->pf);
lapb_dbg(0, "(%p) S0 -> S3\n", lapb->dev);
lapb_send_control(lapb, LAPB_UA, frame->pf,
LAPB_RESPONSE);
lapb_stop_t1timer(lapb);
lapb_stop_t2timer(lapb);
lapb->state = LAPB_STATE_3;
lapb->condition = 0x00;
lapb->n2count = 0;
lapb->vs = 0;
lapb->vr = 0;
lapb->va = 0;
lapb_connect_indication(lapb, LAPB_OK);
} else {
lapb_dbg(1, "(%p) S0 TX DM(%d)\n",
lapb->dev, frame->pf);
lapb_send_control(lapb, LAPB_DM, frame->pf,
LAPB_RESPONSE);
}
break;
case LAPB_DISC:
lapb_dbg(1, "(%p) S0 RX DISC(%d)\n", lapb->dev, frame->pf);
lapb_dbg(1, "(%p) S0 TX UA(%d)\n", lapb->dev, frame->pf);
lapb_send_control(lapb, LAPB_UA, frame->pf, LAPB_RESPONSE);
break;
default:
break;
}
kfree_skb(skb);
}
/*
* State machine for state 1, Awaiting Connection State.
* The handling of the timer(s) is in file lapb_timer.c.
*/
static void lapb_state1_machine(struct lapb_cb *lapb, struct sk_buff *skb,
struct lapb_frame *frame)
{
switch (frame->type) {
case LAPB_SABM:
lapb_dbg(1, "(%p) S1 RX SABM(%d)\n", lapb->dev, frame->pf);
if (lapb->mode & LAPB_EXTENDED) {
lapb_dbg(1, "(%p) S1 TX DM(%d)\n",
lapb->dev, frame->pf);
lapb_send_control(lapb, LAPB_DM, frame->pf,
LAPB_RESPONSE);
} else {
lapb_dbg(1, "(%p) S1 TX UA(%d)\n",
lapb->dev, frame->pf);
lapb_send_control(lapb, LAPB_UA, frame->pf,
LAPB_RESPONSE);
}
break;
case LAPB_SABME:
lapb_dbg(1, "(%p) S1 RX SABME(%d)\n", lapb->dev, frame->pf);
if (lapb->mode & LAPB_EXTENDED) {
lapb_dbg(1, "(%p) S1 TX UA(%d)\n",
lapb->dev, frame->pf);
lapb_send_control(lapb, LAPB_UA, frame->pf,
Annotation
- Immediate include surface: `linux/errno.h`, `linux/types.h`, `linux/socket.h`, `linux/in.h`, `linux/kernel.h`, `linux/timer.h`, `linux/string.h`, `linux/sockios.h`.
- Detected declarations: `function timer`, `function timer`, `function timer`, `function timer`, `function timer`, `function lapb_data_input`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.