2 * DDP protocol output functions.
5 * Alan Cox <Alan.Cox@linux.org>
7 * $Id: ddp.c,v 1.6 1998/11/19 13:01:55 philip Exp $
9 * This program is free software; you can redistribute it
10 * and/or modify it under the terms of the GNU General
11 * Public License as published by the Free Software
12 * Foundation; either version 2 of the License, or (at
13 * your option) any later version.
18 #include <asm/types.h>
19 #include <sys/types.h>
20 #include <sys/socket.h>
21 #include <linux/atalk.h>
28 #include <netinet/in.h>
29 #include "net-support.h"
30 #include "pathnames.h"
34 /* Display a ddp domain address. */
35 static char *ddp_print(unsigned char *ptr
)
38 struct sockaddr_at
*sat
= (struct sockaddr_at
*) (ptr
- 2);
39 sprintf(buff
, "%d/%d", (int) ntohs(sat
->sat_addr
.s_net
), (int) sat
->sat_addr
.s_node
);
44 /* Display a ddp domain address. */
45 static char *ddp_sprint(struct sockaddr
*sap
, int numeric
)
49 if (sap
->sa_family
!= AF_APPLETALK
)
50 return safe_strncpy(buf
, _("[NONE SET]"), sizeof(buf
));
51 return (ddp_print(sap
->sa_data
));
55 struct aftype ddp_aftype
=
57 "ddp", NULL
, /*"Appletalk DDP", */ AF_APPLETALK
, 0,
58 ddp_print
, ddp_sprint
, NULL
, NULL
,
59 NULL
/*DDP_rprint */ , NULL
, NULL
,