PatchworkOS
Loading...
Searching...
No Matches
net.c
Go to the documentation of this file.
1#include <kernel/net/net.h>
2
3#include <kernel/fs/dentry.h>
4#include <kernel/fs/mount.h>
5#include <kernel/fs/sysfs.h>
6#include <kernel/log/log.h>
7#include <kernel/log/panic.h>
9
10static mount_t* mount;
11
12void net_init(void)
13{
15 if (mount == NULL)
16 {
17 panic(NULL, "Failed to create /net filesystem");
18 }
19
21
22 LOG_INFO("networking initialized\n");
23}
24
26{
27 return REF(mount);
28}
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
Definition panic.c:362
#define LOG_INFO(format,...)
Definition log.h:87
void net_local_init(void)
Initialize the local networking subsystem.
Definition local.c:517
void net_init(void)
Initialize the networking subsystem.
Definition net.c:12
mount_t * net_get_mount(void)
Retrieve the mount for the networking subsystem.
Definition net.c:25
#define REF(ptr)
Increment reference count.
Definition ref.h:65
#define NULL
Pointer error value.
Definition NULL.h:23
static mount_t * mount
Definition net.c:10
Mount structure.
Definition mount.h:36
mount_t * sysfs_mount_new(const path_t *parent, const char *name, namespace_t *ns, const superblock_ops_t *superblockOps)
Mount a new instance of SysFS.
Definition sysfs.c:100