ppc_nop.c

00001 /*
00002  * Copyright (c) 2005-2012 by KoanLogic s.r.l. <http://www.koanlogic.com>
00003  * All rights reserved.
00004  *
00005  * This file is part of KLone, and as such it is subject to the license stated
00006  * in the LICENSE file which you have received as part of this distribution.
00007  *
00008  * $Id: ppc_nop.c,v 1.7 2007/11/09 22:06:26 tat Exp $
00009  */
00010 
00011 #include "klone_conf.h"
00012 #include <string.h>
00013 #include <klone/klog.h>
00014 #include <klone/context.h>
00015 #include <klone/server.h>
00016 #include <klone/ppc.h>
00017 #include <klone/ppc_cmd.h>
00018 #include <klone/server_ppc_cmd.h>
00019 #include "server_s.h"
00020 
00021 /* struct used for ppc command PPC_CMD_NOP */
00022 struct ppc_nop_s
00023 {
00024     int dummy;
00025 };
00026 
00027 typedef struct ppc_nop_s ppc_nop_t;
00028 
00029 /* client function */
00030 int server_ppc_cmd_nop(server_t *s)
00031 {
00032     ppc_nop_t nop;
00033 
00034     nop_err_if(s == NULL);
00035     nop_err_if(s->ppc == NULL);
00036 
00037     memset(&nop, 0, sizeof(ppc_nop_t));
00038 
00039     /* send the command request */
00040     nop_err_if(ppc_write(s->ppc, ctx->pipc, PPC_CMD_NOP, (char*)&nop, 
00041         sizeof(nop)) < 0);
00042 
00043     return 0;
00044 err:
00045     return ~0;
00046 }
00047 
00048 /* [parent] nop op */
00049 int server_ppc_cb_nop(ppc_t *ppc, int fd, unsigned char cmd, char *data, 
00050     size_t size, void *vso)
00051 {
00052     u_unused_args(ppc, fd, cmd, data, size, vso);
00053 
00054     u_dbg("ppc nop cmd callback");
00055     return 0;
00056 }
00057 

←Products
Copyright © 2005-2012 - KoanLogic S.r.l. - All rights reserved