File: objects.h

package info (click to toggle)
spread 3.17.3-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,748 kB
  • ctags: 2,313
  • sloc: ansic: 15,627; sh: 2,591; java: 2,290; perl: 556; yacc: 523; makefile: 240; lex: 204; xml: 77
file content (150 lines) | stat: -rw-r--r-- 5,138 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
 * The Spread Toolkit.
 *     
 * The contents of this file are subject to the Spread Open-Source
 * License, Version 1.0 (the ``License''); you may not use
 * this file except in compliance with the License.  You may obtain a
 * copy of the License at:
 *
 * http://www.spread.org/license/
 *
 * or in the file ``license.txt'' found in this distribution.
 *
 * Software distributed under the License is distributed on an AS IS basis, 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
 * for the specific language governing rights and limitations under the 
 * License.
 *
 * The Creators of Spread are:
 *  Yair Amir, Michal Miskin-Amir, Jonathan Stanton.
 *
 *  Copyright (C) 1993-2004 Spread Concepts LLC <spread@spreadconcepts.com>
 *
 *  All Rights Reserved.
 *
 * Major Contributor(s):
 * ---------------
 *    Cristina Nita-Rotaru crisn@cs.purdue.edu - group communication security.
 *    Theo Schlossnagle    jesus@omniti.com - Perl, skiplists, autoconf.
 *    Dan Schoenblum       dansch@cnds.jhu.edu - Java interface.
 *    John Schultz         jschultz@cnds.jhu.edu - contribution to process group membership.
 *
 */


/* objects.h 
 *  main declarations of objects
 * Copyright 1997 Jonathan Stanton <jonathan@cs.jhu.edu> 
 * Center for Networking and Distributed Systems
 *
 * $Id: objects.h,v 1.6 2004/03/05 00:32:46 jonathan Exp $
 *
 */

#ifndef OBJECTS_H
#define OBJECTS_H

#include "arch.h"
#include "spread_params.h"      /* For SPREAD_PROTOCOL used in memory.c */

#define MAX_OBJECTS             200
#define MAX_OBJ_USED            54

/* Object types 
 *
 * Object types must start with 1 and go up. 0 is reserved 
 */

#define BASE_OBJ                1
#define PACK_HEAD_OBJ           2       /* net_objs.h */
#define MESSAGE_OBJ             3       /* prot_objs.h */
#define MSG_FRAG_OBJ            4       /* prot_objs.h */
#define RET_REQ_OBJ             5       /* net_objs.h */
#define LINK_ACK_OBJ            6       /* net_objs.h */
#define ARU_UPDATE_OBJ          7       /* prot_objs.h */
#define TOKEN_HEAD_OBJ          8       /* net_objs.h */
#define TOKEN_BODY_OBJ          9       /* net_objs.h */
#define ALIVE_OBJ               10      /* memb_objs.h */
#define JOIN_OBJ                11      /* memb_objs.h */
#define REFER_OBJ               12      /* memb_objs.h */
#define STATETRANS_OBJ          13      /* memb_objs.h */

/* Non-Transmitted objects */
#define SCATTER                 20
#define QUEUE_ELEMENT           21
#define QUEUE                   22
#define RETRANS_ENTRY           23
#define RING_LINK_OBJ           24
#define HOP_LINK_OBJ            25               
#define MESSAGE_LINK            26
#define DOWN_LINK               27
#define TREE_NODE               28
#define MESSAGE_FRAG_LIST       29
#define LBUCKET                 30
#define GROUP                   31
#define MEMBER                  32
#define MSG_LIST_ENTRY          33
#define SESS_SEQ_ENTRY          34
#define TIME_EVENT              35

#define ROUTE_WEIGHTS           36
#define PROF_FUNCT              37
#define QUEUE_SET               38
#define MQUEUE_ELEMENT          39
#define TCP_LINK_OBJ            40
#define MESSAGE_META_OBJ        41

#define PROC_RECORD             42
#define SYS_SCATTER             43
#define STAT_RECORD             44
#define STAT_GROUP              45
#define STAT_REFRECORD          46

#define MEMB_MISSING_SEQENTRY   47
#define MEMB_MISSING_DAEMON     48
#define MEMB_DEPEND_MESSL       49
#define PACKET_BODY		50

#define SESSION_AUTH_INFO       51

#define GROUPS_BUF_LINK         52

/* Special objects */
#define UNKNOWN_OBJ             53      /* This represents an object of undertermined or 
                                         * variable type.  Can only be used when appropriate.
                                         * i.e. when internal structure of object is not accessed.
                                         * This is mainly used with queues
                                         */

#define Is_Pack_Head_Obj( type )        ( (type) == PACK_HEAD_OBJ )
#define Is_Message_Obj( type )          ( (type) == MESSAGE_OBJ )
#define Is_Msg_Frag_Obj( type )         ( (type) == MSG_FRAG_OBJ )
#define Is_Ret_Req_Obj( type )          ( (type) == RET_REQ_OBJ )
#define Is_Link_Ack_Obj( type )         ( (type) == LINK_ACK_OBJ )
#define Is_Aru_Update_Obj( type )              ( (type) == ARU_UPDATE_OBJ )
#define Is_Msg_Meta_Obj( type )         ( (type) == MESSAGE_META_OBJ )
#define Is_Statetrans_Obj( type )         ( (type) == STATETRANS_OBJ )


typedef struct d_obj {
        int32u          obj_type;
        int32           obj_ref_count; /* who is using it before we free it - should not be sent */
} base_obj;


/* Global Functions to manipulate objects */
int     Is_Valid_Object(int32u oid);

char    *Objnum_to_String(int32u obj_type);

int32   Obj_Inc_Refcount(void *obj);
int32   Obj_Dec_Refcount(void *obj);
int32   Obj_Net_SizeP(void *obj);
int32   Obj_Net_SizeT(int32u obj_type);
int32   Obj_SizeP(void * obj);
int32   min32(int32, int32);
int32u  min32u(int32u, int32u);

#endif /* OBJECTS_H */