1/* 2 * 3 * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) 4 * All rights reserved. See COPYRIGHT. 5 */ 6 7#ifdef HAVE_CONFIG_H 8#include "config.h" 9#endif /* HAVE_CONFIG_H */ 10 11#include <stdio.h> 12#include <stdlib.h> 13#include <arpa/inet.h> 14 15#include <atalk/dsi.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_data.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