Deleted Added
full compact
ng_pptpgre.c (177646) ng_pptpgre.c (184205)
1/*
2 * ng_pptpgre.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

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

32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
36 * OF SUCH DAMAGE.
37 *
38 * Author: Archie Cobbs <archie@freebsd.org>
39 *
1/*
2 * ng_pptpgre.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

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

32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
36 * OF SUCH DAMAGE.
37 *
38 * Author: Archie Cobbs <archie@freebsd.org>
39 *
40 * $FreeBSD: head/sys/netgraph/ng_pptpgre.c 177646 2008-03-26 21:19:03Z mav $
40 * $FreeBSD: head/sys/netgraph/ng_pptpgre.c 184205 2008-10-23 15:53:51Z des $
41 * $Whistle: ng_pptpgre.c,v 1.7 1999/12/08 00:10:06 archie Exp $
42 */
43
44/*
45 * PPTP/GRE netgraph node type.
46 *
47 * This node type does the GRE encapsulation as specified for the PPTP
48 * protocol (RFC 2637, section 4). This includes sequencing and

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

275 */
276static int
277ng_pptpgre_constructor(node_p node)
278{
279 priv_p priv;
280 int i;
281
282 /* Allocate private structure */
41 * $Whistle: ng_pptpgre.c,v 1.7 1999/12/08 00:10:06 archie Exp $
42 */
43
44/*
45 * PPTP/GRE netgraph node type.
46 *
47 * This node type does the GRE encapsulation as specified for the PPTP
48 * protocol (RFC 2637, section 4). This includes sequencing and

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

275 */
276static int
277ng_pptpgre_constructor(node_p node)
278{
279 priv_p priv;
280 int i;
281
282 /* Allocate private structure */
283 MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
283 priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
284 if (priv == NULL)
285 return (ENOMEM);
286
287 NG_NODE_SET_PRIVATE(node, priv);
288
289 /* Initialize state */
290 mtx_init(&priv->uppersess.mtx, "ng_pptp", NULL, MTX_DEF);
291 ng_callout_init(&priv->uppersess.sackTimer);

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

514 const priv_p priv = NG_NODE_PRIVATE(node);
515
516 /* Reset node (stops timers) */
517 ng_pptpgre_reset(&priv->uppersess);
518
519 LIST_REMOVE(&priv->uppersess, sessions);
520 mtx_destroy(&priv->uppersess.mtx);
521
284 if (priv == NULL)
285 return (ENOMEM);
286
287 NG_NODE_SET_PRIVATE(node, priv);
288
289 /* Initialize state */
290 mtx_init(&priv->uppersess.mtx, "ng_pptp", NULL, MTX_DEF);
291 ng_callout_init(&priv->uppersess.sackTimer);

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

514 const priv_p priv = NG_NODE_PRIVATE(node);
515
516 /* Reset node (stops timers) */
517 ng_pptpgre_reset(&priv->uppersess);
518
519 LIST_REMOVE(&priv->uppersess, sessions);
520 mtx_destroy(&priv->uppersess.mtx);
521
522 FREE(priv, M_NETGRAPH);
522 free(priv, M_NETGRAPH);
523
524 /* Decrement ref count */
525 NG_NODE_UNREF(node);
526 return (0);
527}
528
529/*************************************************************************
530 TRANSMIT AND RECEIVE FUNCTIONS

--- 455 unchanged lines hidden ---
523
524 /* Decrement ref count */
525 NG_NODE_UNREF(node);
526 return (0);
527}
528
529/*************************************************************************
530 TRANSMIT AND RECEIVE FUNCTIONS

--- 455 unchanged lines hidden ---