3 * ===================================
4 * HARP | Host ATM Research Platform
5 * ===================================
8 * This Host ATM Research Platform ("HARP") file (the "Software") is
9 * made available by Network Computing Services, Inc. ("NetworkCS")
10 * "AS IS". NetworkCS does not provide maintenance, improvements or
11 * support of any kind.
13 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
14 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
15 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
16 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
17 * In no event shall NetworkCS be responsible for any damages, including
18 * but not limited to consequential damages, arising from or relating to
19 * any use of the Software or related support.
21 * Copyright 1994-1998 Network Computing Services, Inc.
23 * Copies of this Software may be made, however, the above copyright
24 * notice must be reproduced on all copies.
26 * @(#) $FreeBSD: src/sys/netatm/uni/uniip.c,v 1.4 1999/08/28 00:49:03 peter Exp $
27 * @(#) $DragonFly: src/sys/netproto/atm/uni/uniip.c,v 1.5 2003/08/23 10:06:22 rob Exp $
31 * ATM Forum UNI Support
32 * ---------------------
34 * UNI IP interface module
38 #include <netproto/atm/kern_include.h>
40 #include <netproto/atm/ipatm/ipatm_var.h>
41 #include <netproto/atm/ipatm/ipatm_serv.h>
42 #include "uniip_var.h"
47 static int uniip_ipact (struct ip_nif *);
48 static int uniip_ipdact (struct ip_nif *);
54 struct uniip *uniip_head = NULL;
56 struct ip_serv uniip_ipserv = {
66 { { ATM_AAL5, ATM_ENC_LLC} },
73 static struct sp_info uniip_pool = {
74 "uni ip pool", /* si_name */
75 sizeof(struct uniip), /* si_blksiz */
82 * Process module loading notification
84 * Called whenever the uni module is initializing.
90 * 0 initialization successful
91 * errno initialization failed - reason indicated
100 * Tell arp to initialize stuff
102 err = uniarp_start();
109 * Process module unloading notification
111 * Called whenever the uni module is about to be unloaded. All signalling
112 * instances will have been previously detached. All uniip resources
119 * 0 shutdown was successful
120 * errno shutdown failed - reason indicated
128 * All IP interfaces should be gone
139 * Free our storage pools
141 atm_release_pool(&uniip_pool);
148 * Process IP Network Interface Activation
150 * Called whenever an IP network interface becomes active.
155 * inp pointer to IP network interface
158 * 0 command successful
159 * errno command failed - reason indicated
169 * Make sure we don't already have this interface
171 for (uip = uniip_head; uip; uip = uip->uip_next) {
172 if (uip->uip_ipnif == inp)
177 * Get a new interface control block
179 uip = (struct uniip *)atm_allocate(&uniip_pool);
184 * Initialize and link up
186 uip->uip_ipnif = inp;
187 LINK2TAIL(uip, struct uniip, uniip_head, uip_next);
192 inp->inf_isintf = (caddr_t)uip;
195 * Tell arp about new interface
204 * Process IP Network Interface Deactivation
206 * Called whenever an IP network interface becomes inactive.
211 * inp pointer to IP network interface
214 * 0 command successful
215 * errno command failed - reason indicated
225 * Get the appropriate IP interface block
227 uip = (struct uniip *)inp->inf_isintf;
232 * Let arp know about this
237 * Free interface info
239 UNLINK(uip, struct uniip, uniip_head, uip_next);
240 if (uip->uip_prefix != NULL)
241 KM_FREE(uip->uip_prefix,
242 uip->uip_nprefix * sizeof(struct uniarp_prf), M_DEVBUF);
243 atm_free((caddr_t)uip);