net/ceph/auth_none.c
Source file repositories/reference/linux-study-clean/net/ceph/auth_none.c
File Facts
- System
- Linux kernel
- Corpus path
net/ceph/auth_none.c- Extension
.c- Size
- 3195 bytes
- Lines
- 147
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ceph/ceph_debug.hlinux/err.hlinux/module.hlinux/random.hlinux/slab.hlinux/ceph/decode.hlinux/ceph/auth.hauth_none.h
Detected Declarations
function resetfunction destroyfunction is_authenticatedfunction should_authenticatefunction ceph_auth_none_build_authorizerfunction build_requestfunction handle_replyfunction ceph_auth_none_destroy_authorizerfunction ceph_auth_none_create_authorizerfunction ceph_auth_none_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/ceph/ceph_debug.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/ceph/decode.h>
#include <linux/ceph/auth.h>
#include "auth_none.h"
static void reset(struct ceph_auth_client *ac)
{
struct ceph_auth_none_info *xi = ac->private;
xi->starting = true;
}
static void destroy(struct ceph_auth_client *ac)
{
kfree(ac->private);
ac->private = NULL;
}
static int is_authenticated(struct ceph_auth_client *ac)
{
struct ceph_auth_none_info *xi = ac->private;
return !xi->starting;
}
static int should_authenticate(struct ceph_auth_client *ac)
{
struct ceph_auth_none_info *xi = ac->private;
return xi->starting;
}
static int ceph_auth_none_build_authorizer(struct ceph_auth_client *ac,
struct ceph_none_authorizer *au)
{
void *p = au->buf;
void *const end = p + sizeof(au->buf);
int ret;
ceph_encode_8_safe(&p, end, 1, e_range);
ret = ceph_auth_entity_name_encode(ac->name, &p, end);
if (ret < 0)
return ret;
ceph_encode_64_safe(&p, end, ac->global_id, e_range);
au->buf_len = p - (void *)au->buf;
dout("%s built authorizer len %d\n", __func__, au->buf_len);
return 0;
e_range:
return -ERANGE;
}
static int build_request(struct ceph_auth_client *ac, void *buf, void *end)
{
return 0;
}
/*
* the generic auth code decode the global_id, and we carry no actual
* authenticate state, so nothing happens here.
*/
static int handle_reply(struct ceph_auth_client *ac, u64 global_id,
void *buf, void *end, u8 *session_key,
int *session_key_len, u8 *con_secret,
int *con_secret_len)
{
struct ceph_auth_none_info *xi = ac->private;
xi->starting = false;
ceph_auth_set_global_id(ac, global_id);
return 0;
}
static void ceph_auth_none_destroy_authorizer(struct ceph_authorizer *a)
{
kfree(a);
}
/*
* build an 'authorizer' with our entity_name and global_id. it is
Annotation
- Immediate include surface: `linux/ceph/ceph_debug.h`, `linux/err.h`, `linux/module.h`, `linux/random.h`, `linux/slab.h`, `linux/ceph/decode.h`, `linux/ceph/auth.h`, `auth_none.h`.
- Detected declarations: `function reset`, `function destroy`, `function is_authenticated`, `function should_authenticate`, `function ceph_auth_none_build_authorizer`, `function build_request`, `function handle_reply`, `function ceph_auth_none_destroy_authorizer`, `function ceph_auth_none_create_authorizer`, `function ceph_auth_none_init`.
- 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.