Whamcloud - gitweb
land v0.9.1 on HEAD, in preparation for a 1.0.x branch
[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
11 typedef struct manager {
12     table connections;
13     pthread_mutex_t conn_lock; /* protect connections table */
14     int bound;
15     io_handler bound_handler;
16     int (*handler)(void *, void *);
17     void *handler_arg;
18     unsigned short port;
19 } *manager;
20
21
22 typedef struct connection {
23     unsigned int ip;
24     unsigned short port;
25     int fd;
26     manager m;
27 } *connection;
28
29 connection force_tcp_connection(manager m, unsigned int ip, unsigned int short);
30 manager init_connections(unsigned short, int (*f)(void *, void *), void *);
31 void remove_connection(void *arg);
32 void shutdown_connections(manager m);
33 int read_connection(connection c, unsigned char *dest, int len);