kom-types.h 18.8 KB
Newer Older
Linus Tolke Y's avatar
Linus Tolke Y committed
1
/*
David Byers's avatar
David Byers committed
2
 * $Id: kom-types.h,v 0.35 1999/05/18 13:06:26 byers Exp $
Per Cederqvist's avatar
Per Cederqvist committed
3
 * Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996  Lysator Academic Computer Association.
Linus Tolke Y's avatar
Linus Tolke Y committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 *
 * This file is part of the LysKOM server.
 * 
 * LysKOM is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 1, or (at your option) 
 * any later version.
 * 
 * LysKOM is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with LysKOM; see the file COPYING.  If not, write to
 * Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
 * or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
 * MA 02139, USA.
 *
 * Please mail bug reports to bug-lyskom@lysator.liu.se. 
 */
Per Cederqvist's avatar
.  
Per Cederqvist committed
25 26 27 28
/*
 *  KOM-types.h  --  Types used by both server and client of LysKOM
 *
 *
Per Cederqvist's avatar
Per Cederqvist committed
29
 *  Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996	Lysator Computer Club,
Per Cederqvist's avatar
.  
Per Cederqvist committed
30 31 32 33 34 35
 *			Linkoping University,  Sweden
 *
 *  Everyone is granted permission to copy, modify and redistribute
 *  this code, provided the people they give it to can.
 *
 *
36 37 38 39
 *  Filecreator: Thomas Bellman
 *		  Lysator Computer Club
 *		  Linkoping University
 *		  Sweden
Per Cederqvist's avatar
.  
Per Cederqvist committed
40
 *
41
 *  email:	  Bellman@Lysator.LiU.SE
Per Cederqvist's avatar
.  
Per Cederqvist committed
42 43 44 45 46 47 48
 */



#ifndef  KOM_TYPES_H_ALREADY_INCLUDED__
#define  KOM_TYPES_H_ALREADY_INCLUDED__

inge's avatar
inge committed
49 50 51 52 53 54

#include <sys/types.h>
#include <time.h>
#include "s-string.h"


Per Cederqvist's avatar
.  
Per Cederqvist committed
55
#ifndef SERVER
56 57
#  error must define SERVER
#endif
Per Cederqvist's avatar
.  
Per Cederqvist committed
58

59 60 61
#ifdef CLIENT
#  error This file no longer supports CLIENT
#endif
Per Cederqvist's avatar
.  
Per Cederqvist committed
62

David Byers's avatar
David Byers committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76
/* Some objects in LysKOM need a type field.
   These are the valid values */

typedef enum {
    NO_OBJECT_TYPE = 0,         /* No object at all             */
    TEXT_OBJECT_TYPE  = 1,      /* Text object                  */
    CONF_OBJECT_TYPE  = 2,      /* Conference object            */
    PERS_OBJECT_TYPE  = 3,      /* Person object                */
    INFO_OBJECT_TYPE  = 4       /* System info object           */
} Object_type;




Per Cederqvist's avatar
Per Cederqvist committed
77 78 79 80 81
typedef unsigned short Pers_no;
typedef unsigned short Conf_no;
typedef unsigned long  Text_no;
typedef unsigned long  Local_text_no;
typedef unsigned long  Session_no;
Per Cederqvist's avatar
.  
Per Cederqvist committed
82

83 84 85 86 87 88 89 90 91 92
#ifdef PROT_a

/*
 * To uniquely identify a person, conference or text, three numbers
 * are used: Universe, Site and X_{recpt,person,text}. The universe is
 * omitted when it is LysKOM, or is implied by a echo conference.
 */
/*
 * LysKOM, RFC-822, FidoNet, News are examples of universes.
 */
93
/*typedef		unsigned long		Universe;*/
94 95 96 97 98 99

/*
 * JAKOM, lysator.liu.se, 2:504/113, foo.bar.com are examples of sites
 * in the above universes. (Note that comp.lang.c is _not_ a site in
 * the News universe).
 */
100
/*typedef		unsigned long		Site;*/
101 102 103 104 105 106 107 108 109 110 111

