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 $
31 * ATM Forum UNI Support
32 * ---------------------
34 * UNI IP interface module
38 #include <netatm/kern_include.h>
40 #include <netatm/ipatm/ipatm_var.h>
41 #include <netatm/ipatm/ipatm_serv.h>
42 #include <netatm/uni/uniip_var.h>
45 __RCSID("@(#) $FreeBSD: src/sys/netatm/uni/uniip.c,v 1.4 1999/08/28 00:49:03 peter Exp $");
52 static int uniip_ipact __P((struct ip_nif *));
53 static int uniip_ipdact __P((struct ip_nif *));
59 struct uniip *uniip_head = NULL;
61 struct ip_serv uniip_ipserv = {
71 { { ATM_AAL5, ATM_ENC_LLC} },
78 static struct sp_info uniip_pool = {
79 "uni ip pool", /* si_name */
80 sizeof(struct uniip), /* si_blksiz */
87 * Process module loading notification
89 * Called whenever the uni module is initializing.
95 * 0 initialization successful
96 * errno initialization failed - reason indicated
105 * Tell arp to initialize stuff
107 err = uniarp_start();
114 * Process module unloading notification
116 * Called whenever the uni module is about to be unloaded. All signalling
117 * instances will have been previously detached. All uniip resources
124 * 0 shutdown was successful
125 * errno shutdown failed - reason indicated
133 * All IP interfaces should be gone
144 * Free our storage pools
146 atm_release_pool(&uniip_pool);
153 * Process IP Network Interface Activation
155 * Called whenever an IP network interface becomes active.
160 * inp pointer to IP network interface
163 * 0 command successful
164 * errno command failed - reason indicated
174 * Make sure we don't already have this interface
176 for (uip = uniip_head; uip; uip = uip->uip_next) {
177 if (uip->uip_ipnif == inp)
182 * Get a new interface control block
184 uip = (struct uniip *)atm_allocate(&uniip_pool);
189 * Initialize and link up
191 uip->uip_ipnif = inp;
192 LINK2TAIL(uip, struct uniip, uniip_head, uip_next);
197 inp->inf_isintf = (caddr_t)uip;
200 * Tell arp about new interface
209 * Process IP Network Interface Deactivation
211 * Called whenever an IP network interface becomes inactive.
216 * inp pointer to IP network interface
219 * 0 command successful
220 * errno command failed - reason indicated
230 * Get the appropriate IP interface block
232 uip = (struct uniip *)inp->inf_isintf;
237 * Let arp know about this
242 * Free interface info
244 UNLINK(uip, struct uniip, uniip_head, uip_next);
245 if (uip->uip_prefix != NULL)
246 KM_FREE(uip->uip_prefix,
247 uip->uip_nprefix * sizeof(struct uniarp_prf), M_DEVBUF);
248 atm_free((caddr_t)uip);