Whamcloud - gitweb
Landing b_hd_newconfig on HEAD
[fs/lustre-release.git] / lnet / ulnds / socklnd / connection.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (c) 2002 Cray Inc.
5  *
6  *   This file is part of Portals, http://www.sf.net/projects/sandiaportals/
7  */
8
9 #include <table.h>
10 #include <procbridge.h>
11
12 typedef struct manager {
13     table           connections;
14     pthread_mutex_t conn_lock; /* protect connections table */
15 #if 0                          /* we don't accept connections */
16     int             bound;
17     io_handler      bound_handler;
18 #endif
19     int           (*handler)(void *, void *);
20     void           *handler_arg;
21     int             port;
22 } *manager;
23
24
25 typedef struct connection {
26         lnet_nid_t      peer_nid;
27         int            fd;
28         manager        m;
29 } *connection;
30
31 connection force_tcp_connection(manager m, lnet_nid_t nid, procbridge pb);
32 manager init_connections(int (*f)(void *, void *), void *);
33 void remove_connection(void *arg);
34 void shutdown_connections(manager m);
35 int read_connection(connection c, unsigned char *dest, int len);