service.h 1.8 KB
Newer Older
Niels Möller's avatar
Niels Möller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* service.h
 *
 */

/* lsh, an implementation of the ssh protocol
 *
 * Copyright (C) 1998 Niels Möller
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
J.H.M. Dassen's avatar
J.H.M. Dassen committed
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Niels Möller's avatar
Niels Möller committed
22
23
24
25
26
 */

#ifndef LSH_SERVICE_H_INCLUDED
#define LSH_SERVICE_H_INCLUDED

27
#include "alist.h"
Niels Möller's avatar
Niels Möller committed
28
29
#include "connection.h"

30
31
/* Used for both proper services (i.e. services that can be requested
 * in a SSH_MSG_SERVICE_REQUEST or SSH_MSG_USERAUTH_REQUEST) and for
Niels Möller's avatar
Niels Möller committed
32
 * any other stuff that needs initialization at some later time. */
Niels Möller's avatar
Niels Möller committed
33

34
#define GABA_DECLARE
Niels Möller's avatar
Niels Möller committed
35
#include "service.h.x"
36
#undef GABA_DECLARE
Niels Möller's avatar
Niels Möller committed
37

38
/* GABA:
Niels Möller's avatar
Niels Möller committed
39
40
41
   (class
     (name ssh_service)
     (vars
Niels Möller's avatar
Niels Möller committed
42
       (init method int "struct ssh_connection *c")))
Niels Möller's avatar
Niels Möller committed
43
*/
Niels Möller's avatar
Niels Möller committed
44
45
46

#define SERVICE_INIT(s, c) ((s)->init((s), (c)))

Niels Möller's avatar
Niels Möller committed
47
#if 0
Niels Möller's avatar
Niels Möller committed
48
/* services is an alist mapping names to service objects */
Niels Möller's avatar
Niels Möller committed
49
50
51
52
struct packet_handler *
make_service_request_handler(struct alist *services,
			     struct command_continuation *c);
#endif
Niels Möller's avatar
Niels Möller committed
53

54
#if 0
Niels Möller's avatar
Niels Möller committed
55
int request_service(int name, struct ssh_service * service);
56
#endif
Niels Möller's avatar
Niels Möller committed
57

58
struct lsh_string *format_service_request(int name);
59
60
61
62
struct lsh_string *format_service_accept(int name);

struct ssh_service *make_meta_service(struct alist *services);

Niels Möller's avatar
Niels Möller committed
63
#endif /* LSH_SERVICE_H_INCLUDED */