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.
Revision 1484 by michael, Thu Jul 26 18:38:56 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") */
38 > #define HOSTIPLEN       45 /* sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") */
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 –
43  
44   /*! \brief addr_mask_type enumeration */
45   enum addr_mask_type
# Line 63 | Line 54 | struct Server
54   {
55    dlink_list server_list; /**< Servers on this server */
56    dlink_list client_list; /**< Clients on this server */
57 <  char by[NICKLEN];       /**< who activated this connection */
57 >  char by[NICKLEN + 1];   /**< who activated this connection */
58   };
59  
60   /*! \brief ListTask structure */
# Line 81 | Line 72 | struct ListTask
72    unsigned int topicts_max;
73   };
74  
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 –
75   /*! \brief LocalUser structure
76   *
77   * Allocated only for local clients, that are directly connected
# Line 168 | Line 98 | struct LocalUser
98    time_t       firsttime;  /**< time client was created */
99    time_t       since;      /**< last time we parsed something */
100    time_t       last_knock;    /**< time of last knock */
171 –  time_t       last_away; /**< Away since... */
101    time_t       last_join_time;   /**< when this client last
102                                      joined a channel */
103    time_t       last_leave_time;  /**< when this client last
# Line 182 | Line 111 | struct LocalUser
111    time_t       first_received_message_time;
112    time_t       last_nick_change;
113    time_t       last_privmsg; /**< Last time we got a PRIVMSG */
114 +  time_t       last_away; /**< Away since... */
115  
116    int          received_number_of_privmsgs;
117    unsigned int number_of_nick_changes;
# Line 220 | Line 150 | struct LocalUser
150    char*          auth_oper; /**< Operator to become if they supply the response.*/
151   };
152  
153 + /*! \brief Client structure */
154 + struct Client
155 + {
156 +  dlink_node node;
157 +  dlink_node lnode;             /**< Used for Server->servers/users */
158 +
159 +  struct LocalUser *localClient;
160 +  struct Client    *hnext;      /**< For client hash table lookups by name */
161 +  struct Client    *idhnext;    /**< For SID hash table lookups by sid */
162 +  struct Server    *serv;       /**< ...defined, if this is a server */
163 +  struct Client    *servptr;    /**< Points to server this Client is on */
164 +  struct Client    *from;       /**< == self, if Local Client, *NEVER* NULL! */
165 +
166 +  time_t            tsinfo;     /**< TS on the nick, SVINFO on server */
167 +  time_t            servicestamp; /**< Last time client has been identified for its nick */
168 +
169 +  unsigned int      flags;      /**< client flags */
170 +  unsigned int      umodes;     /**< opers, normal users subset */
171 +  unsigned int      hopcount;   /**< number of servers to this 0 = local */
172 +  unsigned int      status;     /**< Client type */
173 +  unsigned int      handler;    /**< Handler index */
174 +
175 +  dlink_list        whowas;
176 +  dlink_list        channel;   /**< chain of channel pointer blocks */
177 +
178 +  char away[AWAYLEN + 1]; /**< Client's AWAY message. Can be set/unset via AWAY command */
179 +  char name[HOSTLEN + 1]; /**< unique name for a client nick or host */
180 +  char id[IDLEN + 1];       /**< client ID, unique ID per client */
181 +
182 +  /*
183 +   * client->username is the username from ident or the USER message,
184 +   * If the client is idented the USER message is ignored, otherwise
185 +   * the username part of the USER message is put here prefixed with a
186 +   * tilde depending on the auth{} block. Once a client has registered,
187 +   * this field should be considered read-only.
188 +   */
189 +  char              username[USERLEN + 1]; /* client's username */
190 +
191 +  /*
192 +   * client->host contains the resolved name or ip address
193 +   * as a string for the user, it may be fiddled with for oper spoofing etc.
194 +   * once it's changed the *real* address goes away. This should be
195 +   * considered a read-only field after the client has registered.
196 +   */
197 +  char              host[HOSTLEN + 1];     /* client's hostname */
198 +
199 +  /*
200 +   * client->info for unix clients will normally contain the info from the
201 +   * gcos field in /etc/passwd but anything can go here.
202 +   */
203 +  char              info[REALLEN + 1]; /* Free form additional client info */
204 +
205 +  /*
206 +   * client->sockhost contains the ip address gotten from the socket as a
207 +   * string, this field should be considered read-only once the connection
208 +   * has been made. (set in s_bsd.c only)
209 +   */
210 +  char              sockhost[HOSTIPLEN + 1]; /* This is the host name from the
211 +                                                socket ip address as string */
212 + };
213 +
214   /*
215   * status macros.
216   */
# Line 350 | Line 341 | struct LocalUser
341   #define AddUMode(x, y) ((x)->umodes |=  (y))
342   #define DelUMode(x, y) ((x)->umodes &= ~(y))
343  
344 < #define SEND_UMODES  (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \
345 <                      UMODE_REGISTERED | UMODE_ADMIN | UMODE_HIDDEN)
344 > #define SEND_UMODES  (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP |\
345 >                      UMODE_REGONLY | UMODE_REGISTERED | UMODE_ADMIN |\
346 >                      UMODE_HIDDEN)
347  
348  
349  
# Line 374 | Line 366 | struct LocalUser
366   #define OPER_FLAG_RESTART      0x00008000 /**< Oper can use RESTART command */
367   #define OPER_FLAG_DLINE        0x00010000 /**< Oper can use DLINE command   */
368   #define OPER_FLAG_UNDLINE      0x00020000 /**< Oper can use UNDLINE command */
369 + #define OPER_FLAG_SET          0x00040000 /**< Oper can use SET command */
370  
371   #define HasOFlag(x, y) (MyConnect(x) ? (x)->localClient->operflags & (y) : 0)
372   #define AddOFlag(x, y) ((x)->localClient->operflags |=  (y))

Diff Legend

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