1 /* struct_servermsg.h - NextIRCd
2 * Copyright (C) 2012-2013 Philipp Kreil (pk910)
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef _struct_servermsg_h
19 #define _struct_servermsg_h
21 #define MAXSERVERTOKENLEN 5
23 #define SERVERMSG_TYPE_UNICAST 0x01
24 #define SERVERMSG_TYPE_MULTICAST 0x02
25 #define SERVERMSG_TYPE_BROADCAST 0x03
26 #define SERVERMSG_TYPEMASK 0x07
27 #define SERVERMSG_FLAG_ENCRYPTED 0x08
28 #define SERVERMSG_FLAGMASK 0xF8
30 struct ServerMsgDestination {
32 struct Server *server;
35 unsigned int resolved_destination : 1;
38 struct ServerMsgDstMap {
39 unsigned int dstcount : 8;
40 struct ServerMsgDestination dst[1];
45 struct Server *server;
48 unsigned int resolved_source : 1;
50 unsigned int msgtype : 3;
51 unsigned int msgflags : 8;
52 unsigned int msglen : 16;
53 unsigned int arglen : 16;
54 unsigned int msgttl : 8;
56 char token[MAXSERVERTOKENLEN+1];
58 struct ServerMsgDstMap *destinations;