/*
 * Fritt Forum, ceder, Per Cederqvist, comp.lang.c are examples of
 * x_recpt in the above universes.
 */

/*
 * But for now, we have a System_id (sum of Universe and Site) and a
 * Global_x.
 */

112 113 114 115
typedef		unsigned long		System_id;
typedef		unsigned long		Global_recpt;
typedef		unsigned long		Global_person;
typedef		unsigned long		Global_text;
116 117 118 119

#endif


Per Cederqvist's avatar
.  
Per Cederqvist committed
120 121 122 123 124 125
#define	MAX_PERS_NO		((Pers_no) USHRT_MAX)
#define MAX_CONF_NO		((Conf_no) USHRT_MAX)
#define MAX_TEXT_NO		((Text_no) ULONG_MAX)
#define	MAX_LOCAL_TEXT_NO	((Local_text_no) ULONG_MAX)


126 127 128 129
#define PASSWD_LEN 64
typedef char   Password[PASSWD_LEN];
typedef off_t  Text_index;
typedef time_t Time;
Per Cederqvist's avatar
.  
Per Cederqvist committed
130 131 132 133 134 135 136 137


/*
 * The privilige bits:  says what priviliges a person has.  E g
 *  if he is allowed to read texts he normally shouldn't be allowed
 *  to read. See file doc/security-levels.txt
 */
typedef	struct {
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
	unsigned int	wheel	: 1;
	unsigned int	admin	: 1;
	unsigned int	statistic : 1;
	unsigned int	create_pers: 1;
	unsigned int	create_conf: 1;
	unsigned int	change_name: 1;
	unsigned int	extern_gw : 1;
	unsigned int	flg8	: 1;	/* For future use. */
	unsigned int	flg9    : 1;
	unsigned int	flg10   : 1;
	unsigned int	flg11   : 1;
	unsigned int	flg12	: 1;
	unsigned int	flg13	: 1;
	unsigned int	flg14	: 1;
	unsigned int	flg15	: 1;
	unsigned int	flg16	: 1;
Per Cederqvist's avatar
.  
Per Cederqvist committed
154 155 156 157 158 159
} Priv_bits;

/*
 * Flags in the Person struct.
 */
typedef struct {
Per Cederqvist's avatar
Per Cederqvist committed
160 161
    unsigned int  unread_is_secret : 1;/* FALSE if everyone is allowed to ask
					  how many unread texts you have. */
162 163 164 165 166 167 168
    unsigned int  flg2	: 1;
    unsigned int  flg3	: 1;
    unsigned int  flg4	: 1;
    unsigned int  flg5	: 1;
    unsigned int  flg6	: 1;
    unsigned int  flg7	: 1;
    unsigned int  flg8	: 1;
Per Cederqvist's avatar
.  
Per Cederqvist committed
169 170 171 172
} Personal_flags;


/* See file doc/misc_items */
173 174 175 176 177 178 179 180 181
typedef enum {
    recpt     = 0,	/* 0 Recipient (conference) */
    cc_recpt  = 1,	/* 1 Carbon Copy recipient (extra kopia) */
    comm_to   = 2,	/* 2 Comment to (text) */
    comm_in   = 3,	/* 3 Commented in (text) */
    footn_to  = 4,	/* 4 This is a footnote to (text) */
    footn_in  = 5,	/* 5 Footnote to this text in (text) */
#ifdef PROT_a
    x_author  = 10,	/* 10 External author (Global_name). */
Per Cederqvist's avatar
.  
Per Cederqvist committed
182 183
#endif
    
184 185 186
    loc_no    = 6,	/* 6 Sequence number within conference */
    rec_time  = 7,	/* 7 Received at (time) */
    sent_by   = 8,	/* 8 Sent by (person) */
187
    sent_at   = 9,	/* 9 Sent at (time) */
David Byers's avatar
David Byers committed
188
    bcc_recpt = 15,	/* 15 BCC recipient (for kannedom) */
189 190 191 192 193 194 195
#ifdef PROT_a
	,
    x_person  = 11,	/* 11 External person id. (Global_name). */
    x_recpt   = 12,	/* 12 External recipient. (Global_name). */
    x_text    = 13,	/* 13 External text. (Global_text). */
    x_system  = 14	/* 14 External system identification (System_id). */
#endif
David Byers's avatar
David Byers committed
196 197

    unknown_info = 4711 /* Internal use only. Unknown misc item encountered */
Per Cederqvist's avatar
.  
Per Cederqvist committed
198 199
} Info_type;

