]> arthur.barton.de Git - netatalk.git/blob - libatalk/dsi/dsi_cmdreply.c
support for function 0x7a
[netatalk.git] / libatalk / dsi / dsi_cmdreply.c
1 /*
2  * $Id: dsi_cmdreply.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
3  *
4  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
5  * All rights reserved. See COPYRIGHT.
6  */
7
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif /* HAVE_CONFIG_H */
11
12 #include <stdio.h>
13 #include <atalk/dsi.h>
14 #include <netatalk/endian.h>
15
16 /* this assumes that the reply follows right after the command, saving
17  * on a couple assignments. specifically, command, requestID, and
18  * reserved field are assumed to already be set. */ 
19 int dsi_cmdreply(DSI *dsi, const int err)
20 {
21   dsi->header.dsi_flags = DSIFL_REPLY;
22   /*dsi->header.dsi_command = DSIFUNC_CMD;*/
23   dsi->header.dsi_len = htonl(dsi->datalen);
24   dsi->header.dsi_code = htonl(err);
25
26   return dsi_stream_send(dsi, dsi->data, dsi->datalen);
27 }