2 * $Id: dsi_tickle.c,v 1.4 2002-12-04 10:59:37 didg Exp $
4 * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
5 * All rights reserved. See COPYRIGHT.
10 #endif /* HAVE_CONFIG_H */
13 #include <sys/types.h>
17 #include <atalk/dsi.h>
18 #include <netatalk/endian.h>
20 /* server generated tickles. as this is only called by the tickle handler,
21 * we don't need to block signals. well, actually, we might get it during
23 int dsi_tickle(DSI *dsi)
25 char block[DSI_BLOCKSIZ];
30 id = htons(dsi_serverID(dsi));
32 memset(block, 0, sizeof(block));
33 block[0] = DSIFL_REQUEST;
34 block[1] = DSIFUNC_TICKLE;
35 memcpy(block + 2, &id, sizeof(id));
36 /* code = len = reserved = 0 */
38 sigprocmask(SIG_BLOCK, &dsi->sigblockset, &oldset);
39 ret = dsi_stream_write(dsi, block, DSI_BLOCKSIZ) == DSI_BLOCKSIZ;
40 sigprocmask(SIG_SETMASK, &oldset, NULL);