XRootD
XrdSecProtocolhost.cc
Go to the documentation of this file.
1 /******************************************************************************/
2 /* */
3 /* X r d S e c P r o t o c o l h o s t . c c */
4 /* */
5 /* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */
6 /* All Rights Reserved */
7 /* Produced by Andrew Hanushevsky for Stanford University under contract */
8 /* DE-AC02-76-SFO0515 with the Department of Energy */
9 /* */
10 /* This file is part of the XRootD software suite. */
11 /* */
12 /* XRootD is free software: you can redistribute it and/or modify it under */
13 /* the terms of the GNU Lesser General Public License as published by the */
14 /* Free Software Foundation, either version 3 of the License, or (at your */
15 /* option) any later version. */
16 /* */
17 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
18 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
20 /* License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
24 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
25 /* */
26 /* The copyright holder's institutional names and contributor's names may not */
27 /* be used to endorse or promote products derived from this software without */
28 /* specific prior written permission of the institution or contributor. */
29 /******************************************************************************/
30 
31 #include <strings.h>
32 #include <cstdlib>
33 
35 
36 /******************************************************************************/
37 /* A u t h e n t i c a t e */
38 /******************************************************************************/
39 
41  XrdSecParameters **parms,
42  XrdOucErrInfo *einfo)
43 {
44  strcpy(Entity.prot, "host");
45  Entity.host = theHost;
46  Entity.addrInfo = &epAddr;
47  return 0;
48 }
49 
50 /******************************************************************************/
51 /* g e t C r e d e n t i a l s */
52 /******************************************************************************/
53 
55  XrdOucErrInfo *einfo)
57 
58  cp->size = 5; cp->buffer = (char *)"host";
59  return cp;
60 }
61 
62 /******************************************************************************/
63 /* X r d S e c P r o t o c o l h o s t I n i t */
64 /******************************************************************************/
65 
66 // This is a builtin protocol so we don't define an Init method. Anyway, this
67 // protocol need not be initialized. It works as is.
68 
69 /******************************************************************************/
70 /* X r d S e c P r o t o c o l h o s t O b j e c t */
71 /******************************************************************************/
72 
73 // Normally this would be defined as an extern "C", however, this function is
74 // statically linked into the shared library as a native protocol so there is
75 // no reason to define it as such. Imitators, beware! Read the comments in
76 // XrdSecInterface.hh
77 //
79  const char *hostname,
80  XrdNetAddrInfo &endPoint,
81  const char *parms,
82  XrdOucErrInfo *einfo)
83 {
84 
85 // Simply return an instance of the host protocol object
86 //
87  return new XrdSecProtocolhost(hostname, endPoint);
88 }
XrdSecBuffer XrdSecCredentials
XrdSecProtocol * XrdSecProtocolhostObject(const char who, const char *hostname, XrdNetAddrInfo &endPoint, const char *parms, XrdOucErrInfo *einfo)
XrdNetAddrInfo * addrInfo
Entity's connection details.
Definition: XrdSecEntity.hh:80
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
Definition: XrdSecEntity.hh:67
char * host
Entity's host name dnr dependent.
Definition: XrdSecEntity.hh:70
XrdSecEntity Entity
XrdSecCredentials * getCredentials(XrdSecParameters *parm=0, XrdOucErrInfo *einfo=0)
int Authenticate(XrdSecCredentials *cred, XrdSecParameters **parms, XrdOucErrInfo *einfo=0)
Generic structure to pass security information back and forth.
char * buffer
Pointer to the buffer.
int size
Size of the buffer or length of data in the buffer.