200 201 202 203
#ifdef PROT_a
typedef String Global_name;
#endif

Per Cederqvist's avatar
.  
Per Cederqvist committed
204 205 206
typedef	union {
		Conf_no		recipient;
		Conf_no		cc_recipient;
207
		Conf_no		bcc_recipient;
Per Cederqvist's avatar
.  
Per Cederqvist committed
208 209 210 211
		Text_no		comment_to;
		Text_no		commented_in;
		Text_no		footnote_to;
		Text_no		footnoted_in;
212 213 214 215 216 217 218

#ifdef PROT_a
		Global_name	x_author; /* Protocol a. */
#endif

		Local_text_no	local_no;
		Time		received_at;
Per Cederqvist's avatar
.  
Per Cederqvist committed
219 220
		Pers_no		sender;
		Time		sent_at;
221 222 223 224 225 226 227

#ifdef PROT_a
		Global_name	global_person;
		Global_name	global_recpt;
		Global_text	global_text;
		System_id	system_id;
#endif
David Byers's avatar
David Byers committed
228
                Info_type       unknown_type;
Per Cederqvist's avatar
.  
Per Cederqvist committed
229 230 231 232 233 234 235 236 237 238
} Info_datum;


/*  This struct contains miscellaneous information about a text.  */
typedef	struct {
	Info_type	type;
	Info_datum	datum;
} Misc_info;


David Byers's avatar
David Byers committed
239 240 241 242 243 244
typedef struct {
    unsigned short      no_of_misc;
    Misc_info         * misc;
} Misc_info_list;


245 246 247 248 249
typedef struct {
    unsigned int        deleted : 1; /* This item has been deleted */
    unsigned int        inherit : 1; /* Copy to comments */
    unsigned int        secret : 1; /* Don't show anyone */
    unsigned int        hide_creator : 1; /* Don't show the creator */
250
    unsigned int        dont_garb : 1; /* Don't garb object */
251 252 253 254 255 256
    unsigned int        reserved3 : 1;
    unsigned int        reserved4 : 1;
    unsigned int        reserved5 : 1;
} Aux_item_flags;
   

David Byers's avatar
David Byers committed
257 258 259 260 261 262 263 264 265 266
typedef struct {
    Object_type     target_type;
    unsigned long   target_item;
    union {
        Conf_no     conf;
        Text_no     text;
    } target_object;
} Aux_item_link;


267 268 269 270 271 272 273 274
typedef struct {
    unsigned long       aux_no;
    Pers_no             creator;
    Time                sent_at;
    Aux_item_flags      flags;
    unsigned long       inherit_limit;
    unsigned long       tag;
    String              data;
David Byers's avatar
David Byers committed
275
    Aux_item_link       linked_item;
276 277 278 279 280 281 282 283
} Aux_item;

typedef struct {
    unsigned short      length;
    Aux_item          * items;
} Aux_item_list;


Per Cederqvist's avatar
.  
Per Cederqvist committed
284 285 286
/*  Fields of this type is supposed to tell the garbage collector
 *  which texts it should remove first.
 */
287
typedef unsigned long	Garb_nice;
Per Cederqvist's avatar
.  
Per Cederqvist committed
288 289 290 291 292 293 294 295 296


/*  Struct for text status  */
typedef struct {
	Time		  creation_time;
#ifdef SERVER
        long              file_pos; /* Start of the text in the text file. */
#endif
	Pers_no		  author;
297
	unsigned short		  no_of_lines;
Per Cederqvist's avatar
.  
Per Cederqvist committed
298
	String_size	  no_of_chars;
299 300
	unsigned short		  no_of_marks;	/* Antal markeringar */
	unsigned short		  no_of_misc;	/* Recipients, times, comments, ... */
301
        unsigned long            highest_aux;
Per Cederqvist's avatar
.  
Per Cederqvist committed
302
	Misc_info	* misc_items;	/* List of miscellaneous info. */
303
        Aux_item_list     aux_item_list;
Per Cederqvist's avatar
.  
Per Cederqvist committed
304 305 306 307
} Text_stat;


