include/net/sctp/command.h
Source file repositories/reference/linux-study-clean/include/net/sctp/command.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/sctp/command.h- Extension
.h- Size
- 8778 bytes
- Lines
- 237
- 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
net/sctp/constants.hnet/sctp/structs.h
Detected Declarations
struct sctp_cmdstruct sctp_cmd_seqenum sctp_verbfunction SCTP_FORCEfunction SCTP_NOFORCEfunction SCTP_NULLfunction sctp_init_cmd_seqfunction SCTP_ARG_CONSTRUCTOR
Annotated Snippet
struct sctp_cmd {
union sctp_arg obj;
enum sctp_verb verb;
};
struct sctp_cmd_seq {
struct sctp_cmd cmds[SCTP_MAX_NUM_COMMANDS];
struct sctp_cmd *last_used_slot;
struct sctp_cmd *next_cmd;
};
/* Initialize a block of memory as a command sequence.
* Return 0 if the initialization fails.
*/
static inline int sctp_init_cmd_seq(struct sctp_cmd_seq *seq)
{
/* cmds[] is filled backwards to simplify the overflow BUG() check */
seq->last_used_slot = seq->cmds + SCTP_MAX_NUM_COMMANDS;
seq->next_cmd = seq->last_used_slot;
return 1; /* We always succeed. */
}
/* Add a command to an struct sctp_cmd_seq.
*
* Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above
* to wrap data which goes in the obj argument.
*/
static inline void sctp_add_cmd_sf(struct sctp_cmd_seq *seq,
enum sctp_verb verb, union sctp_arg obj)
{
struct sctp_cmd *cmd = seq->last_used_slot - 1;
BUG_ON(cmd < seq->cmds);
cmd->verb = verb;
cmd->obj = obj;
seq->last_used_slot = cmd;
}
/* Return the next command structure in an sctp_cmd_seq.
* Return NULL at the end of the sequence.
*/
static inline struct sctp_cmd *sctp_next_cmd(struct sctp_cmd_seq *seq)
{
if (seq->next_cmd <= seq->last_used_slot)
return NULL;
return --seq->next_cmd;
}
#endif /* __net_sctp_command_h__ */
Annotation
- Immediate include surface: `net/sctp/constants.h`, `net/sctp/structs.h`.
- Detected declarations: `struct sctp_cmd`, `struct sctp_cmd_seq`, `enum sctp_verb`, `function SCTP_FORCE`, `function SCTP_NOFORCE`, `function SCTP_NULL`, `function sctp_init_cmd_seq`, `function SCTP_ARG_CONSTRUCTOR`.
- 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.