ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/client.h
(Generate patch)

Comparing:
ircd-hybrid-8/include/client.h (file contents), Revision 1386 by michael, Tue May 1 11:35:46 2012 UTC vs.
ircd-hybrid/trunk/include/client.h (file contents), Revision 1644 by michael, Tue Nov 6 22:20:16 2012 UTC

# Line 35 | Line 35
35   #include "dbuf.h"
36   #include "channel.h"
37  
38 #define HOSTIPLEN       53 /* sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255.ipv6") */
39 #define PASSWDLEN       20
40 #define IDLEN           12 /* this is the maximum length, not the actual
41                              generated length; DO NOT CHANGE! */
42
43 /*
44 * pre declare structs
45 */
46 struct AccessItem;
47 struct Listener;
48 struct Client;
49 struct LocalUser;
50
51
38  
39   /*! \brief addr_mask_type enumeration */
40   enum addr_mask_type
# Line 63 | Line 49 | struct Server
49   {
50    dlink_list server_list; /**< Servers on this server */
51    dlink_list client_list; /**< Clients on this server */
52 <  char by[NICKLEN];       /**< who activated this connection */
52 >  char by[NICKLEN + 1];   /**< who activated this connection */
53   };
54  
55   /*! \brief ListTask structure */
# Line 81 | Line 67 | struct ListTask
67    unsigned int topicts_max;
68   };
69  
84 /*! \brief Client structure */
85 struct Client
86 {
87  dlink_node node;
88  dlink_node lnode;             /**< Used for Server->servers/users */
89
90  struct LocalUser *localClient;
91  struct Client    *hnext;      /**< For client hash table lookups by name */
92  struct Client    *idhnext;    /**< For SID hash table lookups by sid */
93  struct Server    *serv;       /**< ...defined, if this is a server */
94  struct Client    *servptr;    /**< Points to server this Client is on */
95  struct Client    *from;       /**< == self, if Local Client, *NEVER* NULL! */
96  char             *away;       /**< Client's AWAY message. Can be set/unset via AWAY command */
97
98  time_t            tsinfo;     /**< TS on the nick, SVINFO on server */
99  time_t            servicestamp; /**< Last time client has been identified for its nick */
100
101  unsigned int      flags;      /**< client flags */
102  unsigned int      umodes;     /**< opers, normal users subset */
103  unsigned int      hopcount;   /**< number of servers to this 0 = local */
104  unsigned int      status;     /**< Client type */
105  unsigned int      handler;    /**< Handler index */
106
107  dlink_list        whowas;
108  dlink_list        channel;   /**< chain of channel pointer blocks */
109
110  char name[HOSTLEN + 1]; /**< unique name for a client nick or host */
111  char id[IDLEN + 1];       /**< client ID, unique ID per client */
112
113  /*
114   * client->username is the username from ident or the USER message,
115   * If the client is idented the USER message is ignored, otherwise
116   * the username part of the USER message is put here prefixed with a
117   * tilde depending on the auth{} block. Once a client has registered,
118   * this field should be considered read-only.
119   */
120  char              username[USERLEN + 1]; /* client's username */
121
122  /*
123   * client->host contains the resolved name or ip address
124   * as a string for the user, it may be fiddled with for oper spoofing etc.
125   * once it's changed the *real* address goes away. This should be
126   * considered a read-only field after the client has registered.
127   */
128  char              host[HOSTLEN + 1];     /* client's hostname */
129
130  /*
131   * client->info for unix clients will normally contain the info from the
132   * gcos field in /etc/passwd but anything can go here.
133   */
134  char              info[REALLEN + 1]; /* Free form additional client info */
135
136  /*
137   * client->sockhost contains the ip address gotten from the socket as a
138   * string, this field should be considered read-only once the connection
139   * has been made. (set in s_bsd.c only)
140   */
141  char              sockhost[HOSTIPLEN + 1]; /* This is the host name from the
142                                                socket ip address as string */
143 };
144
70   /*! \brief LocalUser structure
71   *
72   * Allocated only for local clients, that are directly connected
# Line 168 | Line 93 | struct LocalUser
93    time_t       firsttime;  /**< time client was created */
94    time_t       since;      /**< last time we parsed something */
95    time_t       last_knock;    /**< time of last knock */
171  time_t       last_away; /**< Away since... */
96    time_t       last_join_time;   /**< when this client last
97                                      joined a channel */
98    time_t       last_leave_time;  /**< when this client last
# Line 177 | Line 101 | struct LocalUser
101                                           MIN_JOIN_LEAVE_TIME seconds */
102    int          oper_warn_count_down; /**< warn opers of this possible
103                                            spambot every time this gets to 0 */
180  time_t       reject_delay;
104    time_t       last_caller_id_time;
105    time_t       first_received_message_time;
106    time_t       last_nick_change;
107    time_t       last_privmsg; /**< Last time we got a PRIVMSG */
108 +  time_t       last_away; /**< Away since... */
109  
110    int          received_number_of_privmsgs;
111    unsigned int number_of_nick_changes;
# Line 220 | Line 144 | struct LocalUser
144    char*          auth_oper; /**< Operator to become if they supply the response.*/
145   };
146  
147 + /*! \brief Client structure */
148 + struct Client
149 + {
150 +  dlink_node node;
151 +  dlink_node lnode;             /**< Used for Server->servers/users */
152 +
153 +  struct LocalUser *localClient;
154 +  struct Client    *hnext;      /**< For client hash table lookups by name */
155 +  struct Client    *idhnext;    /**< For SID hash table lookups by sid */
156 +  struct Server    *serv;       /**< ...defined, if this is a server */
157 +  struct Client    *servptr;    /**< Points to server this Client is on */
158 +  struct Client    *from;       /**< == self, if Local Client, *NEVER* NULL! */
159 +
160 +  time_t            tsinfo;     /**< TS on the nick, SVINFO on server */
161 +
162 +  unsigned int      flags;      /**< client flags */
163 +  unsigned int      umodes;     /**< opers, normal users subset */
164 +  unsigned int      hopcount;   /**< number of servers to this 0 = local */
165 +  unsigned int      status;     /**< Client type */
166 +  unsigned int      handler;    /**< Handler index */
167 +
168 +  dlink_list        whowas;
169 +  dlink_list        channel;   /**< chain of channel pointer blocks */
170 +
171 +  char away[AWAYLEN + 1]; /**< Client's AWAY message. Can be set/unset via AWAY command */
172 +  char name[HOSTLEN + 1]; /**< unique name for a client nick or host */
173 +  char svid[HOSTLEN + 1]; /**< Services ID. XXX: Going with HOSTLEN for now. NICKLEN might be too small
174 +                                if dealing with timestamps */
175 +  char id[IDLEN + 1];       /**< client ID, unique ID per client */
176 +  /*
177 +   * client->username is the username from ident or the USER message,
178 +   * If the client is idented the USER message is ignored, otherwise
179 +   * the username part of the USER message is put here prefixed with a
180 +   * tilde depending on the auth{} block. Once a client has registered,
181 +   * this field should be considered read-only.
182 +   */
183 +  char              username[USERLEN + 1]; /* client's username */
184 +
185 +  /*
186 +   * client->host contains the resolved name or ip address
187 +   * as a string for the user, it may be fiddled with for oper spoofing etc.
188 +   * once it's changed the *real* address goes away. This should be
189 +   * considered a read-only field after the client has registered.
190 +   */
191 +  char              host[HOSTLEN + 1];     /* client's hostname */
192 +
193 +  /*
194 +   * client->info for unix clients will normally contain the info from the
195 +   * gcos field in /etc/passwd but anything can go here.
196 +   */
197 +  char              info[REALLEN + 1]; /* Free form additional client info */
198 +
199 +  /*
200 +   * client->sockhost contains the ip address gotten from the socket as a
201 +   * string, this field should be considered read-only once the connection
202 +   * has been made. (set in s_bsd.c only)
203 +   */
204 +  char              sockhost[HOSTIPLEN + 1]; /* This is the host name from the
205 +                                                socket ip address as string */
206 + };
207 +
208   /*
209   * status macros.
210   */
# Line 307 | Line 292 | struct LocalUser
292   #define FLAGS_BURSTED       0x00100000 /**< user was already bursted */
293   #define FLAGS_EXEMPTRESV    0x00200000 /**< client is exempt from RESV */
294   #define FLAGS_GOTUSER       0x00400000 /**< if we received a USER command */
295 < #define FLAGS_PINGWARNING   0x00800000 /**< unreplied ping warning already sent */
296 < #define FLAGS_FINISHED_AUTH 0x01000000 /**< Client has been released from auth */
297 < #define FLAGS_FLOOD_NOTICED 0x02000000 /**< Notice to opers about this flooder has been sent */
313 < #define FLAGS_SERVICE       0x04000000 /**< Client/server is a network service */
295 > #define FLAGS_FINISHED_AUTH 0x00800000 /**< Client has been released from auth */
296 > #define FLAGS_FLOOD_NOTICED 0x01000000 /**< Notice to opers about this flooder has been sent */
297 > #define FLAGS_SERVICE       0x02000000 /**< Client/server is a network service */
298  
299   #define HasFlag(x, y) ((x)->flags &   (y))
300   #define AddFlag(x, y) ((x)->flags |=  (y))
# Line 350 | Line 334 | struct LocalUser
334   #define AddUMode(x, y) ((x)->umodes |=  (y))
335   #define DelUMode(x, y) ((x)->umodes &= ~(y))
336  
337 < #define SEND_UMODES  (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \
338 <                      UMODE_REGISTERED | UMODE_ADMIN | UMODE_HIDDEN)
337 > #define SEND_UMODES  (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP |\
338 >                      UMODE_REGONLY | UMODE_REGISTERED | UMODE_ADMIN |\
339 >                      UMODE_HIDDEN)
340  
341  
342  
# Line 374 | Line 359 | struct LocalUser
359   #define OPER_FLAG_RESTART      0x00008000 /**< Oper can use RESTART command */
360   #define OPER_FLAG_DLINE        0x00010000 /**< Oper can use DLINE command   */
361   #define OPER_FLAG_UNDLINE      0x00020000 /**< Oper can use UNDLINE command */
362 + #define OPER_FLAG_SET          0x00040000 /**< Oper can use SET command */
363  
364   #define HasOFlag(x, y) (MyConnect(x) ? (x)->localClient->operflags & (y) : 0)
365   #define AddOFlag(x, y) ((x)->localClient->operflags |=  (y))
# Line 418 | Line 404 | struct LocalUser
404   #define IsPingSent(x)           ((x)->flags & FLAGS_PINGSENT)
405   #define ClearPingSent(x)        ((x)->flags &= ~FLAGS_PINGSENT)
406  
421 #define SetPingWarning(x)       ((x)->flags |= FLAGS_PINGWARNING)
422 #define IsPingWarning(x)        ((x)->flags & FLAGS_PINGWARNING)
423 #define ClearPingWarning(x)     ((x)->flags &= ~FLAGS_PINGWARNING)
424
407   #define SetNeedId(x)            ((x)->flags |= FLAGS_NEEDID)
408   #define IsNeedId(x)             ((x)->flags & FLAGS_NEEDID)
409  
# Line 450 | Line 432 | struct LocalUser
432   #define SetSendqBlocked(x)      ((x)->flags |= FLAGS_BLOCKED)
433   #define ClearSendqBlocked(x)    ((x)->flags &= ~FLAGS_BLOCKED)
434  
453 #define IsCaptured(x)           ((x)->handler == DUMMY_HANDLER)
454 #define SetCaptured(x)          ((x)->handler = DUMMY_HANDLER)
455 #define ClearCaptured(x)        ((x)->handler = CLIENT_HANDLER)
456
435  
436   extern struct Client me;
437   extern dlink_list listing_client_list;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)