Deleted Added
full compact
ng_cisco.c (68876) ng_cisco.c (69922)
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 *
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 $
39 * $FreeBSD: head/sys/netgraph/ng_cisco.c 69922 2000-12-12 18:52:14Z julian $
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,
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,
184 cisco_disconnect,
185 ng_cisco_cmdlist
186};
187NETGRAPH_INIT(cisco, &typestruct);
188
189/*
190 * Node constructor
191 */

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

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

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

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

--- 88 unchanged lines hidden ---