Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 1 | /* |
| 2 | * UNIX SOCK_STREAM protocol layer (uxst) |
| 3 | * |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 4 | * Copyright 2000-2010 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #include <ctype.h> |
| 14 | #include <errno.h> |
| 15 | #include <fcntl.h> |
| 16 | #include <stdio.h> |
| 17 | #include <stdlib.h> |
| 18 | #include <string.h> |
| 19 | #include <syslog.h> |
| 20 | #include <time.h> |
| 21 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 22 | #include <sys/socket.h> |
| 23 | #include <sys/stat.h> |
| 24 | #include <sys/types.h> |
| 25 | #include <sys/un.h> |
| 26 | |
| 27 | #include <common/compat.h> |
| 28 | #include <common/config.h> |
| 29 | #include <common/debug.h> |
Willy Tarreau | d740bab | 2007-10-28 11:14:07 +0100 | [diff] [blame] | 30 | #include <common/errors.h> |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 31 | #include <common/mini-clist.h> |
| 32 | #include <common/standard.h> |
| 33 | #include <common/time.h> |
| 34 | #include <common/version.h> |
| 35 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 36 | #include <types/global.h> |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 37 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 38 | #include <proto/fd.h> |
| 39 | #include <proto/log.h> |
| 40 | #include <proto/protocols.h> |
| 41 | #include <proto/proto_uxst.h> |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 42 | #include <proto/stream_sock.h> |
| 43 | #include <proto/task.h> |
| 44 | |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 45 | static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen); |
| 46 | static int uxst_bind_listeners(struct protocol *proto, char *errmsg, int errlen); |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 47 | static int uxst_unbind_listeners(struct protocol *proto); |
| 48 | |
| 49 | /* Note: must not be declared <const> as its list will be overwritten */ |
| 50 | static struct protocol proto_unix = { |
| 51 | .name = "unix_stream", |
| 52 | .sock_domain = PF_UNIX, |
| 53 | .sock_type = SOCK_STREAM, |
| 54 | .sock_prot = 0, |
| 55 | .sock_family = AF_UNIX, |
| 56 | .sock_addrlen = sizeof(struct sockaddr_un), |
| 57 | .l3_addrlen = sizeof(((struct sockaddr_un*)0)->sun_path),/* path len */ |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 58 | .accept = &stream_sock_accept, |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 59 | .read = &stream_sock_read, |
| 60 | .write = &stream_sock_write, |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 61 | .bind = uxst_bind_listener, |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 62 | .bind_all = uxst_bind_listeners, |
| 63 | .unbind_all = uxst_unbind_listeners, |
| 64 | .enable_all = enable_all_listeners, |
| 65 | .disable_all = disable_all_listeners, |
| 66 | .listeners = LIST_HEAD_INIT(proto_unix.listeners), |
| 67 | .nb_listeners = 0, |
| 68 | }; |
| 69 | |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 70 | /******************************** |
| 71 | * 1) low-level socket functions |
| 72 | ********************************/ |
| 73 | |
| 74 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 75 | /* This function creates a named PF_UNIX stream socket at address <path>. Note |
Willy Tarreau | e6ad2b1 | 2007-10-18 12:45:54 +0200 | [diff] [blame] | 76 | * that the path cannot be NULL nor empty. <uid> and <gid> different of -1 will |
| 77 | * be used to change the socket owner. If <mode> is not 0, it will be used to |
| 78 | * restrict access to the socket. While it is known not to be portable on every |
| 79 | * OS, it's still useful where it works. |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 80 | * It returns the assigned file descriptor, or -1 in the event of an error. |
| 81 | */ |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 82 | static int create_uxst_socket(const char *path, uid_t uid, gid_t gid, mode_t mode, char *errmsg, int errlen) |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 83 | { |
| 84 | char tempname[MAXPATHLEN]; |
| 85 | char backname[MAXPATHLEN]; |
| 86 | struct sockaddr_un addr; |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 87 | const char *msg = NULL; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 88 | |
| 89 | int ret, sock; |
| 90 | |
| 91 | /* 1. create socket names */ |
| 92 | if (!path[0]) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 93 | msg = "Invalid empty name for a UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 94 | goto err_return; |
| 95 | } |
| 96 | |
| 97 | ret = snprintf(tempname, MAXPATHLEN, "%s.%d.tmp", path, pid); |
| 98 | if (ret < 0 || ret >= MAXPATHLEN) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 99 | msg = "name too long for UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 100 | goto err_return; |
| 101 | } |
| 102 | |
| 103 | ret = snprintf(backname, MAXPATHLEN, "%s.%d.bak", path, pid); |
| 104 | if (ret < 0 || ret >= MAXPATHLEN) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 105 | msg = "name too long for UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 106 | goto err_return; |
| 107 | } |
| 108 | |
| 109 | /* 2. clean existing orphaned entries */ |
| 110 | if (unlink(tempname) < 0 && errno != ENOENT) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 111 | msg = "error when trying to unlink previous UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 112 | goto err_return; |
| 113 | } |
| 114 | |
| 115 | if (unlink(backname) < 0 && errno != ENOENT) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 116 | msg = "error when trying to unlink previous UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 117 | goto err_return; |
| 118 | } |
| 119 | |
| 120 | /* 3. backup existing socket */ |
| 121 | if (link(path, backname) < 0 && errno != ENOENT) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 122 | msg = "error when trying to preserve previous UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 123 | goto err_return; |
| 124 | } |
| 125 | |
| 126 | /* 4. prepare new socket */ |
| 127 | addr.sun_family = AF_UNIX; |
| 128 | strncpy(addr.sun_path, tempname, sizeof(addr.sun_path)); |
| 129 | addr.sun_path[sizeof(addr.sun_path) - 1] = 0; |
| 130 | |
| 131 | sock = socket(PF_UNIX, SOCK_STREAM, 0); |
| 132 | if (sock < 0) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 133 | msg = "cannot create UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 134 | goto err_unlink_back; |
| 135 | } |
| 136 | |
| 137 | if (sock >= global.maxsock) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 138 | msg = "socket(): not enough free sockets, raise -n argument"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 139 | goto err_unlink_temp; |
| 140 | } |
| 141 | |
| 142 | if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 143 | msg = "cannot make UNIX socket non-blocking"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 144 | goto err_unlink_temp; |
| 145 | } |
| 146 | |
| 147 | if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { |
| 148 | /* note that bind() creates the socket <tempname> on the file system */ |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 149 | msg = "cannot bind UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 150 | goto err_unlink_temp; |
| 151 | } |
| 152 | |
Willy Tarreau | e6ad2b1 | 2007-10-18 12:45:54 +0200 | [diff] [blame] | 153 | if (((uid != -1 || gid != -1) && (chown(tempname, uid, gid) == -1)) || |
| 154 | (mode != 0 && chmod(tempname, mode) == -1)) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 155 | msg = "cannot change UNIX socket ownership"; |
Willy Tarreau | e6ad2b1 | 2007-10-18 12:45:54 +0200 | [diff] [blame] | 156 | goto err_unlink_temp; |
| 157 | } |
| 158 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 159 | if (listen(sock, 0) < 0) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 160 | msg = "cannot listen to UNIX socket"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 161 | goto err_unlink_temp; |
| 162 | } |
| 163 | |
| 164 | /* 5. install. |
| 165 | * Point of no return: we are ready, we'll switch the sockets. We don't |
| 166 | * fear loosing the socket <path> because we have a copy of it in |
| 167 | * backname. |
| 168 | */ |
| 169 | if (rename(tempname, path) < 0) { |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 170 | msg = "cannot switch final and temporary UNIX sockets"; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 171 | goto err_rename; |
| 172 | } |
| 173 | |
| 174 | /* 6. cleanup */ |
| 175 | unlink(backname); /* no need to keep this one either */ |
| 176 | |
| 177 | return sock; |
| 178 | |
| 179 | err_rename: |
| 180 | ret = rename(backname, path); |
| 181 | if (ret < 0 && errno == ENOENT) |
| 182 | unlink(path); |
| 183 | err_unlink_temp: |
| 184 | unlink(tempname); |
| 185 | close(sock); |
| 186 | err_unlink_back: |
| 187 | unlink(backname); |
| 188 | err_return: |
Willy Tarreau | b40dc94 | 2010-11-07 12:10:51 +0100 | [diff] [blame] | 189 | if (msg && errlen) |
| 190 | snprintf(errmsg, errlen, "%s [%s]", msg, path); |
| 191 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 192 | return -1; |
| 193 | } |
| 194 | |
| 195 | /* Tries to destroy the UNIX stream socket <path>. The socket must not be used |
| 196 | * anymore. It practises best effort, and no error is returned. |
| 197 | */ |
| 198 | static void destroy_uxst_socket(const char *path) |
| 199 | { |
| 200 | struct sockaddr_un addr; |
| 201 | int sock, ret; |
| 202 | |
| 203 | /* We might have been chrooted, so we may not be able to access the |
| 204 | * socket. In order to avoid bothering the other end, we connect with a |
| 205 | * wrong protocol, namely SOCK_DGRAM. The return code from connect() |
| 206 | * is enough to know if the socket is still live or not. If it's live |
| 207 | * in mode SOCK_STREAM, we get EPROTOTYPE or anything else but not |
| 208 | * ECONNREFUSED. In this case, we do not touch it because it's used |
| 209 | * by some other process. |
| 210 | */ |
| 211 | sock = socket(PF_UNIX, SOCK_DGRAM, 0); |
| 212 | if (sock < 0) |
| 213 | return; |
| 214 | |
| 215 | addr.sun_family = AF_UNIX; |
| 216 | strncpy(addr.sun_path, path, sizeof(addr.sun_path)); |
Willy Tarreau | 10ae548 | 2007-10-18 16:15:52 +0200 | [diff] [blame] | 217 | addr.sun_path[sizeof(addr.sun_path) - 1] = 0; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 218 | ret = connect(sock, (struct sockaddr *)&addr, sizeof(addr)); |
| 219 | if (ret < 0 && errno == ECONNREFUSED) { |
| 220 | /* Connect failed: the socket still exists but is not used |
| 221 | * anymore. Let's remove this socket now. |
| 222 | */ |
| 223 | unlink(path); |
| 224 | } |
| 225 | close(sock); |
| 226 | } |
| 227 | |
| 228 | |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 229 | /******************************** |
| 230 | * 2) listener-oriented functions |
| 231 | ********************************/ |
| 232 | |
| 233 | |
| 234 | /* This function creates the UNIX socket associated to the listener. It changes |
| 235 | * the state from ASSIGNED to LISTEN. The socket is NOT enabled for polling. |
| 236 | * The return value is composed from ERR_NONE, ERR_RETRYABLE and ERR_FATAL. |
| 237 | */ |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 238 | static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen) |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 239 | { |
| 240 | int fd; |
Willy Tarreau | b1356cf | 2008-12-07 16:06:43 +0100 | [diff] [blame] | 241 | |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 242 | /* ensure we never return garbage */ |
| 243 | if (errmsg && errlen) |
| 244 | *errmsg = 0; |
| 245 | |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 246 | if (listener->state != LI_ASSIGNED) |
| 247 | return ERR_NONE; /* already bound */ |
| 248 | |
| 249 | fd = create_uxst_socket(((struct sockaddr_un *)&listener->addr)->sun_path, |
| 250 | listener->perm.ux.uid, |
| 251 | listener->perm.ux.gid, |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 252 | listener->perm.ux.mode, errmsg, errlen); |
| 253 | if (fd == -1) { |
| 254 | return ERR_FATAL | ERR_ALERT; |
| 255 | } |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 256 | /* the socket is now listening */ |
| 257 | listener->fd = fd; |
| 258 | listener->state = LI_LISTEN; |
| 259 | |
| 260 | /* the function for the accept() event */ |
| 261 | fd_insert(fd); |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 262 | fdtab[fd].cb[DIR_RD].f = listener->proto->accept; |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 263 | fdtab[fd].cb[DIR_WR].f = NULL; /* never called */ |
| 264 | fdtab[fd].cb[DIR_RD].b = fdtab[fd].cb[DIR_WR].b = NULL; |
Willy Tarreau | eabf313 | 2008-08-29 23:36:51 +0200 | [diff] [blame] | 265 | fdtab[fd].owner = listener; /* reference the listener instead of a task */ |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 266 | fdtab[fd].state = FD_STLISTEN; |
Willy Tarreau | 8d5d77e | 2009-10-18 07:25:52 +0200 | [diff] [blame] | 267 | fdinfo[fd].peeraddr = NULL; |
| 268 | fdinfo[fd].peerlen = 0; |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 269 | return ERR_NONE; |
| 270 | } |
| 271 | |
| 272 | /* This function closes the UNIX sockets for the specified listener. |
| 273 | * The listener enters the LI_ASSIGNED state. It always returns ERR_NONE. |
| 274 | */ |
| 275 | static int uxst_unbind_listener(struct listener *listener) |
| 276 | { |
| 277 | if (listener->state == LI_READY) |
| 278 | EV_FD_CLR(listener->fd, DIR_RD); |
| 279 | |
| 280 | if (listener->state >= LI_LISTEN) { |
Willy Tarreau | 8eebe5e | 2007-10-28 22:07:08 +0100 | [diff] [blame] | 281 | fd_delete(listener->fd); |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 282 | listener->state = LI_ASSIGNED; |
| 283 | destroy_uxst_socket(((struct sockaddr_un *)&listener->addr)->sun_path); |
| 284 | } |
| 285 | return ERR_NONE; |
| 286 | } |
| 287 | |
| 288 | /* Add a listener to the list of unix stream listeners. The listener's state |
| 289 | * is automatically updated from LI_INIT to LI_ASSIGNED. The number of |
| 290 | * listeners is updated. This is the function to use to add a new listener. |
| 291 | */ |
| 292 | void uxst_add_listener(struct listener *listener) |
| 293 | { |
| 294 | if (listener->state != LI_INIT) |
| 295 | return; |
| 296 | listener->state = LI_ASSIGNED; |
| 297 | listener->proto = &proto_unix; |
| 298 | LIST_ADDQ(&proto_unix.listeners, &listener->proto_list); |
| 299 | proto_unix.nb_listeners++; |
| 300 | } |
| 301 | |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 302 | /******************************** |
| 303 | * 3) protocol-oriented functions |
| 304 | ********************************/ |
| 305 | |
| 306 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 307 | /* This function creates all UNIX sockets bound to the protocol entry <proto>. |
| 308 | * It is intended to be used as the protocol's bind_all() function. |
| 309 | * The sockets will be registered but not added to any fd_set, in order not to |
| 310 | * loose them across the fork(). A call to uxst_enable_listeners() is needed |
| 311 | * to complete initialization. |
| 312 | * |
| 313 | * The return value is composed from ERR_NONE, ERR_RETRYABLE and ERR_FATAL. |
| 314 | */ |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 315 | static int uxst_bind_listeners(struct protocol *proto, char *errmsg, int errlen) |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 316 | { |
| 317 | struct listener *listener; |
| 318 | int err = ERR_NONE; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 319 | |
| 320 | list_for_each_entry(listener, &proto->listeners, proto_list) { |
Emeric Brun | cf20bf1 | 2010-10-22 16:06:11 +0200 | [diff] [blame] | 321 | err |= uxst_bind_listener(listener, errmsg, errlen); |
| 322 | if (err & ERR_ABORT) |
| 323 | break; |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 324 | } |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 325 | return err; |
| 326 | } |
| 327 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 328 | |
| 329 | /* This function stops all listening UNIX sockets bound to the protocol |
| 330 | * <proto>. It does not detaches them from the protocol. |
| 331 | * It always returns ERR_NONE. |
| 332 | */ |
| 333 | static int uxst_unbind_listeners(struct protocol *proto) |
| 334 | { |
| 335 | struct listener *listener; |
| 336 | |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 337 | list_for_each_entry(listener, &proto->listeners, proto_list) |
| 338 | uxst_unbind_listener(listener); |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 339 | return ERR_NONE; |
| 340 | } |
| 341 | |
Willy Tarreau | dabf2e2 | 2007-10-28 21:59:24 +0100 | [diff] [blame] | 342 | |
| 343 | /******************************** |
| 344 | * 4) high-level functions |
| 345 | ********************************/ |
| 346 | |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 347 | __attribute__((constructor)) |
| 348 | static void __uxst_protocol_init(void) |
| 349 | { |
| 350 | protocol_register(&proto_unix); |
Willy Tarreau | 92fb983 | 2007-10-16 17:34:28 +0200 | [diff] [blame] | 351 | } |
| 352 | |
| 353 | |
| 354 | /* |
| 355 | * Local variables: |
| 356 | * c-indent-level: 8 |
| 357 | * c-basic-offset: 8 |
| 358 | * End: |
| 359 | */ |