typedef	struct {
Per Cederqvist's avatar
Per Cederqvist committed
308 309 310 311 312 313 314 315 316 317 318
	unsigned int	rd_prot	: 1;	/* !(Can anyone become a member?) */
	unsigned int	original : 1;	/* Comments forbidden? */
	unsigned int	secret : 1;	/* Secret conference? */
				/* Note: if a letterbox is secret it
				 * will be very hard for that person
				 * to log in, since he can't map his
				 * name to a pers_no. He must either
				 * know his pers_no, or have another
				 * identity which is his supervisor.
				 */
	unsigned int	letter_box : 1;	/* Is this a letter box? */
319
	unsigned int    allow_anon : 1; /* do we accept anonymous messages */
David Byers's avatar
David Byers committed
320
        unsigned int	forbid_secret : 1; /* do we allow secret members */
321 322
	unsigned int	reserved2 : 1;
	unsigned int	reserved3 : 1;
Per Cederqvist's avatar
.  
Per Cederqvist committed
323 324 325 326
} Conf_type;


typedef struct {
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
    Bool invitation : 1;
    Bool passive : 1;
    Bool secret : 1;
    Bool reserved1 : 1;
    Bool reserved2 : 1;
    Bool reserved3 : 1;
    Bool reserved4 : 1;
    Bool reserved5 : 1;
} Membership_type;


typedef struct {
    Pers_no		member;
    Pers_no             added_by; 
    Time                added_at;
   Membership_type     type;
Per Cederqvist's avatar
.  
Per Cederqvist committed
343 344 345 346 347 348
} Member;


/* Struct for marks */
typedef struct {
	Text_no		text_no;
Per Cederqvist's avatar
Per Cederqvist committed
349
	unsigned char	mark_type;	/* It's up to the clients to decide the
Per Cederqvist's avatar
.  
Per Cederqvist committed
350 351 352 353 354 355
					   meaning of this field. */
} Mark;



/*  Information about a person's membership in a conference  */
356

Per Cederqvist's avatar
.  
Per Cederqvist committed
357
typedef struct {
358 359 360 361
    unsigned long   position;
    Conf_no		conf_no;
    unsigned char	priority;	/* Interrupt priority */
    Time		last_time_read;	/* Updated every time a text in this
Per Cederqvist's avatar
.  
Per Cederqvist committed
362
					   conf. is marked as read.	*/
363
    Local_text_no	last_text_read;	/* All texts before and inclusive this
Per Cederqvist's avatar
.  
Per Cederqvist committed
364
					   are read	*/
365 366 367 368 369 370
    unsigned short	no_of_read;
    Local_text_no * read_texts;	/* Texts after last_text_read. Sorted
                                   in ascending order */
    Pers_no added_by;
    Time                added_at;
    Membership_type type;
Per Cederqvist's avatar
.  
Per Cederqvist committed
371 372 373 374 375 376
} Membership;


/* Some structs to handle variable-sized arrays. */

typedef struct {
377
	unsigned short	  no_of_marks;
Per Cederqvist's avatar
.  
Per Cederqvist committed
378 379 380 381 382
	Mark	* marks;		/* Pointer to an array of marks. */
} Mark_list;


typedef struct {
383
    unsigned short no_of_confs;
Per Cederqvist's avatar
.  
Per Cederqvist committed
384 385 386 387 388
    Conf_no  *conf_nos;
} Conf_no_list;


typedef struct {
389
	unsigned short	  no_of_members;
Per Cederqvist's avatar
.  
Per Cederqvist committed
390 391 392 393 394 395 396 397
	Member	* members;
} Member_list;


/*  A list of conference numbers, also telling if it is a
 *  mailbox (i e a person) or an ordinary conference.	*/
