net/ipv6/fib6_notifier.c
Source file repositories/reference/linux-study-clean/net/ipv6/fib6_notifier.c
File Facts
- System
- Linux kernel
- Corpus path
net/ipv6/fib6_notifier.c- Extension
.c- Size
- 1536 bytes
- Lines
- 66
- 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/notifier.hlinux/socket.hlinux/kernel.hlinux/export.hnet/net_namespace.hnet/fib_notifier.hnet/netns/ipv6.hnet/ip6_fib.h
Detected Declarations
function call_fib6_notifierfunction call_fib6_notifiersfunction fib6_seq_readfunction fib6_dumpfunction fib6_notifier_initfunction fib6_notifier_exit
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/notifier.h>
#include <linux/socket.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <net/net_namespace.h>
#include <net/fib_notifier.h>
#include <net/netns/ipv6.h>
#include <net/ip6_fib.h>
int call_fib6_notifier(struct notifier_block *nb,
enum fib_event_type event_type,
struct fib_notifier_info *info)
{
info->family = AF_INET6;
return call_fib_notifier(nb, event_type, info);
}
int call_fib6_notifiers(struct net *net, enum fib_event_type event_type,
struct fib_notifier_info *info)
{
info->family = AF_INET6;
return call_fib_notifiers(net, event_type, info);
}
static unsigned int fib6_seq_read(const struct net *net)
{
return fib6_tables_seq_read(net) + fib6_rules_seq_read(net);
}
static int fib6_dump(struct net *net, struct notifier_block *nb,
struct netlink_ext_ack *extack)
{
int err;
err = fib6_rules_dump(net, nb, extack);
if (err)
return err;
return fib6_tables_dump(net, nb, extack);
}
static const struct fib_notifier_ops fib6_notifier_ops_template = {
.family = AF_INET6,
.fib_seq_read = fib6_seq_read,
.fib_dump = fib6_dump,
.owner = THIS_MODULE,
};
int __net_init fib6_notifier_init(struct net *net)
{
struct fib_notifier_ops *ops;
ops = fib_notifier_ops_register(&fib6_notifier_ops_template, net);
if (IS_ERR(ops))
return PTR_ERR(ops);
net->ipv6.notifier_ops = ops;
return 0;
}
void __net_exit fib6_notifier_exit(struct net *net)
{
fib_notifier_ops_unregister(net->ipv6.notifier_ops);
}
Annotation
- Immediate include surface: `linux/notifier.h`, `linux/socket.h`, `linux/kernel.h`, `linux/export.h`, `net/net_namespace.h`, `net/fib_notifier.h`, `net/netns/ipv6.h`, `net/ip6_fib.h`.
- Detected declarations: `function call_fib6_notifier`, `function call_fib6_notifiers`, `function fib6_seq_read`, `function fib6_dump`, `function fib6_notifier_init`, `function fib6_notifier_exit`.
- 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.