~ubuntu-branches/ubuntu/precise/netatalk/precise

« back to all changes in this revision

Viewing changes to libatalk/asp/asp_tickle.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Rittau
  • Date: 2004-01-19 12:43:49 UTC
  • Revision ID: james.westby@ubuntu.com-20040119124349-es563jbp0hk0ae51
Tags: upstream-1.6.4
ImportĀ upstreamĀ versionĀ 1.6.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: asp_tickle.c,v 1.6 2002/01/04 04:45:48 sibaz Exp $
 
3
 */
 
4
 
 
5
#ifdef HAVE_CONFIG_H
 
6
#include "config.h"
 
7
#endif /* HAVE_CONFIG_H */
 
8
 
 
9
#include <string.h>
 
10
#include <atalk/logger.h>
 
11
#ifdef HAVE_SYS_TYPES_H
 
12
#include <sys/types.h>
 
13
#endif /* HAVE_SYS_TYPES_H */
 
14
#include <errno.h>
 
15
 
 
16
#include <sys/socket.h>
 
17
#include <atalk/atp.h>
 
18
#include <atalk/asp.h>
 
19
 
 
20
/* send off a tickle */
 
21
void asp_tickle(ASP asp, const u_int8_t sid, struct sockaddr_at *sat)
 
22
{
 
23
  struct atp_block atpb;
 
24
  char buf[ASP_HDRSIZ];
 
25
 
 
26
  buf[ 0 ] = ASPFUNC_TICKLE;
 
27
  buf[ 1 ] = sid;
 
28
  buf[ 2 ] = buf[ 3 ] = 0;
 
29
 
 
30
  atpb.atp_saddr = sat;
 
31
  atpb.atp_sreqdata = buf;
 
32
  atpb.atp_sreqdlen = sizeof(buf);
 
33
  atpb.atp_sreqto = 0;
 
34
  atpb.atp_sreqtries = 1;
 
35
  if ( atp_sreq( asp->asp_atp, &atpb, 0, 0 ) < 0 ) {
 
36
    LOG(log_error, logtype_default, "atp_sreq: %s", strerror(errno) );
 
37
  }
 
38
}