net/x25/x25_timer.c
Source file repositories/reference/linux-study-clean/net/x25/x25_timer.c
File Facts
- System
- Linux kernel
- Corpus path
net/x25/x25_timer.c- Extension
.c- Size
- 3689 bytes
- Lines
- 170
- 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/jiffies.hlinux/timer.hnet/sock.hnet/tcp_states.hnet/x25.h
Detected Declarations
function x25_init_timersfunction x25_start_heartbeatfunction x25_stop_heartbeatfunction x25_start_t2timerfunction x25_start_t21timerfunction x25_start_t22timerfunction x25_start_t23timerfunction x25_stop_timerfunction x25_display_timerfunction x25_heartbeat_expiryfunction x25_do_timer_expiryfunction x25_timer_expiry
Annotated Snippet
sock_flag(sk, SOCK_DEAD))) {
bh_unlock_sock(sk);
x25_destroy_socket_from_timer(sk);
return;
}
break;
case X25_STATE_3:
/*
* Check for the state of the receive buffer.
*/
x25_check_rbuf(sk);
break;
}
restart_heartbeat:
x25_start_heartbeat(sk);
bh_unlock_sock(sk);
}
/*
* Timer has expired, it may have been T2, T21, T22, or T23. We can tell
* by the state machine state.
*/
static inline void x25_do_timer_expiry(struct sock * sk)
{
struct x25_sock *x25 = x25_sk(sk);
switch (x25->state) {
case X25_STATE_3: /* T2 */
if (x25->condition & X25_COND_ACK_PENDING) {
x25->condition &= ~X25_COND_ACK_PENDING;
x25_enquiry_response(sk);
}
break;
case X25_STATE_1: /* T21 */
case X25_STATE_4: /* T22 */
x25_write_internal(sk, X25_CLEAR_REQUEST);
x25->state = X25_STATE_2;
x25_start_t23timer(sk);
break;
case X25_STATE_2: /* T23 */
x25_disconnect(sk, ETIMEDOUT, 0, 0);
break;
}
}
static void x25_timer_expiry(struct timer_list *t)
{
struct x25_sock *x25 = timer_container_of(x25, t, timer);
struct sock *sk = &x25->sk;
bh_lock_sock(sk);
if (sock_owned_by_user(sk)) { /* can currently only occur in state 3 */
if (x25_sk(sk)->state == X25_STATE_3)
x25_start_t2timer(sk);
} else
x25_do_timer_expiry(sk);
bh_unlock_sock(sk);
}
Annotation
- Immediate include surface: `linux/errno.h`, `linux/jiffies.h`, `linux/timer.h`, `net/sock.h`, `net/tcp_states.h`, `net/x25.h`.
- Detected declarations: `function x25_init_timers`, `function x25_start_heartbeat`, `function x25_stop_heartbeat`, `function x25_start_t2timer`, `function x25_start_t21timer`, `function x25_start_t22timer`, `function x25_start_t23timer`, `function x25_stop_timer`, `function x25_display_timer`, `function x25_heartbeat_expiry`.
- 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.