Documentation/networking/l2tp.rst
Source file repositories/reference/linux-study-clean/Documentation/networking/l2tp.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/networking/l2tp.rst- Extension
.rst- Size
- 30249 bytes
- Lines
- 787
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
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
if (ret < 0 ) {
close(session_fd);
return -errno;
}
return session_fd;
L2TP control packets will still be available for read on `tunnel_fd`.
- Create PPP channel::
/* Input: the session PPPoX data socket `session_fd` which was created
* as described above.
*/
int ppp_chan_fd;
int chindx;
int ret;
ret = ioctl(session_fd, PPPIOCGCHAN, &chindx);
if (ret < 0)
return -errno;
ppp_chan_fd = open("/dev/ppp", O_RDWR);
if (ppp_chan_fd < 0)
return -errno;
ret = ioctl(ppp_chan_fd, PPPIOCATTCHAN, &chindx);
if (ret < 0) {
close(ppp_chan_fd);
return -errno;
}
return ppp_chan_fd;
LCP PPP frames will be available for read on `ppp_chan_fd`.
- Create PPP interface::
/* Input: the PPP channel `ppp_chan_fd` which was created as described
* above.
*/
int ifunit = -1;
int ppp_if_fd;
int ret;
ppp_if_fd = open("/dev/ppp", O_RDWR);
if (ppp_if_fd < 0)
return -errno;
ret = ioctl(ppp_if_fd, PPPIOCNEWUNIT, &ifunit);
if (ret < 0) {
close(ppp_if_fd);
return -errno;
}
ret = ioctl(ppp_chan_fd, PPPIOCCONNECT, &ifunit);
if (ret < 0) {
close(ppp_if_fd);
return -errno;
}
return ppp_if_fd;
IPCP/IPv6CP PPP frames will be available for read on `ppp_if_fd`.
The ppp<ifunit> interface can then be configured as usual with netlink's
RTM_NEWLINK, RTM_NEWADDR, RTM_NEWROUTE, or ioctl's SIOCSIFMTU, SIOCSIFADDR,
SIOCSIFDSTADDR, SIOCSIFNETMASK, SIOCSIFFLAGS, or with the `ip` command.
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- 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.