Deleted Added
sdiff udiff text old ( 68876 ) new ( 69922 )
full compact
1
2/*
3 * ng_cisco.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

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

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * Author: Julian Elischer <julian@freebsd.org>
38 *
39 * $FreeBSD: head/sys/netgraph/ng_cisco.c 68876 2000-11-18 15:17:43Z dwmalone $
40 * $Whistle: ng_cisco.c,v 1.25 1999/11/01 09:24:51 julian Exp $
41 */
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/errno.h>
46#include <sys/kernel.h>
47#include <sys/socket.h>

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

176 NULL,
177 cisco_constructor,
178 cisco_rcvmsg,
179 cisco_rmnode,
180 cisco_newhook,
181 NULL,
182 NULL,
183 cisco_rcvdata,
184 cisco_rcvdata,
185 cisco_disconnect,
186 ng_cisco_cmdlist
187};
188NETGRAPH_INIT(cisco, &typestruct);
189
190/*
191 * Node constructor
192 */

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

346 return (error);
347}
348
349/*
350 * Receive data
351 */
352static int
353cisco_rcvdata(hook_p hook, struct mbuf *m, meta_p meta,
354 struct mbuf **ret_m, meta_p *ret_meta)
355{
356 const sc_p sc = hook->node->private;
357 struct protoent *pep;
358 struct cisco_header *h;
359 int error = 0;
360
361 if ((pep = hook->private) == NULL)
362 goto out;

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

497
498 /* Ask inet peer for IP address information */
499 if (sc->inet.hook == NULL)
500 goto nomsg;
501 NG_MKMESSAGE(msg, NGM_CISCO_COOKIE,
502 NGM_CISCO_GET_IPADDR, 0, M_NOWAIT);
503 if (msg == NULL)
504 goto nomsg;
505 ng_send_msg(sc->node, msg,
506 NG_CISCO_HOOK_INET, &resp);
507 if (resp != NULL)
508 cisco_rcvmsg(sc->node, resp, ".",
509 NULL, NULL);
510
511 nomsg:
512 /* Send reply to peer device */
513 error = cisco_send(sc, CISCO_ADDR_REPLY,
514 ntohl(sc->localip.s_addr),

--- 88 unchanged lines hidden ---