1 /*
2  * linc-server.h: This file is part of the linc library.
3  *
4  * Authors:
5  *    Elliot Lee     (sopwith@redhat.com)
6  *    Michael Meeks  (michael@ximian.com)
7  *    Mark McLouglin (mark@skynet.ie) & others
8  *
9  * Copyright 2001, Red Hat, Inc., Ximian, Inc.,
10  *                 Sun Microsystems, Inc.
11  */
12 #ifndef _LINK_SERVER_H_
13 #define _LINK_SERVER_H_
14 
15 #include <glib.h>
16 
17 G_BEGIN_DECLS
18 
19 #include <linc/linc-protocol.h>
20 #include <linc/linc-connection.h>
21 
22 #define LINK_TYPE_SERVER            (link_server_get_type())
23 #define LINK_TYPE_IS_SERVER(type)   (G_TYPE_FUNDAMENTAL (type) == LINK_TYPE_SERVER)
24 #define LINK_SERVER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), LINK_TYPE_SERVER, LinkServer))
25 #define LINK_SERVER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), LINK_TYPE_CONNETION, LinkServerClass))
26 #define LINK_IS_SERVER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LINK_TYPE_SERVER))
27 #define LINK_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LINK_TYPE_SERVER))
28 
29 typedef struct _LinkServerPrivate LinkServerPrivate;
30 
31 typedef struct {
32 	GObject                 parent;
33 
34 	const LinkProtocolInfo *proto;
35 
36 	char                   *local_host_info;
37 	char                   *local_serv_info;
38 
39 	/* Options that incoming connections are created with */
40 	LinkConnectionOptions   create_options;
41 
42 	LinkServerPrivate      *priv;
43 } LinkServer;
44 
45 typedef struct {
46 	GObjectClass       parent_class;
47 
48 	LinkConnection *(* create_connection) (LinkServer     *srv);
49 
50 	void            (* new_connection)    (LinkServer     *srv,
51 					       LinkConnection *cnx);
52 } LinkServerClass;
53 
54 GType    link_server_get_type (void) G_GNUC_CONST;
55 
56 gboolean link_server_setup    (LinkServer *srv,
57 			       const char *proto_name,
58 			       const char *local_host_info,
59 			       const char *local_serv_info,
60 			       LinkConnectionOptions create_options);
61 
62 G_END_DECLS
63 
64 #endif /* _LINK_SERVER_H_ */
65