Deleted Added
sdiff udiff text old ( 118175 ) new ( 121816 )
full compact
1/*
2 * Copyright (c) 2001-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 16 unchanged lines hidden (view full) ---

25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * Netgraph module to connect NATM interfaces to netgraph.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/netgraph/atm/ng_atm.c 121816 2003-10-31 18:32:15Z brooks $");
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/kernel.h>
38#include <sys/malloc.h>
39#include <sys/mbuf.h>
40#include <sys/errno.h>
41#include <sys/syslog.h>

--- 819 unchanged lines hidden (view full) ---

861 const char *vendor;
862 } devices[] = {
863 ATM_DEVICE_NAMES
864 };
865
866 mib = (const struct ifatm_mib *)(priv->ifp->if_linkmib);
867
868 sbuf_new(&sbuf, arg, len, SBUF_FIXEDLEN);
869 sbuf_printf(&sbuf, "interface: %s\n", priv->ifp->if_xname);
870
871 if (mib->device >= sizeof(devices) / sizeof(devices[0]))
872 sbuf_printf(&sbuf, "device=unknown\nvendor=unknown\n");
873 else
874 sbuf_printf(&sbuf, "device=%s\nvendor=%s\n",
875 devices[mib->device].name, devices[mib->device].vendor);
876
877 for (i = 0; atmmedia[i].name; i++)

--- 56 unchanged lines hidden (view full) ---

934 switch (msg->header.cmd) {
935
936 case NGM_ATM_GET_IFNAME:
937 NG_MKRESPONSE(resp, msg, IFNAMSIZ + 1, M_NOWAIT);
938 if (resp == NULL) {
939 error = ENOMEM;
940 break;
941 }
942 strlcpy(resp->data, priv->ifp->if_xname, IFNAMSIZ + 1);
943 break;
944
945 case NGM_ATM_GET_CONFIG:
946 {
947 struct ngm_atm_config *config;
948
949 NG_MKRESPONSE(resp, msg, sizeof(*config), M_NOWAIT);
950 if (resp == NULL) {

--- 307 unchanged lines hidden (view full) ---

1258ng_atm_attach(struct ifnet *ifp)
1259{
1260 char name[IFNAMSIZ+1];
1261 node_p node;
1262 struct priv *priv;
1263
1264 KASSERT(IFP2NG(ifp) == 0, ("%s: node alreay exists?", __FUNCTION__));
1265
1266 strlcpy(name, ifp->if_xname, sizeof(name));
1267
1268 if (ng_make_node_common(&ng_atm_typestruct, &node) != 0) {
1269 log(LOG_ERR, "%s: can't create node for %s\n",
1270 __FUNCTION__, name);
1271 return;
1272 }
1273
1274 priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);

--- 160 unchanged lines hidden ---