/[svn]/ircd-hybrid-7.2/include/irc_reslib.h
ViewVC logotype

Contents of /ircd-hybrid-7.2/include/irc_reslib.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 34 - (show annotations)
Sun Oct 2 21:05:51 2005 UTC (14 years ago) by lusky
File MIME type: text/x-csrc
File size: 1689 byte(s)
create 7.2 branch, we can move/rename it as needed.


1 /*
2 * include/irc_reslib.h (C)opyright 1992 Darren Reed.
3 *
4 * $Id$
5 */
6 #ifndef INCLUDED_ircdreslib_h
7 #define INCLUDED_ircdreslib_h
8
9 /*
10 * Inline versions of get/put short/long. Pointer is advanced.
11 */
12 #define IRC_NS_GET16(s, cp) { \
13 const unsigned char *t_cp = (const unsigned char *)(cp); \
14 (s) = ((u_int16_t)t_cp[0] << 8) \
15 | ((u_int16_t)t_cp[1]) \
16 ; \
17 (cp) += NS_INT16SZ; \
18 }
19
20 #define IRC_NS_GET32(l, cp) { \
21 const unsigned char *t_cp = (const unsigned char *)(cp); \
22 (l) = ((u_int32_t)t_cp[0] << 24) \
23 | ((u_int32_t)t_cp[1] << 16) \
24 | ((u_int32_t)t_cp[2] << 8) \
25 | ((u_int32_t)t_cp[3]) \
26 ; \
27 (cp) += NS_INT32SZ; \
28 }
29
30 #define IRC_NS_PUT16(s, cp) { \
31 u_int16_t t_s = (u_int16_t)(s); \
32 unsigned char *t_cp = (unsigned char *)(cp); \
33 *t_cp++ = t_s >> 8; \
34 *t_cp = t_s; \
35 (cp) += NS_INT16SZ; \
36 }
37
38 #define IRC_NS_PUT32(l, cp) { \
39 u_int32_t t_l = (u_int32_t)(l); \
40 unsigned char *t_cp = (unsigned char *)(cp); \
41 *t_cp++ = t_l >> 24; \
42 *t_cp++ = t_l >> 16; \
43 *t_cp++ = t_l >> 8; \
44 *t_cp = t_l; \
45 (cp) += NS_INT32SZ; \
46 }
47
48 extern int irc_res_init(void);
49 extern int irc_dn_expand(const unsigned char *msg, const unsigned char *eom, const unsigned char *src, char *dst, int dstsiz);
50 extern int irc_dn_skipname(const unsigned char *ptr, const unsigned char *eom);
51 extern unsigned int irc_ns_get16(const unsigned char *src);
52 extern unsigned long irc_ns_get32(const unsigned char *src);
53 extern void irc_ns_put16(unsigned int src, unsigned char *dst);
54 extern void irc_ns_put32(unsigned long src, unsigned char *dst);
55 extern int irc_res_mkquery(const char *dname, int class, int type, unsigned char *buf, int buflen);
56 #endif /* INCLUDED_res_h */
57

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.26