/* Delete this ugly variant as soon as possible! */
typedef struct {
398
	unsigned long		  no_of_conf_nos;
Per Cederqvist's avatar
.  
Per Cederqvist committed
399 400 401 402 403 404 405 406 407 408
	Conf_no		* conf_nos;
	Conf_type	* type_of_conf;
} Conf_list_old;
/* This is the way it should look! */
typedef struct {
	Conf_no   conf_no;
	Conf_type type;
} Micro_conf;

typedef struct {
409
	unsigned long       no_of_confs;
Per Cederqvist's avatar
.  
Per Cederqvist committed
410 411 412 413 414 415
	Micro_conf * confs;
} Conf_list;


/*  A list of person numbers  */
typedef struct {
416
	unsigned long		  no_of_persons;
Per Cederqvist's avatar
.  
Per Cederqvist committed
417 418 419 420
	Pers_no		* persons;
} Pers_list;

typedef struct {
421
	unsigned short	      no_of_confs;
Per Cederqvist's avatar
.  
Per Cederqvist committed
422 423 424
	Membership  * confs;
} Membership_list;

David Byers's avatar
David Byers committed
425
typedef struct {
426
	int		       length;
David Byers's avatar
David Byers committed
427 428 429
        long                  *data;
} Number_list;

Per Cederqvist's avatar
.  
Per Cederqvist committed
430 431 432 433 434 435 436 437 438

/* The Info struct */
typedef struct {
	long		version;
	Conf_no		conf_pres_conf; /* Presentation of new confs */
	Conf_no		pers_pres_conf;	/* Presentation of new persons */
	Conf_no		motd_conf; 	/* Conf that receive motds */
	Conf_no		kom_news_conf;  /* News about kom */
	Text_no		motd_of_lyskom; /* To be displayed after login */
439 440
        long            highest_aux_no; /* Last aux-item number */
        Aux_item_list   aux_item_list;  /* System aux items */
Per Cederqvist's avatar
.  
Per Cederqvist committed
441 442
	/* and maybe more... */
} Info;
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
 
struct l2g_block_info;

/* Nothing outside local-to-global.c should access the contents of a
   Local_to_global directly.  Use the accessor functions declared in
   local-to-global.h instead.  */
typedef struct {
    int num_blocks;
    Local_text_no first_unused;
    struct l2g_block_info * blocks;
} Local_to_global;

typedef struct {
    const Local_to_global *l2g;
    const struct l2g_block_info *binfo;
    int                arrindex;
    Local_text_no      beginval;       /* First index in the search */
    Local_text_no      endval;	       /* Last index in the search + 1 */

    int                search_ended;   /* 1 if finished, 0 otherwise */
    Local_text_no      lno;	       /* The Local_text_no to use */
    Text_no            tno;	       /* The Text_no to use */
} L2g_iterator;

Per Cederqvist's avatar
Per Cederqvist committed
467 468 469 470
/* This struct holds the information that is needed to output a
   Text-Mapping.  Please note that the protocol A Text-Mapping data
   type looks very different from this structure.  */
typedef struct {
471 472 473
    Local_text_no          first;
    unsigned long          no_of_texts;
    const Local_to_global *l2g;
Per Cederqvist's avatar
Per Cederqvist committed
474 475
} Text_mapping;

476 477 478
/* For performance reasons, sort the fields in increasing size.
  The comments about number of bits are true on a Sun Sparc-2, not
  necessarily anything else.  The code should work anyhow. */
