GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
LIBCASPER(3) FreeBSD Library Functions Manual LIBCASPER(3)

CREATE_SERVICE
casper service declaration macro

Casper Library (libcasper, -lcasper)

#include <sys/nv.h>
#include <libcasper.h>
#include <libcasper_service.h>
typedef int service_limit_func_t(const nvlist_t *, const nvlist_t *); 
 
typedef int service_command_func_t(const char *, const nvlist_t *, nvlist_t *, 
    nvlist_t *); 


CREATE_SERVICE(name, limit_func, command_func, flags);

The CREATE_SERVICE macro to create a new Casper service. The name is a string containing the service name, which will be used in the cap_service_open(3,) function to identify it.
The limit_func is a function of type service_limit_func_t. The first argument of the function contains nvlist(9), old service limits and second one the new limits. If the services wasn't limited the old limits will be set to NULL. This function should not allow to extend service limits and only limit it further. The command_func is a function of type service_command_func_t. First argument is the name of the command that should be executed. The first nvlist(9) contains the current limits. Next one contains a nvlist(9) with current request. The last one contains an output nvlist(9) which contains the response from Casper.
The flags argument defines limits of the service. The supported flags are:
CASPER_SERVICE_STDIO
The Casper service has access to the stdio descriptors from the process it was spawned from.
CASPER_SERVICE_FD
The Casper service has access to all descriptors besides stdio descriptors from the process it was spawned from.
CASPER_SERVICE_NO_UNIQ_LIMITS
The whole Casper communication is using nvlist(9) with NVLIST_NO_UNIQ(9) flag.

cap_enter(2), libcasper(3), capsicum(4), nv(9)

The libcasper library was implemented by Pawel Jakub Dawidek <pawel@dawidek.net> under sponsorship from the FreeBSD Foundation. The libcasper new architecture was implemented by
Mariusz Zaborski <oshogbo@FreeBSD.org>
June 23, 2018 FreeBSD 12.0-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.