1/* 2 * $Id: dsi_close.c,v 1.4 2003-03-12 15:07:06 didg 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 <stdlib.h> 14#include <atalk/dsi.h> 15#include <netatalk/endian.h> 16 17void dsi_close(DSI *dsi) 18{ 19 /* server generated. need to set all the fields. */ 20 if (!(dsi->flags & DSI_SLEEPING) && !(dsi->flags & DSI_DISCONNECTED)) { 21 dsi->header.dsi_flags = DSIFL_REQUEST; 22 dsi->header.dsi_command = DSIFUNC_CLOSE; 23 dsi->header.dsi_requestID = htons(dsi_serverID(dsi)); 24 dsi->header.dsi_code = dsi->header.dsi_reserved = htonl(0); 25 dsi->cmdlen = 0; 26 dsi_send(dsi); 27 dsi->proto_close(dsi); 28 } 29 free(dsi); 30} 31