Per Cederqvist's avatar
.  
Per Cederqvist committed
479
typedef	struct {
480 481 482 483
        /* 8-bit quantities */
	Conf_type	type;		/* secret, rd_prot etc */

	/* 16-bit quantities */
Per Cederqvist's avatar
.  
Per Cederqvist committed
484 485 486 487 488 489 490 491
	Pers_no		creator;
	Conf_no		supervisor;	/* Organisat|r f|r m|tet */
	Conf_no		permitted_submitters;	/* People who are allowed
					   to submit texts to this conf. 
					   0 -> anyone may submit. */
	Conf_no		super_conf;	/* Send unallowed submissions to
					   the super_conf. 
					   0 -> unallowed submissions bounce */
492 493 494 495

	/* 32-bit quantities */
	Time		creation_time;
	Text_no		presentation;
Per Cederqvist's avatar
.  
Per Cederqvist committed
496 497 498 499 500
	Time		last_written;	/* Time of latest text in this conf. */
	Text_no		msg_of_day;	/* Message to be displayed when this
					   conf is referenced by the user. */
	Garb_nice	nice;		/* How long do texts in this
					   conf live? */
501
        Garb_nice       keep_commented; /* New comments protect texts */
502
        Garb_nice       expire;         /* When do we auto-kill this */
Per Cederqvist's avatar
.  
Per Cederqvist committed
503
	String		name;		/* Name of conference */
504 505
        unsigned long   highest_aux;
        Aux_item_list   aux_item_list;
Per Cederqvist's avatar
.  
Per Cederqvist committed
506
#ifdef CLIENT
507
	unsigned short		no_of_members;
Per Cederqvist's avatar
.  
Per Cederqvist committed
508
	Local_text_no	first_local_no;
509
	unsigned long		no_of_texts;
Per Cederqvist's avatar
.  
Per Cederqvist committed
510 511
#else
	Member_list	members;	/* List of members in conf */
512
	Local_to_global texts;		/* List of texts */
Per Cederqvist's avatar
.  
Per Cederqvist committed
513 514 515 516 517 518 519 520 521 522 523 524
#endif
} Conference;



typedef struct {
	String		name;		/* Name of conference */
	Conf_type	type;		/* secret, rd_prot etc */
	Local_text_no	highest_local_no; /* highest local text no */
	Garb_nice	nice;	        /* Number of days to live */
} Small_conf;

525 526 527 528 529 530 531 532 533 534
typedef struct {
	String      name;
	Conf_type   type;
	Conf_no     conf_no;
} Conf_z_info;

typedef struct {
	unsigned short    no_of_confs;
	Conf_z_info     * confs;
} Conf_z_info_list;
Per Cederqvist's avatar
.  
Per Cederqvist committed
535 536 537 538 539 540 541 542

/*  Struct for persons  */
typedef struct {
	Text_no		user_area;	/* Misc info the clients might want to
					   store. 0 = not used. */
	Priv_bits	privileges;
	Personal_flags	flags;
	Time		last_login; 	/* Or logout */
543 544 545 546 547 548 549 550
	unsigned long		total_time_present; /* Number of seconds. */
	unsigned long		sessions;	/* Number of sessions */
	unsigned long		created_lines;	/* No. of created lines (statistics) */
	unsigned long		created_bytes;	/* No. of created bytes (statistics) */
	unsigned long		read_texts;	/* No. of read texts (statistics) */
	unsigned long		no_of_text_fetches; /* (statistics) */
	unsigned short		created_persons; /* (statistics) */
	unsigned short		created_confs;	/* (statistics) */
551
	String                  username;	/* User-name & hostname */
Per Cederqvist's avatar
.  
Per Cederqvist committed
552 553 554
#ifdef CLIENT
	Local_text_no	first_created_text; /* The first text that still
					     * exists. */
555 556 557
	unsigned long		no_of_created_texts;
	unsigned short		no_of_marks;	/* This many marked texts */
	unsigned short		no_of_confs;	/* Member in this many confs */
Per Cederqvist's avatar
.  
Per Cederqvist committed
558
#else	/* SERVER */
559
	Local_to_global created_texts;
Per Cederqvist's avatar
.  
Per Cederqvist committed
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584
	Mark_list	marks;		/* List of marked texts */
	Membership_list conferences;	/* List of conferences the person is
					 * a member in. */
	Password	pwd;		/* Encrypted password */
#endif
} Person;


/*
 * This struct is returned from the 'who_is_on' call.
 */
typedef struct {
	Pers_no		person;
	String		what_am_i_doing;
	Conf_no		working_conference;
} Who_info_old;

typedef struct {
	Pers_no		person;
	String		what_am_i_doing;
	String		username;           /* Userid and hostname. */
	Conf_no		working_conference;
	Session_no	session_no;         /* Serial number of connection. */
} Who_info;

