NDN-DPDK
High-Speed Named Data Networking Forwarder
Loading...
Searching...
No Matches
fd.h File Reference
#include "../ndni/data.h"
#include "../ndni/tlv-encoder.h"
#include "../vendor/uthash-handle.h"
#include "enum.h"
#include <fcntl.h>
#include <linux/stat.h>
#include <sys/stat.h>

Go to the source code of this file.

Data Structures

struct  FileServerFd
 File descriptor related information in the file server. More...

Macros

#define FileServerFd_StatTime(t)
 Convert timestamp to uint64_t nanoseconds.

Typedefs

typedef struct FileServerFd FileServerFd
 File descriptor related information in the file server.
typedef struct FileServer FileServer

Functions

FileServerFdFileServerFd_Open (FileServer *p, const PName *name, TscTime now)
 Open file descriptor or increment reference count.
void FileServerFd_Unref (FileServer *p, FileServerFd *entry)
 Decrement file descriptor reference count.
void FileServerFd_Clear (FileServer *p)
 Close all file descriptors.
uint32_t FileServerFd_PrepareMetadata_ (FileServer *p, FileServerFd *entry)
void FileServerFd_WriteMetadata (FileServerFd *entry, struct iovec *iov, int iovcnt)
 Write metadata packet.
bool FileServerFd_GenerateLs (FileServer *p, FileServerFd *entry)
 Populate directory listing.

Variables

FileServerFdFileServer_NotFound
 Sentinel value to indicate file not found.

Macro Definition Documentation

◆ FileServerFd_StatTime

#define FileServerFd_StatTime ( t)
Value:
((uint64_t)(t).tv_sec * SPDK_SEC_TO_NSEC + (uint64_t)(t).tv_nsec)

Convert timestamp to uint64_t nanoseconds.

Parameters
tstruct statx_timestamp or struct timespec.

Typedef Documentation

◆ FileServer

typedef struct FileServer FileServer

◆ FileServerFd

typedef struct FileServerFd FileServerFd

File descriptor related information in the file server.

Function Documentation

◆ FileServerFd_Clear()

void FileServerFd_Clear ( FileServer * p)

Close all file descriptors.

◆ FileServerFd_GenerateLs()

bool FileServerFd_GenerateLs ( FileServer * p,
FileServerFd * entry )

Populate directory listing.

Parameters
entrya valid FileServerFd entry representing a directory.
Postcondition
entry->lsV[:entry->lsL] contains 32=ls payload.
entry->lastSeg and entry->meta FinalBlock reflects entry->lsL size.

◆ FileServerFd_Open()

FileServerFd * FileServerFd_Open ( FileServer * p,
const PName * name,
TscTime now )

Open file descriptor or increment reference count.

Parameters
nameInterest name.
Return values
NULLfilename is invalid or does not match a mount.
FileServer_NotFoundfile does not exist; do not Unref this value.

◆ FileServerFd_PrepareMetadata_()

uint32_t FileServerFd_PrepareMetadata_ ( FileServer * p,
FileServerFd * entry )

◆ FileServerFd_Unref()

void FileServerFd_Unref ( FileServer * p,
FileServerFd * entry )

Decrement file descriptor reference count.

◆ FileServerFd_WriteMetadata()

void FileServerFd_WriteMetadata ( FileServerFd * entry,
struct iovec * iov,
int iovcnt )

Write metadata packet.

Parameters
entrya valid FileServerFd entry.
iovContent iov, must match the length from FileServerFd_PrepareMetadata .

Variable Documentation

◆ FileServer_NotFound

FileServerFd* FileServer_NotFound
extern

Sentinel value to indicate file not found.