Skip to content
Snippets Groups Projects
Commit 94da6b03 authored by Steven Murray's avatar Steven Murray
Browse files

Added placeholder functions for the new rmcd protocol

parent d0001fa3
Branches
Tags
No related merge requests found
......@@ -21,17 +21,24 @@ COMM
COMM @author Steven.Murray@cern.ch
COMM
COMM For licencing reasons the castor-tape-acs-dismount, castor-tape-acs-mount
COMM and castor-tape-acs-queryvolume commands are not statically linked with
COMM the CDK software provided by Oracle. However if static linking would be
COMM used then the following comments show how it could be done.
COMM
COMM libutl.a and libapi.a are circularly dependent on each other. The
COMM -Wl,--start-group -Wl,--end-group options of gcc are used to encompass a
COMM list of objects that should be passed several times in order to resolve
COMM their interdependencies.
CDKLIB = \
-Wl,--start-group \
$(LIBDIR)/CDK/libutl.a \
$(LIBDIR)/CDK/libapi.a \
-Wl,--end-group \
$(LIBDIR)/CDK/libipc.a \
$(LIBDIR)/CDK/libcl.a
COMM CDKLIB = \
COMM -Wl,--start-group \
COMM $(LIBDIR)/CDK/libutl.a \
COMM $(LIBDIR)/CDK/libapi.a \
COMM -Wl,--end-group \
COMM $(LIBDIR)/CDK/libipc.a \
COMM $(LIBDIR)/CDK/libcl.a
CDKLIB = -L $(LIBDIR)/CDK -lapi -lutl -lipc -lcl
DependsOnLibrary(castor/tape/utils,castortapeutils)
DependsOnLibrary(common,castorcommon)
......
......@@ -33,13 +33,15 @@
/* Request types */
#define RMC_GETGEOM 1 /* Get robot geometry */
#define RMC_FINDCART 2 /* Find cartridge(s) */
#define RMC_READELEM 3 /* Read element status */
#define RMC_MOUNT 4 /* Mount request */
#define RMC_UNMOUNT 5 /* Unmount request */
#define RMC_EXPORT 6 /* Export tape request */
#define RMC_IMPORT 7 /* Import tape request */
#define RMC_GETGEOM 1 /* Get robot geometry */
#define RMC_FINDCART 2 /* Find cartridge(s) */
#define RMC_READELEM 3 /* Read element status */
#define RMC_MOUNT 4 /* Mount request */
#define RMC_UNMOUNT 5 /* Unmount request */
#define RMC_EXPORT 6 /* Export tape request */
#define RMC_IMPORT 7 /* Import tape request */
#define RMC_GENERICMOUNT 8 /* Generic (SCSI or ACS) mount request */
#define RMC_GENERICUNMOUNT 9 /* Generic (SCSI or ACS) mount request */
/* SCSI media changer server reply types */
......
......@@ -6,12 +6,13 @@
/* function prototypes */
EXTERN_C int rmc_srv_export (char*, char*);
EXTERN_C int rmc_srv_findcart (char*, char*);
EXTERN_C int rmc_srv_getgeom (char*, char*);
EXTERN_C int rmc_srv_import (char*, char*);
EXTERN_C int rmc_srv_mount (char*, char*);
EXTERN_C int rmc_srv_readelem (char*, char*);
EXTERN_C int rmc_srv_unmount (char*, char*);
int rmc_srv_export(const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_findcart(const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_getgeom(const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_import(const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_mount( const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_readelem(const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_unmount(const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_genericmount(const int rpfd, char *const req_data, const char *const clienthost);
int rmc_srv_genericunmount(const int rpfd, char *const req_data, const char *const clienthost);
#endif
......@@ -20,6 +20,7 @@
#include "h/rmc_smcsubr.h"
#include "h/rmc_smcsubr2.h"
#include "h/rmc_sendrep.h"
#include "h/rmc_server_api.h"
#include "h/tplogger_api.h"
#include <string.h>
#include <Ctape_api.h>
......@@ -74,8 +75,9 @@ static void rmc_logreq(const char *const func, char *const logbuf)
}
}
int marshall_ELEMENT (char **sbpp,
struct smc_element_info *element_info)
static int marshall_ELEMENT (
char **const sbpp,
const struct smc_element_info *const element_info)
{
char *sbp = *sbpp;
......@@ -96,7 +98,7 @@ int marshall_ELEMENT (char **sbpp,
int rmc_srv_export(
const int rpfd,
char *const req_data,
char *const clienthost)
const char *const clienthost)
{
int c;
char func[16];
......@@ -151,7 +153,7 @@ int rmc_srv_export(
int rmc_srv_findcart(
const int rpfd,
char *const req_data,
char *const clienthost)
const char *const clienthost)
{
int c;
struct smc_element_info *element_info;
......@@ -250,7 +252,7 @@ int rmc_srv_findcart(
int rmc_srv_getgeom(
const int rpfd,
char *const req_data,
char *const clienthost)
const char *const clienthost)
{
char func[16];
gid_t gid;
......@@ -303,7 +305,7 @@ int rmc_srv_getgeom(
int rmc_srv_import(
const int rpfd,
char *const req_data,
char *const clienthost)
const char *const clienthost)
{
int c;
char func[16];
......@@ -358,7 +360,7 @@ int rmc_srv_import(
int rmc_srv_mount(
const int rpfd,
char *const req_data,
char *const clienthost)
const char *const clienthost)
{
int c;
int drvord;
......@@ -418,7 +420,7 @@ int rmc_srv_mount(
int rmc_srv_readelem(
const int rpfd,
char *const req_data,
char *const clienthost)
const char *const clienthost)
{
int c;
struct smc_element_info *element_info;
......@@ -510,7 +512,7 @@ int rmc_srv_readelem(
int rmc_srv_unmount(
const int rpfd,
char *const req_data,
char *const clienthost)
const char *const clienthost)
{
int c;
int drvord;
......@@ -564,3 +566,19 @@ int rmc_srv_unmount(
rmc_logit (func, "returns %d\n", c);
return c;
}
int rmc_srv_genericmount(
const int rpfd,
char *const req_data,
const char *const clienthost)
{
return 0;
}
int rmc_srv_genericunmount(
const int rpfd,
char *const req_data,
const char *const clienthost)
{
return 0;
}
......@@ -362,25 +362,31 @@ static void procreq(
switch (req_type) {
case RMC_MOUNT:
c = rmc_srv_mount (req_data, clienthost);
c = rmc_srv_mount (rpfd, req_data, clienthost);
break;
case RMC_UNMOUNT:
c = rmc_srv_unmount (req_data, clienthost);
c = rmc_srv_unmount (rpfd, req_data, clienthost);
break;
case RMC_EXPORT:
c = rmc_srv_export (req_data, clienthost);
c = rmc_srv_export (rpfd, req_data, clienthost);
break;
case RMC_IMPORT:
c = rmc_srv_import (req_data, clienthost);
c = rmc_srv_import (rpfd, req_data, clienthost);
break;
case RMC_GETGEOM:
c = rmc_srv_getgeom (req_data, clienthost);
c = rmc_srv_getgeom (rpfd, req_data, clienthost);
break;
case RMC_READELEM:
c = rmc_srv_readelem (req_data, clienthost);
c = rmc_srv_readelem (rpfd, req_data, clienthost);
break;
case RMC_FINDCART:
c = rmc_srv_findcart (req_data, clienthost);
c = rmc_srv_findcart (rpfd, req_data, clienthost);
break;
case RMC_GENERICMOUNT:
c = rmc_srv_genericmount (rpfd, req_data, clienthost);
break;
case RMC_GENERICUNMOUNT:
c = rmc_srv_genericunmount (rpfd, req_data, clienthost);
break;
default:
rmc_sendrep (rpfd, MSG_ERR, RMC03, req_type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment