source: web/old/remctl-2.14/client/internal.h @ f6f3e91

web
Last change on this file since f6f3e91 was f6f3e91, checked in by Jessica B. Hamrick <jhamrick@…>, 15 years ago

Preserve directory hierarchy (not sure what happened to it)

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 * Internal support functions for the remctl client library.
3 *
4 * Written by Russ Allbery <rra@stanford.edu>
5 * Based on prior work by Anton Ushakov
6 * Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008
7 *     Board of Trustees, Leland Stanford Jr. University
8 *
9 * See LICENSE for licensing terms.
10 */
11
12#ifndef CLIENT_INTERNAL_H
13#define CLIENT_INTERNAL_H 1
14
15#include <config.h>
16#include <portable/gssapi.h>
17#include <portable/macros.h>
18#include <portable/stdbool.h>
19
20/* Forward declaration to avoid unnecessary includes. */
21struct iovec;
22
23BEGIN_DECLS
24
25/* Private structure that holds the details of an open remctl connection. */
26struct remctl {
27    const char *host;           /* From remctl_open, stored here because */
28    unsigned short port;        /*   remctl v1 requires opening a new    */
29    const char *principal;      /*   connection for each command.        */
30    int protocol;               /* Protocol version. */
31    int fd;
32    gss_ctx_id_t context;
33    char *error;
34    struct remctl_output *output;
35    int status;
36    bool ready;                 /* If true, we are expecting server output. */
37};
38
39/* Internal functions should all default to hidden visibility. */
40#pragma GCC visibility push(hidden)
41
42/* Helper functions to set errors. */
43void internal_set_error(struct remctl *, const char *, ...);
44void internal_gssapi_error(struct remctl *, const char *error,
45                           OM_uint32 major, OM_uint32 minor);
46void internal_token_error(struct remctl *, const char *error, int status,
47                          OM_uint32 major, OM_uint32 minor);
48
49/* Wipe and free the output token. */
50void internal_output_wipe(struct remctl_output *);
51
52/* General connection opening and negotiation function. */
53bool internal_open(struct remctl *, const char *host, unsigned short port,
54                   const char *principal);
55
56/* Send a protocol v1 command. */
57bool internal_v1_commandv(struct remctl *, const struct iovec *command,
58                          size_t count);
59
60/* Read a protocol v1 response. */
61struct remctl_output *internal_v1_output(struct remctl *);
62
63/* Send a protocol v2 command. */
64bool internal_v2_commandv(struct remctl *, const struct iovec *command,
65                          size_t count);
66
67/* Send a protocol v2 QUIT command. */
68bool internal_v2_quit(struct remctl *);
69
70/* Read a protocol v2 response. */
71struct remctl_output *internal_v2_output(struct remctl *);
72
73/* Undo default visibility change. */
74#pragma GCC visibility pop
75
76END_DECLS
77
78#endif /* !CLIENT_INTERNAL_H */
Note: See TracBrowser for help on using the repository browser.