ng_UI.c (68876) | ng_UI.c (69922) |
---|---|
1 2/* 3 * ng_UI.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_UI.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_UI.c 68876 2000-11-18 15:17:43Z dwmalone $ | 39 * $FreeBSD: head/sys/netgraph/ng_UI.c 69922 2000-12-12 18:52:14Z julian $ |
40 * $Whistle: ng_UI.c,v 1.14 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/malloc.h> --- 34 unchanged lines hidden (view full) --- 82 NULL, 83 ng_UI_constructor, 84 ng_UI_rcvmsg, 85 ng_UI_rmnode, 86 ng_UI_newhook, 87 NULL, 88 NULL, 89 ng_UI_rcvdata, | 40 * $Whistle: ng_UI.c,v 1.14 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/malloc.h> --- 34 unchanged lines hidden (view full) --- 82 NULL, 83 ng_UI_constructor, 84 ng_UI_rcvmsg, 85 ng_UI_rmnode, 86 ng_UI_newhook, 87 NULL, 88 NULL, 89 ng_UI_rcvdata, |
90 ng_UI_rcvdata, | |
91 ng_UI_disconnect, 92 NULL 93}; 94NETGRAPH_INIT(UI, &typestruct); 95 96/************************************************************************ 97 NETGRAPH NODE STUFF 98 ************************************************************************/ --- 47 unchanged lines hidden (view full) --- 146 147/* 148 * Receive a control message 149 */ 150static int 151ng_UI_rcvmsg(node_p node, struct ng_mesg *msg, 152 const char *raddr, struct ng_mesg **rp, hook_p lasthook) 153{ | 90 ng_UI_disconnect, 91 NULL 92}; 93NETGRAPH_INIT(UI, &typestruct); 94 95/************************************************************************ 96 NETGRAPH NODE STUFF 97 ************************************************************************/ --- 47 unchanged lines hidden (view full) --- 145 146/* 147 * Receive a control message 148 */ 149static int 150ng_UI_rcvmsg(node_p node, struct ng_mesg *msg, 151 const char *raddr, struct ng_mesg **rp, hook_p lasthook) 152{ |
153 const priv_p priv = node->private; 154 155 if ((msg->header.typecookie == NGM_FLOW_COOKIE) && lasthook) { 156 if (lasthook == priv->downlink) { 157 if (priv->uplink) { 158 return (ng_send_msg(node, msg, NULL, 159 priv->uplink, raddr, rp)); 160 } 161 } else { 162 if (priv->downlink) { 163 return (ng_send_msg(node, msg, NULL, 164 priv->downlink, raddr, rp)); 165 } 166 } 167 } 168 |
|
154 FREE(msg, M_NETGRAPH); 155 return (EINVAL); 156} 157 158#define MAX_ENCAPS_HDR 1 159#define ERROUT(x) do { error = (x); goto done; } while (0) 160 161/* 162 * Receive a data frame 163 */ 164static int 165ng_UI_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, | 169 FREE(msg, M_NETGRAPH); 170 return (EINVAL); 171} 172 173#define MAX_ENCAPS_HDR 1 174#define ERROUT(x) do { error = (x); goto done; } while (0) 175 176/* 177 * Receive a data frame 178 */ 179static int 180ng_UI_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, |
166 struct mbuf **ret_m, meta_p *ret_meta) | 181 struct mbuf **ret_m, meta_p *ret_meta, struct ng_mesg **resp) |
167{ 168 const node_p node = hook->node; 169 const priv_p priv = node->private; 170 int error = 0; 171 172 if (hook == priv->downlink) { 173 u_char *start, *ptr; 174 --- 63 unchanged lines hidden --- | 182{ 183 const node_p node = hook->node; 184 const priv_p priv = node->private; 185 int error = 0; 186 187 if (hook == priv->downlink) { 188 u_char *start, *ptr; 189 --- 63 unchanged lines hidden --- |