File: v2client.h

package info (click to toggle)
cvm 0.97-0.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,036 kB
  • sloc: ansic: 4,065; sh: 2,758; makefile: 235; sql: 15
file content (85 lines) | stat: -rw-r--r-- 2,554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef CVM__V2CLIENT__H__
#define CVM__V2CLIENT__H__

#include <bglibs/str.h>

#include "facts.h"
#include "errors.h"

#define CVM_BUFSIZE 512

struct cvm_credential
{
  unsigned type;
  str value;
};

struct cvm_packet
{
  unsigned length;
  unsigned char data[CVM_BUFSIZE];
};

extern const char* cvm_client_account_split_chars;
extern const char* cvm_client_ucspi_domain(void);
extern int cvm_client_split_account(str* account, str* domain);
extern int cvm_client_authenticate(const char* module, unsigned count,
				   const struct cvm_credential* credentials);
extern int cvm_client_fact_str(unsigned number,
			       const char** data, unsigned* length);
extern int cvm_client_fact_uint(unsigned number, unsigned long* data);

extern int cvm_client_setugid(void);
extern int cvm_client_setenv(void);

extern unsigned cvm_xfer_command_packets(const char* module,
					 const struct cvm_packet* request,
					 struct cvm_packet* response);
extern unsigned cvm_xfer_local_packets(const char* path,
				       const struct cvm_packet* request,
				       struct cvm_packet* response);
extern unsigned cvm_xfer_udp_packets(const char* hostport,
				     const struct cvm_packet* request,
				     struct cvm_packet* response);

/* Wrapper functions for library compatibility. */
extern unsigned cvm_xfer_command(const char* module,
				 unsigned char buffer[CVM_BUFSIZE],
				 unsigned* buflen);
extern unsigned cvm_xfer_local(const char* path,
			       unsigned char buffer[CVM_BUFSIZE],
			       unsigned* buflen);
extern unsigned cvm_xfer_udp(const char* hostport,
			     unsigned char buffer[CVM_BUFSIZE],
			     unsigned* buflen);

/* Wrapper functions. */
extern int cvm_client_authenticate_password(const char* module,
					    const char* account,
					    const char* domain,
					    const char* password,
					    int split_account);

#ifndef CVM_NOCOMPAT

/* Legacy definitions. */
#define cvm_account_split_chars    cvm_client_account_split_chars
#define cvm_ucspi_domain           cvm_client_ucspi_domain
#define cvm_setugid                cvm_client_setugid
#define cvm_setenv                 cvm_client_setenv
#define cvm_authenticate_password  cvm_client_authenticate_password
#define cvm_split_account          cvm_client_split_account

#ifndef CVM__MODULE__H__
# define cvm_authenticate          cvm_client_authenticate
# define cvm_fact_str              cvm_client_fact_str
# define cvm_fact_uint             cvm_client_fact_uint
#else
# undef cvm_authenticate
# undef cvm_fact_str
# undef cvm_fact_uint
#endif

#endif

#endif