Whamcloud - gitweb
file jbd-stats-2.6.9.patch was initially added on branch b1_4.
[fs/lustre-release.git] / lnet / ulnds / 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     int bound;
16     io_handler bound_handler;
17     int (*handler)(void *, void *);
18     void *handler_arg;
19     unsigned short port;
20 } *manager;
21
22
23 typedef struct connection {
24     unsigned int ip;
25     unsigned short port;
26     int fd;
27     manager m;
28 } *connection;
29
30 connection force_tcp_connection(manager m, unsigned int ip, unsigned int short,
31                                 procbridge pb);
32 manager init_connections(unsigned short, 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);