Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/libcs/csslib.h
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1990-2012 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Glenn Fowler <[email protected]> *
18
* *
19
***********************************************************************/
20
#pragma prototyped
21
22
/*
23
* Glenn Fowler
24
* AT&T Research
25
*
26
* connect stream server support
27
*/
28
29
#ifndef _CSSLIB_H
30
#define _CSSLIB_H
31
32
#include "cslib.h"
33
34
#include <error.h>
35
#include <sig.h>
36
#include <tok.h>
37
38
#define EXPIRE 60
39
#define KEYEXPIRE (60*5)
40
#define KEYMASK 0x7fffffff
41
#define TOSS(k) while(CSTOSS(k,cs.time)<=CS_KEY_MAX)
42
43
typedef struct
44
{
45
int seq;
46
unsigned long expire;
47
time_t atime;
48
time_t mtime;
49
Csid_t id;
50
} Auth_t;
51
52
typedef struct
53
{
54
dev_t dev;
55
ino_t ino;
56
} Fid_t;
57
58
struct Common_s;
59
typedef struct Common_s Common_t;
60
61
#define _CSS_FD_PRIVATE_ \
62
Css_t* css; \
63
int events; \
64
int set;
65
66
#define _CSS_PRIVATE_ \
67
Cssdisc_t* disc; \
68
Css_t* next; \
69
char buf[PATH_MAX]; \
70
char tmp[PATH_MAX]; \
71
int auth; \
72
int challenge; \
73
int fdpending; \
74
int fdpolling; \
75
int fdlistening; \
76
int fduser; \
77
Fid_t fid[2]; \
78
gid_t gid; \
79
uid_t uid; \
80
unsigned long newkey; \
81
unsigned long oldkey; \
82
unsigned long conkey; \
83
unsigned long timeout_last; \
84
unsigned long timeout_remain; \
85
unsigned long wakeup_last; \
86
unsigned long wakeup_remain;
87
88
#include <css.h>
89
90
struct Common_s
91
{
92
Css_t* servers;
93
Css_t* main;
94
Auth_t* auth;
95
int nauth;
96
Cspoll_t* fdpoll;
97
Cssfd_t* fdinfo;
98
unsigned long flags;
99
int fdpending;
100
int fdpolling;
101
int fdbefore;
102
int fdloop;
103
int fdnext;
104
int fdmax;
105
int pid;
106
int polling;
107
unsigned long expire;
108
};
109
110
#endif
111
112