OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [userland/] [route/] [lib/] [ddp.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 745 simons
/*
2
 *              DDP protocol output functions.
3
 *              [Not yet input]
4
 *
5
 *                      Alan Cox  <Alan.Cox@linux.org>
6
 *
7
 *              $Id: ddp.c,v 1.1 2002-03-17 19:58:53 simons Exp $
8
 *
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.
14
 */
15
#include "config.h"
16
 
17
#if HAVE_AFATALK
18
#include <asm/types.h>
19
#include <sys/types.h>
20
#include <sys/socket.h>
21
#include <linux/atalk.h>
22
#include <stdlib.h>
23
#include <stdio.h>
24
#include <errno.h>
25
#include <ctype.h>
26
#include <string.h>
27
#include <unistd.h>
28
#include <netinet/in.h>
29
#include "net-support.h"
30
#include "pathnames.h"
31
#include "intl.h"
32
#include "util.h"
33
 
34
/* Display a ddp domain address. */
35
static char *ddp_print(unsigned char *ptr)
36
{
37
    static char buff[64];
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);
40
    return (buff);
41
}
42
 
43
 
44
/* Display a ddp domain address. */
45
static char *ddp_sprint(struct sockaddr *sap, int numeric)
46
{
47
    static char buf[64];
48
 
49
    if (sap->sa_family != AF_APPLETALK)
50
        return safe_strncpy(buf, _("[NONE SET]"), sizeof(buf));
51
    return (ddp_print(sap->sa_data));
52
}
53
 
54
 
55
struct aftype ddp_aftype =
56
{
57
    "ddp", NULL, /*"Appletalk DDP", */ AF_APPLETALK, 0,
58
    ddp_print, ddp_sprint, NULL, NULL,
59
    NULL /*DDP_rprint */ , NULL, NULL,
60
    -1,
61
    "/proc/net/appletalk"
62
};
63
 
64
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.