585 586 587 588 589 590 591 592 593 594
typedef struct {
	Pers_no		person;
	String		what_am_i_doing;
	String		username;           /* Userid and hostname. */
	String		ident_user;	     /* According to Ident protocol. */
	String		hostname; 	     /* According to TCP/IP. */
	Conf_no		working_conference;
	Session_no	session_no;         /* Serial number of connection. */
} Who_info_ident;

Per Cederqvist's avatar
.  
Per Cederqvist committed
595 596 597 598 599 600 601
typedef struct {
	Pers_no		person;
	String		what_am_i_doing;
	String		username;            /* Userid and hostname. */
	Conf_no		working_conference;
	Session_no	session;             /* Serial number of connection. */
	Time		connection_time;     /* Not logintime. */
602
	unsigned long		idle_time; 	     /* Seconds. */
Per Cederqvist's avatar
.  
Per Cederqvist committed
603 604
} Session_info;

Per Cederqvist's avatar
Per Cederqvist committed
605 606 607 608 609 610 611 612 613 614 615
typedef struct {
    unsigned int  invisible : 1;
    unsigned int  user_active_used : 1;
    unsigned int  user_absent : 1;
    unsigned int  reserved3 : 1;
    unsigned int  reserved4 : 1;
    unsigned int  reserved5 : 1;
    unsigned int  reserved6 : 1;
    unsigned int  reserved7 : 1;
} Session_flags;
    
616 617 618 619 620
typedef struct {
	Session_no     session;
	Pers_no        person;
	Conf_no        working_conference;
	unsigned long  idle_time;
Per Cederqvist's avatar
Per Cederqvist committed
621
	Session_flags  flags;
622 623 624 625 626 627 628 629 630 631 632 633 634 635
	String         what_am_i_doing;
} Dynamic_session_info;

typedef struct {
	long		          no_of_sessions;
    	Dynamic_session_info	* sessions;
} Dynamic_session_info_list;	

typedef struct {
	String  username;
	String  hostname;
	String  ident_user;
	Time    connection_time;
} Static_session_info;
Per Cederqvist's avatar
.  
Per Cederqvist committed
636

637 638 639 640 641 642 643 644 645 646
typedef struct {
	Pers_no		person;
	String		what_am_i_doing;
	String		username;            /* Userid and hostname,
						according to the client. */
	String		ident_user;	     /* According to Ident protocol. */
	String		hostname; 	     /* According to TCP/IP. */
	Conf_no		working_conference;
	Session_no	session;             /* Serial number of connection. */
	Time		connection_time;     /* Not logintime. */
647
	unsigned long		idle_time; 	     /* Seconds. */
648 649
} Session_info_ident;

Per Cederqvist's avatar
.  
Per Cederqvist committed
650 651 652 653 654 655 656 657 658 659 660 661 662

typedef struct {
	int		  no_of_persons;
    	Who_info_old	* info;
} Who_info_list_old;	


typedef struct {
	int		  no_of_persons;
    	Who_info	* info;
} Who_info_list;	


663 664 665 666 667
typedef struct {
	int		  no_of_persons;
    	Who_info_ident	* info;
} Who_info_ident_list;

668 669 670 671 672 673
typedef struct {
        unsigned long protocol_version;
        String        server_name;
        String        server_version;
} Version_info;

674 675 676 677 678 679 680 681 682 683 684 685 686 687 688
#ifdef DEBUG_CALLS
typedef struct {
    int arena;
    int ordblks;
    int smblks;
    int hblks;
    int hblkhd;
    int usmblks;
    int fsmblks;
    int uordblks;
    int fordblks;
    int keepcost;
} Memory_info;
#endif

689 690 691
#ifdef SERVER
typedef struct {
        unsigned long protocol_version;
692 693
        const char *server_name;
        const char *server_version;
694 695 696
} Version_info_internal;
#endif

Per Cederqvist's avatar
.  
Per Cederqvist committed
697
#endif	/*  ifndef  KOM_TYPES_H_ALREADY_INCLUDED__  */