本文整理汇总了C++中pmap_unset函数的典型用法代码示例。如果您正苦于以下问题:C++ pmap_unset函数的具体用法?C++ pmap_unset怎么用?C++ pmap_unset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmap_unset函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argn, char *argc[])
{
//Program parameters : argc[1] : HostName or Host IP
// argc[2] : Server Program Number
// other arguments depend on test case
//run_mode can switch into stand alone program or program launch by shell script
//1 : stand alone, debug mode, more screen information
//0 : launch by shell script as test case, only one printf -> result status
int run_mode = 0;
int test_status = 1; //Default test result set to FAILED
int progNum = 5000000; //This test doesn't care with progNum, just local test of reg/unreg...
int port = 600;
SVCXPRT *transp = NULL;
//Initialization
pmap_unset(progNum, VERSNUM);
if (run_mode)
{
printf("Before creation\n");
}
transp = svcudp_create(RPC_ANYSOCK);
pmap_set(progNum, VERSNUM, IPPROTO_UDP, port);
test_status = !pmap_unset(progNum, VERSNUM);
//This last printf gives the result status to the tests suite
//normally should be 0: test has passed or 1: test has failed
printf("%d\n", test_status);
return test_status;
}
开发者ID:shubmit,项目名称:shub-ltp,代码行数:34,代码来源:1-basic.c
示例2: main
int
main(int argc, char *argv[])
{
SVCXPRT *transp;
int sock = 0;
int proto = 0;
struct sockaddr_in from;
int fromlen;
if (argc == 2)
closedown = atoi(argv[1]);
if (closedown <= 0)
closedown = 20;
/*
* See if inetd started us
*/
fromlen = sizeof(from);
if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) {
from_inetd = 0;
sock = RPC_ANYSOCK;
proto = IPPROTO_UDP;
}
if (!from_inetd) {
daemon(0, 0);
(void)pmap_unset(RSTATPROG, RSTATVERS_TIME);
(void)pmap_unset(RSTATPROG, RSTATVERS_SWTCH);
(void)pmap_unset(RSTATPROG, RSTATVERS_ORIG);
(void) signal(SIGINT, cleanup);
(void) signal(SIGTERM, cleanup);
(void) signal(SIGHUP, cleanup);
}
openlog("rpc.rstatd", LOG_CONS|LOG_PID, LOG_DAEMON);
transp = svcudp_create(sock);
if (transp == NULL) {
syslog(LOG_ERR, "cannot create udp service");
exit(1);
}
if (!svc_register(transp, RSTATPROG, RSTATVERS_TIME, rstat_service, proto)) {
syslog(LOG_ERR, "unable to register (RSTATPROG, RSTATVERS_TIME, %s)", proto?"udp":"(inetd)");
exit(1);
}
if (!svc_register(transp, RSTATPROG, RSTATVERS_SWTCH, rstat_service, proto)) {
syslog(LOG_ERR, "unable to register (RSTATPROG, RSTATVERS_SWTCH, %s)", proto?"udp":"(inetd)");
exit(1);
}
if (!svc_register(transp, RSTATPROG, RSTATVERS_ORIG, rstat_service, proto)) {
syslog(LOG_ERR, "unable to register (RSTATPROG, RSTATVERS_ORIG, %s)", proto?"udp":"(inetd)");
exit(1);
}
svc_run();
syslog(LOG_ERR, "svc_run returned");
exit(1);
}
开发者ID:mihaicarabas,项目名称:dragonfly,代码行数:60,代码来源:rstatd.c
示例3: cleanup
void
cleanup(int sig)
{
(void) pmap_unset(RSTATPROG, RSTATVERS_TIME);
(void) pmap_unset(RSTATPROG, RSTATVERS_SWTCH);
(void) pmap_unset(RSTATPROG, RSTATVERS_ORIG);
exit(0);
}
开发者ID:mihaicarabas,项目名称:dragonfly,代码行数:8,代码来源:rstatd.c
示例4: unregister_services
static void
unregister_services (void)
{
if (nfs_version & (0x1 << 1)) {
pmap_unset (MOUNTPROG, MOUNTVERS);
pmap_unset (MOUNTPROG, MOUNTVERS_POSIX);
}
if (nfs_version & (0x1 << 2))
pmap_unset (MOUNTPROG, MOUNTVERS_NFSV3);
}
开发者ID:gygy,项目名称:asuswrt,代码行数:10,代码来源:mountd.c
示例5: daemon_simulator
static void
daemon_simulator (void)
{
signal (SIGHUP, sim_killer);
signal (SIGINT, sim_killer);
signal (SIGTERM, sim_killer);
pmap_unset (sim_port, SIM_SM_VERS);
/* this registers both UDP and TCP services */
rpc_init("statd", sim_port, SIM_SM_VERS, sim_sm_prog_1, 0);
svc_run ();
pmap_unset (sim_port, SIM_SM_VERS);
}
开发者ID:ANFS,项目名称:ANFS-utils,代码行数:12,代码来源:simulate.c
示例6: main
int
main (int argc, char **argv)
{
register SVCXPRT *transp;
pmap_unset (DEVICE_ASYNC, DEVICE_ASYNC_VERSION);
pmap_unset (DEVICE_CORE, DEVICE_CORE_VERSION);
pmap_unset (DEVICE_INTR, DEVICE_INTR_VERSION);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, DEVICE_ASYNC, DEVICE_ASYNC_VERSION, device_async_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (DEVICE_ASYNC, DEVICE_ASYNC_VERSION, udp).");
exit(1);
}
if (!svc_register(transp, DEVICE_CORE, DEVICE_CORE_VERSION, device_core_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (DEVICE_CORE, DEVICE_CORE_VERSION, udp).");
exit(1);
}
if (!svc_register(transp, DEVICE_INTR, DEVICE_INTR_VERSION, device_intr_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (DEVICE_INTR, DEVICE_INTR_VERSION, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, DEVICE_ASYNC, DEVICE_ASYNC_VERSION, device_async_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (DEVICE_ASYNC, DEVICE_ASYNC_VERSION, tcp).");
exit(1);
}
if (!svc_register(transp, DEVICE_CORE, DEVICE_CORE_VERSION, device_core_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (DEVICE_CORE, DEVICE_CORE_VERSION, tcp).");
exit(1);
}
if (!svc_register(transp, DEVICE_INTR, DEVICE_INTR_VERSION, device_intr_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (DEVICE_INTR, DEVICE_INTR_VERSION, tcp).");
exit(1);
}
svc_run ();
fprintf (stderr, "%s", "svc_run returned");
exit (1);
/* NOTREACHED */
}
开发者ID:zsjinwei,项目名称:vxi11,代码行数:50,代码来源:vxi11_svc.c
示例7: leave
void
leave (int type, int wait)
{
struct task *task;
switch (type)
{
case MASTER:
pmap_unset (LOSH, MASTER);
break;
case SLAVE:
switch (wait)
{
case TRUE:
stopslave_call ();
while (slave -> task_number ||
slave -> imported_task_number);
break;
case FALSE:
deletetask_broadcast (slave);
task = NULL;
while (TRUE)
{
/* Foreach imported task: */
task = (struct task *) list_next (&slave -> imported_tasks,
(task == NULL));
if (task == NULL)
break;
/* Kill it: */
if (task -> pid != -1)
{
kill (task -> pid, SIGKILL);
#ifdef DEBUG
printf ("SLAV (info) killed task %d\n", (int) task -> pid);
#endif
}
}
break;
}
removeslave_call ();
pmap_unset (LOSH, SLAVE);
break;
}
}
开发者ID:LiberH,项目名称:master,代码行数:49,代码来源:information.c
示例8: main
int
main(int argc, char **argv)
{
register SVCXPRT *transp;
signal(SIGCHLD, sigchld);
(void) pmap_unset(SCSI_PROG, SCSI_VERS);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf(stderr, "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, SCSI_PROG, SCSI_VERS, scsi_prog_1, IPPROTO_UDP)) {
fprintf(stderr, "unable to register (SCSI_PROG, SCSI_VERS, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf(stderr, "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, SCSI_PROG, SCSI_VERS, scsi_prog_1, IPPROTO_TCP)) {
fprintf(stderr, "unable to register (SCSI_PROG, SCSI_VERS, tcp).");
exit(1);
}
svc_run();
fprintf(stderr, "svc_run returned");
exit(1);
/* NOTREACHED */
}
开发者ID:LFenske,项目名称:LFscsi,代码行数:34,代码来源:scsi_svc.c
示例9: main
int
main (int argc, char **argv)
{
register SVCXPRT *transp;
pmap_unset (DISPLAY_PRG, DISPLAY_VER);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, DISPLAY_PRG, DISPLAY_VER, display_prg_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (DISPLAY_PRG, DISPLAY_VER, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, DISPLAY_PRG, DISPLAY_VER, display_prg_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (DISPLAY_PRG, DISPLAY_VER, tcp).");
exit(1);
}
svc_run ();
fprintf (stderr, "%s", "svc_run returned");
exit (1);
/* NOTREACHED */
}
开发者ID:cwru-eecs338,项目名称:RPC_sample_code,代码行数:32,代码来源:hello_svc.c
示例10: rpc2_server
void *
rpc2_server()
{
register SVCXPRT *transp;
pmap_unset (RPC2_RPC_PROG, RPC2_RPC_VERS1);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, RPC2_RPC_PROG, RPC2_RPC_VERS1, rpc2_rpc_prog_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (RPC2_RPC_PROG, RPC2_RPC_VERS1, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, RPC2_RPC_PROG, RPC2_RPC_VERS1, rpc2_rpc_prog_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (RPC2_RPC_PROG, RPC2_RPC_VERS1, tcp).");
exit(1);
}
svc_run ();
fprintf (stderr, "%s", "svc_run returned");
exit (1);
/* NOTREACHED */
}
开发者ID:wolf623,项目名称:c_code,代码行数:32,代码来源:rpc2_svc.c
示例11: register_server
void register_server(int client_id)
{
register SVCXPRT *transp;
pmap_unset (CALLBACK_SEMAPHORE, V1 + client_id);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, CALLBACK_SEMAPHORE, V1 + client_id, callback_semaphore_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (CALLBACK_SEMAPHORE, V1, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, CALLBACK_SEMAPHORE, V1 + client_id, callback_semaphore_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (CALLBACK_SEMAPHORE, V1, tcp).");
exit(1);
}
//svc_run ();
//fprintf (stderr, "%s", "svc_run returned");
//exit (1);
}
开发者ID:MichalBoron,项目名称:remote-semaphore,代码行数:30,代码来源:callback_svc.c
示例12: main
main()
{
SVCXPRT *transp;
(void)pmap_unset(KUNDENPROG, KUNDENVERS);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
(void)fprintf(stderr, "cannot create udp service.\n");
exit(1);
}
if (!svc_register(transp, KUNDENPROG, KUNDENVERS, kundenprog_1, IPPROTO_UDP)) {
(void)fprintf(stderr, "unable to register (KUNDENPROG, KUNDENVERS, udp).\n");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
(void)fprintf(stderr, "cannot create tcp service.\n");
exit(1);
}
if (!svc_register(transp, KUNDENPROG, KUNDENVERS, kundenprog_1, IPPROTO_TCP)) {
(void)fprintf(stderr, "unable to register (KUNDENPROG, KUNDENVERS, tcp).\n");
exit(1);
}
svc_run();
(void)fprintf(stderr, "svc_run returned\n");
exit(1);
}
开发者ID:dmpe,项目名称:Semester2and5-Examples,代码行数:29,代码来源:kunden_svc.c
示例13: main
int
main (int argc, char **argv)
{
register SVCXPRT *transp;
pmap_unset (NAMENODE, NN);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, NAMENODE, NN, namenode_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (NAMENODE, NN, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, NAMENODE, NN, namenode_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (NAMENODE, NN, tcp).");
exit(1);
}
svc_run ();
fprintf (stderr, "%s", "svc_run returned");
exit (1);
/* NOTREACHED */
}
开发者ID:anirudh9119,项目名称:Distributed_Systems,代码行数:32,代码来源:namenode_svc.c
示例14: nfs_svc_unregister
/**
* nfs_svc_unregister - remove service registrations from local rpcbind database
* @program: RPC program number to unregister
* @version: RPC version number to unregister
*
* Removes all registrations for [ @program, @version ] .
*/
void
nfs_svc_unregister(const rpcprog_t program, const rpcvers_t version)
{
if (pmap_unset((unsigned long)program, (unsigned long)version) == FALSE)
xlog(D_GENERAL, "Failed to unregister program %lu, version %lu",
(unsigned long)program, (unsigned long)version);
}
开发者ID:kouril,项目名称:nfs-utils,代码行数:14,代码来源:svc_create.c
示例15: main
int
main (int argc, char **argv)
{
register SVCXPRT *transp;
pmap_unset (ARRAYSUM_CALC, ARRAYSUM_CALC_1);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, ARRAYSUM_CALC, ARRAYSUM_CALC_1, arraysum_calc_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (ARRAYSUM_CALC, ARRAYSUM_CALC_1, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, ARRAYSUM_CALC, ARRAYSUM_CALC_1, arraysum_calc_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (ARRAYSUM_CALC, ARRAYSUM_CALC_1, tcp).");
exit(1);
}
svc_run ();
fprintf (stderr, "%s", "svc_run returned");
exit (1);
/* NOTREACHED */
}
开发者ID:utkarsht,项目名称:Linux-Programs,代码行数:32,代码来源:arraysum_svc.c
示例16: udp_server
/*
* Get a UDP socket, bind it, figure out the port,
* and advertise the port as program "prog".
*
* XXX - it would be nice if you could advertise ascii strings.
*/
int
udp_server(u_long prog, int rdwr)
{
int sock;
struct sockaddr_in s;
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
perror("socket");
exit(1);
}
sock_optimize(sock, rdwr);
bzero((void*)&s, sizeof(s));
s.sin_family = AF_INET;
#ifdef NO_PORTMAPPER
s.sin_port = htons(prog);
#endif
if (bind(sock, (struct sockaddr*)&s, sizeof(s)) < 0) {
perror("bind");
exit(2);
}
#ifdef PORTMAP
(void)pmap_unset(prog, (u_long)1);
if (!pmap_set(prog, (u_long)1, (u_long)IPPROTO_UDP,
(unsigned short)sockport(sock))) {
perror("pmap_set");
exit(5);
}
#endif
return (sock);
}
开发者ID:foss-for-synopsys-dwc-arc-processors,项目名称:lmbench,代码行数:36,代码来源:lib_udp.c
示例17: signal_int_handler
static void
signal_int_handler (int sig)
{
(void) sig;
pmap_unset (RPC_PROGNUM, RPC_PROGVER);
}
开发者ID:sfionov,项目名称:mc-dev,代码行数:7,代码来源:mcserv.c
示例18: main
int
main (int argc, char **argv)
{
register SVCXPRT *transp;
pmap_unset (WHATSUPPROG, WHATSUPVERS);
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create udp service.");
exit(1);
}
if (!svc_register(transp, WHATSUPPROG, WHATSUPVERS, whatsupprog_1, IPPROTO_UDP)) {
fprintf (stderr, "%s", "unable to register (WHATSUPPROG, WHATSUPVERS, udp).");
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
fprintf (stderr, "%s", "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, WHATSUPPROG, WHATSUPVERS, whatsupprog_1, IPPROTO_TCP)) {
fprintf (stderr, "%s", "unable to register (WHATSUPPROG, WHATSUPVERS, tcp).");
exit(1);
}
svc_run ();
fprintf (stderr, "%s", "svc_run returned");
exit (1);
/* NOTREACHED */
}
开发者ID:franklinamormino,项目名称:WhatsUp,代码行数:32,代码来源:whatsup_svc.c
示例19: ippool_api_init
void ippool_api_init(void)
{
int result;
/* Register RPC interface */
ippool_rpc_xprt = svcudp_create(RPC_ANYSOCK);
if (ippool_rpc_xprt == NULL) {
ippool_log(LOG_ERR, "unable to register with RPC");
exit(1);
}
/* FIXME: is this really required? */
svc_unregister(IPPOOL_PROG, IPPOOL_VERSION);
/* Note: must call this or the registration fails every other time
* the daemon is started. */
(void) pmap_unset(IPPOOL_PROG, IPPOOL_VERSION);
result = svc_register(ippool_rpc_xprt, IPPOOL_PROG, IPPOOL_VERSION, ippool_prog_1, IPPROTO_UDP);
if (result == 0) { /* UNIX is nice and consistent about error codes ;-) */
ippool_log(LOG_ERR, "unable to register RPC program");
exit(1);
}
result = usl_fd_add_fd(ippool_rpc_xprt->xp_sock, ippool_api_rpc_msg, ippool_rpc_xprt);
if (result < 0) {
ippool_log(LOG_ERR, "unable to register RPC handler");
exit(1);
}
}
开发者ID:nakedible,项目名称:vpnease-l2tp,代码行数:30,代码来源:ippool_api.c
示例20: main
int main(void)
{
#if defined (_WIN32)
WSADATA WSAData;
#endif
int servernumber;
#if defined (_WIN32)
if (WSAStartup(MAKEWORD(2,2), &WSAData)) {
WSACleanup();
return -1;
}
#endif
for(servernumber=0; servernumber<TSP_MAX_SERVER_NUMBER; servernumber++)
{
svc_unregister (TSP_get_progid(servernumber), TSP_RPC_VERSION_INITIAL);
pmap_unset (TSP_get_progid(servernumber), TSP_RPC_VERSION_INITIAL);
}
#if defined (_WIN32)
WSACleanup();
#endif
return 0;
}
开发者ID:deweerdt,项目名称:TSP,代码行数:25,代码来源:tsp_rpc_cleanup.c
注:本文中的pmap_unset函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论