\hypertarget{ng__cisco_8c_source}{}\doxysection{ng\+\_\+cisco.\+c}
\label{ng__cisco_8c_source}\index{netgraph/ng\_cisco.c@{netgraph/ng\_cisco.c}}
\mbox{\hyperlink{ng__cisco_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00002}00002 \textcolor{comment}{ * ng\_cisco.c}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00003}00003 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00004}00004 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00005}00005 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1996-\/1999 Whistle Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00007}00007 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00008}00008 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00009}00009 \textcolor{comment}{ * Subject to the following obligations and disclaimer of warranty, use and}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00010}00010 \textcolor{comment}{ * redistribution of this software, in source or object code forms, with or}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00011}00011 \textcolor{comment}{ * without modifications are expressly permitted by Whistle Communications;}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00012}00012 \textcolor{comment}{ * provided, however, that:}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00013}00013 \textcolor{comment}{ * 1. Any and all reproductions of the source or object code must include the}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00014}00014 \textcolor{comment}{ *    copyright notice above and the following disclaimer of warranties; and}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00015}00015 \textcolor{comment}{ * 2. No rights are granted, in any manner or form, to use Whistle}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00016}00016 \textcolor{comment}{ *    Communications, Inc. trademarks, including the mark "{}WHISTLE}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00017}00017 \textcolor{comment}{ *    COMMUNICATIONS"{} on advertising, endorsements, or otherwise except as}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00018}00018 \textcolor{comment}{ *    such appears in the above copyright notice or in the software.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00019}00019 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "{}AS IS"{}, AND}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00021}00021 \textcolor{comment}{ * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00022}00022 \textcolor{comment}{ * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00023}00023 \textcolor{comment}{ * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00024}00024 \textcolor{comment}{ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-\/INFRINGEMENT.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00025}00025 \textcolor{comment}{ * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00026}00026 \textcolor{comment}{ * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00027}00027 \textcolor{comment}{ * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00028}00028 \textcolor{comment}{ * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00029}00029 \textcolor{comment}{ * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00030}00030 \textcolor{comment}{ * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00031}00031 \textcolor{comment}{ * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00032}00032 \textcolor{comment}{ * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00033}00033 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00034}00034 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00035}00035 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00036}00036 \textcolor{comment}{ * OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00037}00037 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00038}00038 \textcolor{comment}{ * Author: Julian Elischer <julian@freebsd.org>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00039}00039 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00040}00040 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00041}00041 \textcolor{comment}{ * \$Whistle: ng\_cisco.c,v 1.25 1999/11/01 09:24:51 julian Exp \$}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00042}00042 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/syslog.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <netinet/in.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <netinet/if\_ether.h>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__parse_8h}{netgraph/ng\_parse.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__cisco_8h}{netgraph/ng\_cisco.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00063}\mbox{\hyperlink{ng__cisco_8c_a60dff2288a30a3e9c1d67ac0be3be860}{00063}} \textcolor{preprocessor}{\#define CISCO\_MULTICAST         0x8f    }\textcolor{comment}{/* Cisco multicast address */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00064}\mbox{\hyperlink{ng__cisco_8c_aac3ec9a36f804468333a954b014e250e}{00064}} \textcolor{preprocessor}{\#define CISCO\_UNICAST           0x0f    }\textcolor{comment}{/* Cisco unicast address */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00065}\mbox{\hyperlink{ng__cisco_8c_ab0376c180f7944d3af1206ac5a2b1ace}{00065}} \textcolor{preprocessor}{\#define CISCO\_KEEPALIVE         0x8035  }\textcolor{comment}{/* Cisco keepalive protocol */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00066}\mbox{\hyperlink{ng__cisco_8c_abcda11fd5c94cb9311e38a79a1e58bb3}{00066}} \textcolor{preprocessor}{\#define CISCO\_ADDR\_REQ          0       }\textcolor{comment}{/* Cisco address request */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00067}\mbox{\hyperlink{ng__cisco_8c_a31f34eecad0fb9dbc3015d3ed1ac32b5}{00067}} \textcolor{preprocessor}{\#define CISCO\_ADDR\_REPLY        1       }\textcolor{comment}{/* Cisco address reply */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00068}\mbox{\hyperlink{ng__cisco_8c_a40b80bee295708bad4bf44adff7550c5}{00068}} \textcolor{preprocessor}{\#define CISCO\_KEEPALIVE\_REQ     2       }\textcolor{comment}{/* Cisco keepalive request */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00070}\mbox{\hyperlink{ng__cisco_8c_a48d97c04f02e30c445920de5aff13595}{00070}} \textcolor{preprocessor}{\#define KEEPALIVE\_SECS          10}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00072}\mbox{\hyperlink{structcisco__header}{00072}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__header}{cisco\_header}} \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00073}\mbox{\hyperlink{structcisco__header_a9d51b6e0c2f2826ff1b0a3d9fb417a61}{00073}}         uint8\_t  \mbox{\hyperlink{structcisco__header_a9d51b6e0c2f2826ff1b0a3d9fb417a61}{address}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00074}\mbox{\hyperlink{structcisco__header_ad9ec3c60a63566cd50d797bcf4757c63}{00074}}         uint8\_t  \mbox{\hyperlink{structcisco__header_ad9ec3c60a63566cd50d797bcf4757c63}{control}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00075}\mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{00075}}         uint16\_t \mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{protocol}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00076}\mbox{\hyperlink{ng__cisco_8c_a1560ce29ccb13330fd78e854ec096aec}{00076}} \} \mbox{\hyperlink{ng__cisco_8c_a1560ce29ccb13330fd78e854ec096aec}{\_\_packed}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00078}\mbox{\hyperlink{ng__cisco_8c_a965d83d9a377b2aff2d60fe5080c4d48}{00078}} \textcolor{preprocessor}{\#define CISCO\_HEADER\_LEN        sizeof (struct cisco\_header)}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00080}\mbox{\hyperlink{structcisco__packet}{00080}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__packet}{cisco\_packet}} \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00081}\mbox{\hyperlink{structcisco__packet_afa94105ee746b077e62e2abc2f4ff08c}{00081}}         uint32\_t \mbox{\hyperlink{structcisco__packet_afa94105ee746b077e62e2abc2f4ff08c}{type}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00082}\mbox{\hyperlink{structcisco__packet_a9d340c8e32bab0bd8d9d6f4d22f4e40b}{00082}}         uint32\_t \mbox{\hyperlink{structcisco__packet_a9d340c8e32bab0bd8d9d6f4d22f4e40b}{par1}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00083}\mbox{\hyperlink{structcisco__packet_a2dc1f53e0ed18c2724a13cb05806ac75}{00083}}         uint32\_t \mbox{\hyperlink{structcisco__packet_a2dc1f53e0ed18c2724a13cb05806ac75}{par2}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00084}\mbox{\hyperlink{structcisco__packet_a331b0e22cb90c948e8ddd43f589bf6ad}{00084}}         uint16\_t \mbox{\hyperlink{structcisco__packet_a331b0e22cb90c948e8ddd43f589bf6ad}{rel}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00085}\mbox{\hyperlink{structcisco__packet_a93a0a0de5261dbb8bf6f31a831cbb203}{00085}}         uint16\_t \mbox{\hyperlink{structcisco__packet_a93a0a0de5261dbb8bf6f31a831cbb203}{time0}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00086}\mbox{\hyperlink{structcisco__packet_a9d6808c02f62d475cfb955d548e3ae52}{00086}}         uint16\_t \mbox{\hyperlink{structcisco__packet_a9d6808c02f62d475cfb955d548e3ae52}{time1}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00087}00087 \} \mbox{\hyperlink{ng__cisco_8c_a1560ce29ccb13330fd78e854ec096aec}{\_\_packed}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00089}\mbox{\hyperlink{ng__cisco_8c_a29d7f2f0479756fe6d1d997dba7e4da7}{00089}} \textcolor{preprocessor}{\#define CISCO\_PACKET\_LEN (sizeof(struct cisco\_packet))}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00091}\mbox{\hyperlink{structprotoent}{00091}} \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00092}\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{00092}}         \mbox{\hyperlink{structng__hook}{hook\_p}}  \mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}};         \textcolor{comment}{/* the hook for this proto */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00093}\mbox{\hyperlink{structprotoent_a893376ddc0a43c574731d8058e6d78e6}{00093}}         uint16\_t \mbox{\hyperlink{structprotoent_a893376ddc0a43c574731d8058e6d78e6}{af}};          \textcolor{comment}{/* address family, -\/1 = downstream */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00094}00094 \};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00096}\mbox{\hyperlink{structcisco__priv}{00096}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__priv}{cisco\_priv}} \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00097}\mbox{\hyperlink{structcisco__priv_a1bc637da75d2ef7588e66c2704a03b90}{00097}}         uint32\_t \mbox{\hyperlink{structcisco__priv_a1bc637da75d2ef7588e66c2704a03b90}{local\_seq}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00098}\mbox{\hyperlink{structcisco__priv_a304f39275d3cc1ff073b356e4cdeb242}{00098}}         uint32\_t \mbox{\hyperlink{structcisco__priv_a304f39275d3cc1ff073b356e4cdeb242}{remote\_seq}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00099}\mbox{\hyperlink{structcisco__priv_ac8d48572a8f7198e25cdf9f2bc958f8c}{00099}}         uint32\_t \mbox{\hyperlink{structcisco__priv_ac8d48572a8f7198e25cdf9f2bc958f8c}{seqRetries}};  \textcolor{comment}{/* how many times we've been here throwing out}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00100}00100 \textcolor{comment}{                                 * the same sequence number without ack */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00101}\mbox{\hyperlink{structcisco__priv_abd6f76f4865503e4413ca4357973087f}{00101}}         \mbox{\hyperlink{structng__node}{node\_p}}  \mbox{\hyperlink{structcisco__priv_abd6f76f4865503e4413ca4357973087f}{node}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00102}\mbox{\hyperlink{structcisco__priv_afe43d11cea31656fe6bf1c6458456e5f}{00102}}         \textcolor{keyword}{struct }callout \mbox{\hyperlink{structcisco__priv_afe43d11cea31656fe6bf1c6458456e5f}{handle}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00103}\mbox{\hyperlink{structcisco__priv_a80889d11a641d5dfb315e0b02d962b45}{00103}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} \mbox{\hyperlink{structcisco__priv_a80889d11a641d5dfb315e0b02d962b45}{downstream}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00104}\mbox{\hyperlink{structcisco__priv_a02aa972a756cfbe3d0294d3eb173f17e}{00104}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} \mbox{\hyperlink{structcisco__priv_a02aa972a756cfbe3d0294d3eb173f17e}{inet}};               \textcolor{comment}{/* IP information */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00105}\mbox{\hyperlink{structcisco__priv_ac836c6d57dbe11c352dfbffd67d1c0f1}{00105}}         \textcolor{keyword}{struct }in\_addr \mbox{\hyperlink{structcisco__priv_ac836c6d57dbe11c352dfbffd67d1c0f1}{localip}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00106}\mbox{\hyperlink{structcisco__priv_a3399f6a1f4ada2e24c761e0f393fce06}{00106}}         \textcolor{keyword}{struct }in\_addr \mbox{\hyperlink{structcisco__priv_a3399f6a1f4ada2e24c761e0f393fce06}{localmask}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00107}\mbox{\hyperlink{structcisco__priv_a383e83b183323663ee4546e0cdcb3c28}{00107}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} \mbox{\hyperlink{structcisco__priv_a383e83b183323663ee4546e0cdcb3c28}{inet6}};             \textcolor{comment}{/* IPv6 information */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00108}\mbox{\hyperlink{structcisco__priv_a7880996a8c50d91760f5ddd751ff1342}{00108}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} \mbox{\hyperlink{structcisco__priv_a7880996a8c50d91760f5ddd751ff1342}{atalk}};             \textcolor{comment}{/* AppleTalk information */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00109}\mbox{\hyperlink{structcisco__priv_ab8e4bcc864e96db530a087355996785b}{00109}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} \mbox{\hyperlink{structcisco__priv_ab8e4bcc864e96db530a087355996785b}{ipx}};         \textcolor{comment}{/* IPX information */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00110}00110 \};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00111}\mbox{\hyperlink{ng__cisco_8c_aff6e0f19830fb66730ae131fb2b16ac2}{00111}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__priv}{cisco\_priv}} *\mbox{\hyperlink{ng__cisco_8c_aff6e0f19830fb66730ae131fb2b16ac2}{sc\_p}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00113}00113 \textcolor{comment}{/* Netgraph methods */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00114}\mbox{\hyperlink{ng__cisco_8c_a7125aa1fd6da3aa31a3c207d775bd70a}{00114}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_abb75b9ed2849e15851d6402d2ab5b899}{ng\_constructor\_t}}         \mbox{\hyperlink{ng__cisco_8c_a7125aa1fd6da3aa31a3c207d775bd70a}{cisco\_constructor}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00115}\mbox{\hyperlink{ng__cisco_8c_ad220aab9d732fbe566cad8c242010b40}{00115}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a47b860e2900386e775707cc1ae661162}{ng\_rcvmsg\_t}}           \mbox{\hyperlink{ng__cisco_8c_ad220aab9d732fbe566cad8c242010b40}{cisco\_rcvmsg}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00116}\mbox{\hyperlink{ng__cisco_8c_a44af1f5210528e815b485b61dc5fefa8}{00116}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aab0a679789a1af312a7f856b4668ad74}{ng\_shutdown\_t}}               \mbox{\hyperlink{ng__cisco_8c_a44af1f5210528e815b485b61dc5fefa8}{cisco\_shutdown}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00117}\mbox{\hyperlink{ng__cisco_8c_a66edb1fa8dc92057ab4aa774bd1694c7}{00117}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_afa50639df4ed6eb400f8220a890d56e6}{ng\_newhook\_t}}         \mbox{\hyperlink{ng__cisco_8c_a66edb1fa8dc92057ab4aa774bd1694c7}{cisco\_newhook}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00118}\mbox{\hyperlink{ng__cisco_8c_a6cc3be4ea94c62fb8b8c25fc4e9db604}{00118}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}}         \mbox{\hyperlink{ng__cisco_8c_a6cc3be4ea94c62fb8b8c25fc4e9db604}{cisco\_rcvdata}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00119}\mbox{\hyperlink{ng__cisco_8c_aa4054415e304c433756dd58094ce6d62}{00119}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a669e1783335f933b4a4f90f17d22f381}{ng\_disconnect\_t}}           \mbox{\hyperlink{ng__cisco_8c_aa4054415e304c433756dd58094ce6d62}{cisco\_disconnect}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00121}00121 \textcolor{comment}{/* Other functions */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00122}00122 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{ng__cisco_8c_a31cb2f9e647ba07ed3dc42351a3dca76}{cisco\_input}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \mbox{\hyperlink{structng__item}{item\_p}} item);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00123}00123 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__cisco_8c_a18793218ebed55aa43f755df1c2014e8}{cisco\_keepalive}}(\mbox{\hyperlink{structng__node}{node\_p}} \mbox{\hyperlink{structcisco__priv_abd6f76f4865503e4413ca4357973087f}{node}}, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{void} *arg1, \textcolor{keywordtype}{int} arg2);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00124}00124 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{ng__cisco_8c_a94c3f787373c473e822009c8e7551abe}{cisco\_send}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__btsocket__rfcomm_8h_a3cce6e7fc609fa524af48647bd518f51}{type}}, \textcolor{keywordtype}{long} par1, \textcolor{keywordtype}{long} par2);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00125}00125 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__cisco_8c_aef442729c255816ab9da5449572181e8}{cisco\_notify}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, uint32\_t \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00127}00127 \textcolor{comment}{/* Parse type for struct ng\_cisco\_ipaddr */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00128}\mbox{\hyperlink{ng__cisco_8c_a4bcfe940407113bf569257f7ef9f40a0}{00128}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__cisco_8c_a4bcfe940407113bf569257f7ef9f40a0}{ng\_cisco\_ipaddr\_type\_fields}}[]}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00129}00129         = \mbox{\hyperlink{ng__cisco_8h_a64dc83f2a63f337869d68195da91d55b}{NG\_CISCO\_IPADDR\_TYPE\_INFO}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00130}\mbox{\hyperlink{ng__cisco_8c_ac4cf13804d3b89824a22353386374b4c}{00130}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__cisco_8c_ac4cf13804d3b89824a22353386374b4c}{ng\_cisco\_ipaddr\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00131}00131         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00132}00132         \&\mbox{\hyperlink{ng__cisco_8c_a4bcfe940407113bf569257f7ef9f40a0}{ng\_cisco\_ipaddr\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00133}00133 \};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00135}00135 \textcolor{comment}{/* Parse type for struct ng\_async\_stat */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00136}\mbox{\hyperlink{ng__cisco_8c_a165516dcab22e6a44cb6b7b8975d9e2e}{00136}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__cisco_8c_a165516dcab22e6a44cb6b7b8975d9e2e}{ng\_cisco\_stats\_type\_fields}}[]}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00137}00137         = \mbox{\hyperlink{ng__cisco_8h_afbe60f2ec29a9c4941fb790522fb567f}{NG\_CISCO\_STATS\_TYPE\_INFO}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00138}\mbox{\hyperlink{ng__cisco_8c_a316a02b42e37a19d96e3d65c06639856}{00138}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__cisco_8c_a316a02b42e37a19d96e3d65c06639856}{ng\_cisco\_stats\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00139}00139         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00140}00140         \&\mbox{\hyperlink{ng__cisco_8c_a165516dcab22e6a44cb6b7b8975d9e2e}{ng\_cisco\_stats\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00141}00141 \};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00143}00143 \textcolor{comment}{/* List of commands and how to convert arguments to/from ASCII */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00144}\mbox{\hyperlink{ng__cisco_8c_a3da1477ccb6df197346737a4eb8b458a}{00144}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__cmdlist}{ng\_cmdlist}} \mbox{\hyperlink{ng__cisco_8c_a3da1477ccb6df197346737a4eb8b458a}{ng\_cisco\_cmdlist}}[] = \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00145}00145         \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00146}00146           \mbox{\hyperlink{ng__cisco_8h_a340e50a672f788c298bb2eb090746acc}{NGM\_CISCO\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00147}00147           \mbox{\hyperlink{ng__cisco_8h_a96a58e29e8dbf2b5bdeb775cba46556ea810f4cc4c798f161dab1ec2c65720959}{NGM\_CISCO\_SET\_IPADDR}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00148}00148           \textcolor{stringliteral}{"{}setipaddr"{}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00149}00149           \&\mbox{\hyperlink{ng__cisco_8c_ac4cf13804d3b89824a22353386374b4c}{ng\_cisco\_ipaddr\_type}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00150}00150           NULL}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00151}00151         \},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00152}00152         \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00153}00153           \mbox{\hyperlink{ng__cisco_8h_a340e50a672f788c298bb2eb090746acc}{NGM\_CISCO\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00154}00154           \mbox{\hyperlink{ng__cisco_8h_a96a58e29e8dbf2b5bdeb775cba46556ea31fcd493a3d914b833cc117dc998385b}{NGM\_CISCO\_GET\_IPADDR}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00155}00155           \textcolor{stringliteral}{"{}getipaddr"{}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00156}00156           NULL,}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00157}00157           \&\mbox{\hyperlink{ng__cisco_8c_ac4cf13804d3b89824a22353386374b4c}{ng\_cisco\_ipaddr\_type}}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00158}00158         \},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00159}00159         \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00160}00160           \mbox{\hyperlink{ng__cisco_8h_a340e50a672f788c298bb2eb090746acc}{NGM\_CISCO\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00161}00161           \mbox{\hyperlink{ng__cisco_8h_a96a58e29e8dbf2b5bdeb775cba46556ea966c49cf793365f30a0e947de2c7c1a0}{NGM\_CISCO\_GET\_STATUS}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00162}00162           \textcolor{stringliteral}{"{}getstats"{}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00163}00163           NULL,}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00164}00164           \&\mbox{\hyperlink{ng__cisco_8c_a316a02b42e37a19d96e3d65c06639856}{ng\_cisco\_stats\_type}}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00165}00165         \},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00166}00166         \{ 0 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00167}00167 \};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00169}00169 \textcolor{comment}{/* Node type */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00170}\mbox{\hyperlink{ng__cisco_8c_a80a131770518c7fa3758d85054006e7a}{00170}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__type}{ng\_type}} \mbox{\hyperlink{ng__cisco_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}} = \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00171}00171         .\mbox{\hyperlink{structng__type_adbc1c8884ff0e625c19c4b513262fd0e}{version}} =       \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00172}00172         .name =         \mbox{\hyperlink{ng__cisco_8h_acb9ab5e96fa2b3deca95cbd5cf94adc7}{NG\_CISCO\_NODE\_TYPE}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00173}00173         .constructor =  \mbox{\hyperlink{ng__cisco_8c_a7125aa1fd6da3aa31a3c207d775bd70a}{cisco\_constructor}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00174}00174         .rcvmsg =       \mbox{\hyperlink{ng__cisco_8c_ad220aab9d732fbe566cad8c242010b40}{cisco\_rcvmsg}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00175}00175         .shutdown =     \mbox{\hyperlink{ng__cisco_8c_a44af1f5210528e815b485b61dc5fefa8}{cisco\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00176}00176         .newhook =      \mbox{\hyperlink{ng__cisco_8c_a66edb1fa8dc92057ab4aa774bd1694c7}{cisco\_newhook}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00177}00177         .rcvdata =      \mbox{\hyperlink{ng__cisco_8c_a6cc3be4ea94c62fb8b8c25fc4e9db604}{cisco\_rcvdata}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00178}00178         .disconnect =   \mbox{\hyperlink{ng__cisco_8c_aa4054415e304c433756dd58094ce6d62}{cisco\_disconnect}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00179}00179         .cmdlist =      \mbox{\hyperlink{ng__cisco_8c_a3da1477ccb6df197346737a4eb8b458a}{ng\_cisco\_cmdlist}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00180}00180 \};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00181}\mbox{\hyperlink{ng__cisco_8c_aa574412267cded684c8cd6d5381645f4}{00181}} \mbox{\hyperlink{ng__cisco_8c_aa574412267cded684c8cd6d5381645f4}{NETGRAPH\_INIT}}(cisco, \&\mbox{\hyperlink{ng__cisco_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00183}00183 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00184}00184 \textcolor{comment}{ * Node constructor}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00185}00185 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00186}00186 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00187}\mbox{\hyperlink{ng__cisco_8c_a64c450325c583677be4786778ca012fe}{00187}} \mbox{\hyperlink{ng__cisco_8c_a7125aa1fd6da3aa31a3c207d775bd70a}{cisco\_constructor}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00188}00188 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00189}00189         \mbox{\hyperlink{structng__async__private}{sc\_p}} sc;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00191}00191         sc = malloc(\textcolor{keyword}{sizeof}(*sc), M\_NETGRAPH, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00193}00193         \mbox{\hyperlink{netgraph_8h_a86218dc6ee6651399a66c7cbcba144e4}{ng\_callout\_init}}(\&sc-\/>handle);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00194}00194         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, sc);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00195}00195         sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}} = node;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00197}00197         \textcolor{comment}{/* Initialise the varous protocol hook holders */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00198}00198         sc-\/>downstream.af = 0xffff;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00199}00199         sc-\/>inet.af = AF\_INET;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00200}00200         sc-\/>inet6.af = AF\_INET6;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00201}00201         sc-\/>atalk.af = AF\_APPLETALK;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00202}00202         sc-\/>ipx.af = AF\_IPX;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00203}00203         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00204}00204 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00206}00206 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00207}00207 \textcolor{comment}{ * Check new hook}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00208}00208 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00209}00209 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00210}\mbox{\hyperlink{ng__cisco_8c_a75078795098c971c4cd37c6988b0ee82}{00210}} \mbox{\hyperlink{ng__cisco_8c_a66edb1fa8dc92057ab4aa774bd1694c7}{cisco\_newhook}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}})}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00211}00211 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00212}00212         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00214}00214         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__cisco_8h_a106c03cbb765473e5bf0bb42ae013740}{NG\_CISCO\_HOOK\_DOWNSTREAM}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00215}00215                 sc-\/>downstream.hook = hook;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00216}00216                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \&sc-\/>downstream);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00218}00218                 \textcolor{comment}{/* Start keepalives */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00219}00219                 \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&sc-\/>handle, node, NULL, (hz * \mbox{\hyperlink{ng__cisco_8c_a48d97c04f02e30c445920de5aff13595}{KEEPALIVE\_SECS}}),}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00220}00220                     \&\mbox{\hyperlink{ng__cisco_8c_a18793218ebed55aa43f755df1c2014e8}{cisco\_keepalive}}, (\textcolor{keywordtype}{void} *)sc, 0);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00221}00221         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__cisco_8h_a6b23275a6877084a0478b684e766da46}{NG\_CISCO\_HOOK\_INET}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00222}00222                 sc-\/>inet.hook = hook;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00223}00223                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \&sc-\/>inet);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00224}00224         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__cisco_8h_a5a1d0c98b5aa95e94e2df7d05073e651}{NG\_CISCO\_HOOK\_INET6}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00225}00225                 sc-\/>inet6.hook = hook;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00226}00226                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \&sc-\/>inet6);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00227}00227         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__cisco_8h_aa50ba57d03ba37dbde2f74f4c4f91970}{NG\_CISCO\_HOOK\_APPLETALK}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00228}00228                 sc-\/>atalk.hook = hook;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00229}00229                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \&sc-\/>atalk);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00230}00230         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__cisco_8h_ab6e269352e21ef961bd51ba3123c3083}{NG\_CISCO\_HOOK\_IPX}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00231}00231                 sc-\/>ipx.hook = hook;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00232}00232                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \&sc-\/>ipx);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00233}00233         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__cisco_8h_a36d1ed7313c3fb08218d83eccba26f92}{NG\_CISCO\_HOOK\_DEBUG}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00234}00234                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, NULL);     \textcolor{comment}{/* unimplemented */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00235}00235         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00236}00236                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00237}00237         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00238}00238 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00239}00239 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00240}00240 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00241}00241 \textcolor{comment}{ * Receive control message.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00242}00242 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00243}00243 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00244}\mbox{\hyperlink{ng__cisco_8c_a25078fd0ddac2b2e75d3fb29c1bb7c83}{00244}} \mbox{\hyperlink{ng__cisco_8c_ad220aab9d732fbe566cad8c242010b40}{cisco\_rcvmsg}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__item}{item\_p}} item, \mbox{\hyperlink{structng__hook}{hook\_p}} lasthook)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00245}00245 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00246}00246         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00247}00247         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00248}00248         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *resp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00249}00249         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00251}00251         \mbox{\hyperlink{netgraph_8h_adc9a04fd174ef3c29ecae94016b84839}{NGI\_GET\_MSG}}(item, msg);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00252}00252         \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}}) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00253}00253         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__message_8h_a577acb07400a990f6e293df85928c01e}{NGM\_GENERIC\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00254}00254                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00255}00255                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__message_8h_ae8a3b6a5d0d3244ed73924ab2421a0d0af7e8d918ab39873056284fe1b8dfe71b}{NGM\_TEXT\_STATUS}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00256}00256                     \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00257}00257                         \textcolor{keywordtype}{char} *arg;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00258}00258                         \textcolor{keywordtype}{int} pos;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00260}00260                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \mbox{\hyperlink{ng__message_8h_a3a84bfff41ce7395b73b14eb82a0f4e1}{NG\_TEXTRESPONSE}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00261}00261                         \textcolor{keywordflow}{if} (resp == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00262}00262                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00263}00263                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00264}00264                         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00265}00265                         arg = (\textcolor{keywordtype}{char} *) resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00266}00266                         pos = sprintf(arg,}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00267}00267                           \textcolor{stringliteral}{"{}keepalive period: \%d sec; "{}}, \mbox{\hyperlink{ng__cisco_8c_a48d97c04f02e30c445920de5aff13595}{KEEPALIVE\_SECS}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00268}00268                         pos += sprintf(arg + pos,}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00269}00269                           \textcolor{stringliteral}{"{}unacknowledged keepalives: \%d"{}}, sc-\/>seqRetries);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00270}00270                         resp-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} = pos + 1;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00271}00271                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00272}00272                     \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00273}00273                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00274}00274                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00275}00275                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00276}00276                 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00277}00277                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00278}00278         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8h_a340e50a672f788c298bb2eb090746acc}{NGM\_CISCO\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00279}00279                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00280}00280                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8h_a96a58e29e8dbf2b5bdeb775cba46556ea31fcd493a3d914b833cc117dc998385b}{NGM\_CISCO\_GET\_IPADDR}}:  \textcolor{comment}{/* could be a late reply! */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00281}00281                         \textcolor{keywordflow}{if} ((msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_afb60eeac4395f18a7900d6bd5b0f35a6}{flags}} \& \mbox{\hyperlink{ng__message_8h_a5fe4082cbb0ac2567dde73b46d0eabd3}{NGF\_RESP}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00282}00282                                 \textcolor{keyword}{struct }in\_addr *ips;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00284}00284                                 \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg,}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00285}00285                                     2 * \textcolor{keyword}{sizeof}(*ips), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00286}00286                                 \textcolor{keywordflow}{if} (!resp) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00287}00287                                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00288}00288                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00289}00289                                 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00290}00290                                 ips = (\textcolor{keyword}{struct }in\_addr *) resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00291}00291                                 ips[0] = sc-\/>localip;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00292}00292                                 ips[1] = sc-\/>localmask;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00293}00293                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00294}00294                         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00295}00295                         \textcolor{comment}{/* FALLTHROUGH */}       \textcolor{comment}{/* ...if it's a reply */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00296}00296                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8h_a96a58e29e8dbf2b5bdeb775cba46556ea810f4cc4c798f161dab1ec2c65720959}{NGM\_CISCO\_SET\_IPADDR}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00297}00297                     \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00298}00298                         \textcolor{keyword}{struct }in\_addr *\textcolor{keyword}{const} ips = (\textcolor{keyword}{struct }in\_addr *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00299}00299 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00300}00300                         if (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} < 2 * \textcolor{keyword}{sizeof}(*ips)) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00301}00301                                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00302}00302                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00303}00303                         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00304}00304                         sc-\/>localip = ips[0];}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00305}00305                         sc-\/>localmask = ips[1];}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00306}00306                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00307}00307                     \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00308}00308                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8h_a96a58e29e8dbf2b5bdeb775cba46556ea966c49cf793365f30a0e947de2c7c1a0}{NGM\_CISCO\_GET\_STATUS}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00309}00309                     \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00310}00310                         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__cisco__stats}{ng\_cisco\_stats}} *stat;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00311}00311 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00312}00312                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \textcolor{keyword}{sizeof}(*stat), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00313}00313                         \textcolor{keywordflow}{if} (!resp) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00314}00314                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00315}00315                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00316}00316                         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00317}00317                         stat = (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__cisco__stats}{ng\_cisco\_stats}} *)resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00318}00318                         stat-\/>\mbox{\hyperlink{structng__cisco__stats_a9e541c4bf5fe8430dc3e7cbb83c08870}{seqRetries}} = sc-\/>seqRetries;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00319}00319                         stat-\/>\mbox{\hyperlink{structng__cisco__stats_ae1b12a1e26f2db46f42bb54aeeefca27}{keepAlivePeriod}} = \mbox{\hyperlink{ng__cisco_8c_a48d97c04f02e30c445920de5aff13595}{KEEPALIVE\_SECS}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00320}00320                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00321}00321                     \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00322}00322                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00323}00323                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00324}00324                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00325}00325                 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00326}00326                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00327}00327         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00328}00328                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00329}00329                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00330}00330         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00331}00331         \mbox{\hyperlink{netgraph_8h_a69db50ed7f968e936580df029ab5c5dc}{NG\_RESPOND\_MSG}}(error, node, item, resp);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00332}00332         \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00333}00333         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00334}00334 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00336}00336 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00337}00337 \textcolor{comment}{ * Receive data}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00338}00338 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00339}00339 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00340}\mbox{\hyperlink{ng__cisco_8c_a5b18c368921c7005bcfc49ef93023211}{00340}} \mbox{\hyperlink{ng__cisco_8c_a6cc3be4ea94c62fb8b8c25fc4e9db604}{cisco\_rcvdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00341}00341 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00342}00342         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00343}00343         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} *pep;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00344}00344         \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__header}{cisco\_header}} *h;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00345}00345         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00346}00346         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00348}00348         \textcolor{keywordflow}{if} ((pep = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook)) == NULL)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00349}00349                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00350}00350 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00351}00351         \textcolor{comment}{/* If it came from our downlink, deal with it separately */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00352}00352         \textcolor{keywordflow}{if} (pep-\/>\mbox{\hyperlink{structprotoent_a893376ddc0a43c574731d8058e6d78e6}{af}} == 0xffff)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00353}00353                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ng__cisco_8c_a31cb2f9e647ba07ed3dc42351a3dca76}{cisco\_input}}(sc, item));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00354}00354 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00355}00355         \textcolor{comment}{/* OK so it came from a protocol, heading out. Prepend general data}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00356}00356 \textcolor{comment}{           packet header. For now, IP,IPX only  */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00357}00357         \mbox{\hyperlink{netgraph_8h_abbb0acb5f480576cff9901caddeef57f}{NGI\_GET\_M}}(item, m);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00358}00358         M\_PREPEND(m, \mbox{\hyperlink{ng__cisco_8c_a965d83d9a377b2aff2d60fe5080c4d48}{CISCO\_HEADER\_LEN}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00359}00359         \textcolor{keywordflow}{if} (!m) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00360}00360                 error = ENOBUFS;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00361}00361                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00362}00362         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00363}00363         \mbox{\hyperlink{netgraph_8h_a08cf471587aa844de10e9c3c1d7a8c28}{NGI\_M}}(item) = m;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00364}00364         h = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structcisco__header}{cisco\_header}} *);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00365}00365         h-\/>\mbox{\hyperlink{structcisco__header_a9d51b6e0c2f2826ff1b0a3d9fb417a61}{address}} = \mbox{\hyperlink{ng__cisco_8c_aac3ec9a36f804468333a954b014e250e}{CISCO\_UNICAST}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00366}00366         h-\/>\mbox{\hyperlink{structcisco__header_ad9ec3c60a63566cd50d797bcf4757c63}{control}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00368}00368         \textcolor{keywordflow}{switch} (pep-\/>\mbox{\hyperlink{structprotoent_a893376ddc0a43c574731d8058e6d78e6}{af}}) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00369}00369         \textcolor{keywordflow}{case} AF\_INET:           \textcolor{comment}{/* Internet Protocol */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00370}00370                 h-\/>\mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{protocol}} = htons(ETHERTYPE\_IP);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00371}00371                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00372}00372         \textcolor{keywordflow}{case} AF\_INET6:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00373}00373                 h-\/>\mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{protocol}} = htons(ETHERTYPE\_IPV6);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00374}00374                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00375}00375         \textcolor{keywordflow}{case} AF\_APPLETALK:      \textcolor{comment}{/* AppleTalk Protocol */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00376}00376                 h-\/>\mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{protocol}} = htons(ETHERTYPE\_AT);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00377}00377                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00378}00378         \textcolor{keywordflow}{case} AF\_IPX:            \textcolor{comment}{/* Novell IPX Protocol */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00379}00379                 h-\/>\mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{protocol}} = htons(ETHERTYPE\_IPX);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00380}00380                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00381}00381         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00382}00382                 error = EAFNOSUPPORT;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00383}00383                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00384}00384         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00385}00385 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00386}00386         \textcolor{comment}{/* Send it */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00387}00387         \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item,  sc-\/>downstream.hook, m);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00388}00388         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00390}00390 out:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00391}00391         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00392}00392         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00393}00393 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00395}00395 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00396}00396 \textcolor{comment}{ * Shutdown node}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00397}00397 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00398}00398 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00399}\mbox{\hyperlink{ng__cisco_8c_aa5f7c23ccdf58235ccea685eadfa410c}{00399}} \mbox{\hyperlink{ng__cisco_8c_a44af1f5210528e815b485b61dc5fefa8}{cisco\_shutdown}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00400}00400 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00401}00401         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00403}00403         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, NULL);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00404}00404         \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00405}00405         free(sc, M\_NETGRAPH);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00406}00406         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00407}00407 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00409}00409 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00410}00410 \textcolor{comment}{ * Disconnection of a hook}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00411}00411 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00412}00412 \textcolor{comment}{ * For this type, removal of the last link destroys the node}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00413}00413 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00414}00414 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00415}\mbox{\hyperlink{ng__cisco_8c_ac3cd90ff9abdb18c9831bfe123fbf1e7}{00415}} \mbox{\hyperlink{ng__cisco_8c_aa4054415e304c433756dd58094ce6d62}{cisco\_disconnect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00416}00416 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00417}00417         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00418}00418         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} *pep;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00420}00420         \textcolor{comment}{/* Check it's not the debug hook */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00421}00421         \textcolor{keywordflow}{if} ((pep = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}}))) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00422}00422                 pep-\/>\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00423}00423                 \textcolor{keywordflow}{if} (pep-\/>\mbox{\hyperlink{structprotoent_a893376ddc0a43c574731d8058e6d78e6}{af}} == 0xffff)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00424}00424                         \textcolor{comment}{/* If it is the downstream hook, stop the timers */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00425}00425                         \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&sc-\/>handle, \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}}));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00426}00426         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00427}00427 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00428}00428         \textcolor{comment}{/* If no more hooks, remove the node */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00429}00429         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{netgraph_8h_ad47e204c5b3adaddfa4bf0c380234f48}{NG\_NODE\_NUMHOOKS}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}})) == 0)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00430}00430         \&\& (\mbox{\hyperlink{netgraph_8h_a6bdd56e0f33084eeaadbe696febcbbd8}{NG\_NODE\_IS\_VALID}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}}))))}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00431}00431                 \mbox{\hyperlink{netgraph_8h_a85914ce0da2b314478aaf7efcdcd3ff0}{ng\_rmnode\_self}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}}));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00432}00432         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00433}00433 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00434}00434 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00435}00435 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00436}00436 \textcolor{comment}{ * Receive data}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00437}00437 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00438}00438 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00439}\mbox{\hyperlink{ng__cisco_8c_a31cb2f9e647ba07ed3dc42351a3dca76}{00439}} \mbox{\hyperlink{ng__cisco_8c_a31cb2f9e647ba07ed3dc42351a3dca76}{cisco\_input}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00440}00440 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00441}00441         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__header}{cisco\_header}} *h;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00442}00442         \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__header}{cisco\_header}} hdrbuf;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00443}00443         \textcolor{keyword}{struct }\mbox{\hyperlink{structprotoent}{protoent}} *pep;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00444}00444         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00445}00445         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00447}00447         \textcolor{comment}{/* Get data */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00448}00448         m = \mbox{\hyperlink{netgraph_8h_a08cf471587aa844de10e9c3c1d7a8c28}{NGI\_M}}(item);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00449}00449 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00450}00450         \textcolor{comment}{/* Sanity check header length */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00451}00451         \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len < \textcolor{keyword}{sizeof}(*h)) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00452}00452                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00453}00453                 \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00454}00454         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00455}00455 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00456}00456         \textcolor{comment}{/* Get cisco header */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00457}00457         \textcolor{keywordflow}{if} (m-\/>m\_len >= \textcolor{keyword}{sizeof}(*h))                     \textcolor{comment}{/* the common case */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00458}00458                 h = mtod(m, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structcisco__header}{cisco\_header}} *);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00459}00459         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00460}00460                 m\_copydata(m, 0, \textcolor{keyword}{sizeof}(*h), (caddr\_t)\&hdrbuf);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00461}00461                 h = \&hdrbuf;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00462}00462         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00463}00463         m\_adj(m, \textcolor{keyword}{sizeof}(*h));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00464}00464 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00465}00465         \textcolor{comment}{/* Check header address */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00466}00466         \textcolor{keywordflow}{switch} (h-\/>\mbox{\hyperlink{structcisco__header_a9d51b6e0c2f2826ff1b0a3d9fb417a61}{address}}) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00467}00467         \textcolor{keywordflow}{default}:                \textcolor{comment}{/* Invalid Cisco packet. */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00468}00468                 \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00469}00469         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8c_aac3ec9a36f804468333a954b014e250e}{CISCO\_UNICAST}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00470}00470         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8c_a60dff2288a30a3e9c1d67ac0be3be860}{CISCO\_MULTICAST}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00471}00471                 \textcolor{comment}{/* Don't check the control field here (RFC 1547). */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00472}00472                 \textcolor{keywordflow}{switch} (ntohs(h-\/>\mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{protocol}})) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00473}00473                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00474}00474                         \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00475}00475                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8c_ab0376c180f7944d3af1206ac5a2b1ace}{CISCO\_KEEPALIVE}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00476}00476                     \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00477}00477                         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__packet}{cisco\_packet}} *p;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00478}00478                         \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__packet}{cisco\_packet}} pktbuf;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00480}00480                         \textcolor{comment}{/* Sanity check packet length */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00481}00481                         \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len < \textcolor{keyword}{sizeof}(*p)) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00482}00482                                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00483}00483                                 \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00484}00484                         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00486}00486                         \textcolor{comment}{/* Get cisco packet */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00487}00487                         \textcolor{keywordflow}{if} (m-\/>m\_len >= \textcolor{keyword}{sizeof}(*p))     \textcolor{comment}{/* the common case */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00488}00488                                 p = mtod(m, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structcisco__packet}{cisco\_packet}} *);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00489}00489                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00490}00490                                 m\_copydata(m, 0, \textcolor{keyword}{sizeof}(*p), (caddr\_t)\&pktbuf);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00491}00491                                 p = \&pktbuf;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00492}00492                         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00494}00494                         \textcolor{comment}{/* Check packet type */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00495}00495                         \textcolor{keywordflow}{switch} (ntohl(p-\/>\mbox{\hyperlink{structcisco__packet_afa94105ee746b077e62e2abc2f4ff08c}{type}})) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00496}00496                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00497}00497                                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00498}00498                                     \textcolor{stringliteral}{"{}cisco: unknown cisco packet type: 0x\%lx\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00499}00499                                        (\textcolor{keywordtype}{long})ntohl(p-\/>\mbox{\hyperlink{structcisco__packet_afa94105ee746b077e62e2abc2f4ff08c}{type}}));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00500}00500                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00501}00501                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8c_a31f34eecad0fb9dbc3015d3ed1ac32b5}{CISCO\_ADDR\_REPLY}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00502}00502                                 \textcolor{comment}{/* Reply on address request, ignore */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00503}00503                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00504}00504                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8c_a40b80bee295708bad4bf44adff7550c5}{CISCO\_KEEPALIVE\_REQ}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00505}00505                                 sc-\/>remote\_seq = ntohl(p-\/>\mbox{\hyperlink{structcisco__packet_a9d340c8e32bab0bd8d9d6f4d22f4e40b}{par1}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00506}00506                                 \textcolor{keywordflow}{if} (sc-\/>local\_seq == ntohl(p-\/>\mbox{\hyperlink{structcisco__packet_a2dc1f53e0ed18c2724a13cb05806ac75}{par2}})) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00507}00507                                         sc-\/>local\_seq++;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00508}00508                                         \textcolor{keywordflow}{if} (sc-\/>seqRetries > 1)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00509}00509                                                 \mbox{\hyperlink{ng__cisco_8c_aef442729c255816ab9da5449572181e8}{cisco\_notify}}(sc, \mbox{\hyperlink{ng__message_8h_a79fe41f87c78cdb19b4a7d3fb5f9ebac}{NGM\_LINK\_IS\_UP}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00510}00510                                         sc-\/>seqRetries = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00511}00511                                 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00512}00512                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00513}00513                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__cisco_8c_abcda11fd5c94cb9311e38a79a1e58bb3}{CISCO\_ADDR\_REQ}}:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00514}00514                             \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00515}00515                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00516}00516                                 \textcolor{keywordtype}{int} dummy\_error = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00517}00517 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00518}00518                                 \textcolor{comment}{/* Ask inet peer for IP address information */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00519}00519                                 \textcolor{keywordflow}{if} (sc-\/>inet.hook == NULL)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00520}00520                                         \textcolor{keywordflow}{goto} nomsg;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00521}00521                                 \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__cisco_8h_a340e50a672f788c298bb2eb090746acc}{NGM\_CISCO\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00522}00522                                     \mbox{\hyperlink{ng__cisco_8h_a96a58e29e8dbf2b5bdeb775cba46556ea31fcd493a3d914b833cc117dc998385b}{NGM\_CISCO\_GET\_IPADDR}}, 0, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00523}00523                                 \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00524}00524                                         \textcolor{keywordflow}{goto} nomsg;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00525}00525                                 \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(dummy\_error,}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00526}00526                                     sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}}, msg, sc-\/>inet.hook, 0);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00527}00527                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00528}00528 \textcolor{comment}{                 * XXX Now maybe we should set a flag telling}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00529}00529 \textcolor{comment}{                 * our receiver to send this message when the response comes in}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00530}00530 \textcolor{comment}{                 * instead of now when the data may be bad.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00531}00531 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00532}00532                 nomsg:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00533}00533                                 \textcolor{comment}{/* Send reply to peer device */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00534}00534                                 error = \mbox{\hyperlink{ng__cisco_8c_a94c3f787373c473e822009c8e7551abe}{cisco\_send}}(sc, \mbox{\hyperlink{ng__cisco_8c_a31f34eecad0fb9dbc3015d3ed1ac32b5}{CISCO\_ADDR\_REPLY}},}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00535}00535                                             ntohl(sc-\/>localip.s\_addr),}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00536}00536                                             ntohl(sc-\/>localmask.s\_addr));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00537}00537                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00538}00538                             \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00539}00539                         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00540}00540                         \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00541}00541                     \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00542}00542                 \textcolor{keywordflow}{case} ETHERTYPE\_IP:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00543}00543                         pep = \&sc-\/>inet;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00544}00544                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00545}00545                 \textcolor{keywordflow}{case} ETHERTYPE\_IPV6:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00546}00546                         pep = \&sc-\/>inet6;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00547}00547                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00548}00548                 \textcolor{keywordflow}{case} ETHERTYPE\_AT:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00549}00549                         pep = \&sc-\/>atalk;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00550}00550                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00551}00551                 \textcolor{keywordflow}{case} ETHERTYPE\_IPX:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00552}00552                         pep = \&sc-\/>ipx;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00553}00553                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00554}00554                 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00555}00555                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00556}00556         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00557}00557 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00558}00558         \textcolor{comment}{/* Drop if payload is empty */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00559}00559         \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00560}00560                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00561}00561                 \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00562}00562         \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00564}00564         \textcolor{comment}{/* Send it on */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00565}00565         \textcolor{keywordflow}{if} (pep-\/>\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00566}00566                 \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00567}00567         \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, pep-\/>\mbox{\hyperlink{structprotoent_a7a1bb639692da821273ee5f7d5850ef4}{hook}}, m);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00568}00568         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00569}00569 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00570}00570 drop:}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00571}00571         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00572}00572         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00573}00573 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00575}00575 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00576}00576 \textcolor{comment}{ * Send keepalive packets, every 10 seconds.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00577}00577 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00578}00578 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00579}\mbox{\hyperlink{ng__cisco_8c_a18793218ebed55aa43f755df1c2014e8}{00579}} \mbox{\hyperlink{ng__cisco_8c_a18793218ebed55aa43f755df1c2014e8}{cisco\_keepalive}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{void} *arg1, \textcolor{keywordtype}{int} arg2)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00580}00580 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00581}00581         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = arg1;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00582}00582 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00583}00583         \mbox{\hyperlink{ng__cisco_8c_a94c3f787373c473e822009c8e7551abe}{cisco\_send}}(sc, \mbox{\hyperlink{ng__cisco_8c_a40b80bee295708bad4bf44adff7550c5}{CISCO\_KEEPALIVE\_REQ}}, sc-\/>local\_seq, sc-\/>remote\_seq);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00584}00584         \textcolor{keywordflow}{if} (sc-\/>seqRetries++ > 1)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00585}00585                 \mbox{\hyperlink{ng__cisco_8c_aef442729c255816ab9da5449572181e8}{cisco\_notify}}(sc, \mbox{\hyperlink{ng__message_8h_a23c644fba648d3b821d3078e2b6e16d2}{NGM\_LINK\_IS\_DOWN}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00586}00586         \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&sc-\/>handle, node, NULL, (hz * \mbox{\hyperlink{ng__cisco_8c_a48d97c04f02e30c445920de5aff13595}{KEEPALIVE\_SECS}}),}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00587}00587             \&\mbox{\hyperlink{ng__cisco_8c_a18793218ebed55aa43f755df1c2014e8}{cisco\_keepalive}}, (\textcolor{keywordtype}{void} *)sc, 0);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00588}00588 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00589}00589 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00590}00590 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00591}00591 \textcolor{comment}{ * Send Cisco keepalive packet.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00592}00592 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00593}00593 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00594}\mbox{\hyperlink{ng__cisco_8c_a94c3f787373c473e822009c8e7551abe}{00594}} \mbox{\hyperlink{ng__cisco_8c_a94c3f787373c473e822009c8e7551abe}{cisco\_send}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__btsocket__rfcomm_8h_a3cce6e7fc609fa524af48647bd518f51}{type}}, \textcolor{keywordtype}{long} par1, \textcolor{keywordtype}{long} par2)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00595}00595 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00596}00596         \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__header}{cisco\_header}} *h;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00597}00597         \textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__packet}{cisco\_packet}} *ch;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00598}00598         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00599}00599         \textcolor{keyword}{struct }timeval time;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00600}00600         uint32\_t t;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00601}00601         \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00602}00602 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00603}00603         getmicrouptime(\&time);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00605}00605         MGETHDR(m, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00606}00606         \textcolor{keywordflow}{if} (!m)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00607}00607                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00609}00609         t = time.tv\_sec * 1000 + time.tv\_usec / 1000;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00610}00610         m-\/>m\_pkthdr.len = m-\/>m\_len = \mbox{\hyperlink{ng__cisco_8c_a965d83d9a377b2aff2d60fe5080c4d48}{CISCO\_HEADER\_LEN}} + \mbox{\hyperlink{ng__cisco_8c_a29d7f2f0479756fe6d1d997dba7e4da7}{CISCO\_PACKET\_LEN}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00611}00611         m-\/>m\_pkthdr.rcvif = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00612}00612 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00613}00613         h = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structcisco__header}{cisco\_header}} *);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00614}00614         h-\/>\mbox{\hyperlink{structcisco__header_a9d51b6e0c2f2826ff1b0a3d9fb417a61}{address}} = \mbox{\hyperlink{ng__cisco_8c_a60dff2288a30a3e9c1d67ac0be3be860}{CISCO\_MULTICAST}};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00615}00615         h-\/>\mbox{\hyperlink{structcisco__header_ad9ec3c60a63566cd50d797bcf4757c63}{control}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00616}00616         h-\/>\mbox{\hyperlink{structcisco__header_af6d7dbeffcb8cf9a0dbb015f5a398ad2}{protocol}} = htons(\mbox{\hyperlink{ng__cisco_8c_ab0376c180f7944d3af1206ac5a2b1ace}{CISCO\_KEEPALIVE}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00618}00618         ch = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcisco__packet}{cisco\_packet}} *) (h + 1);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00619}00619         ch-\/>\mbox{\hyperlink{structcisco__packet_afa94105ee746b077e62e2abc2f4ff08c}{type}} = htonl(\mbox{\hyperlink{ng__btsocket__rfcomm_8h_a3cce6e7fc609fa524af48647bd518f51}{type}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00620}00620         ch-\/>\mbox{\hyperlink{structcisco__packet_a9d340c8e32bab0bd8d9d6f4d22f4e40b}{par1}} = htonl(\mbox{\hyperlink{structcisco__packet_a9d340c8e32bab0bd8d9d6f4d22f4e40b}{par1}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00621}00621         ch-\/>\mbox{\hyperlink{structcisco__packet_a2dc1f53e0ed18c2724a13cb05806ac75}{par2}} = htonl(\mbox{\hyperlink{structcisco__packet_a2dc1f53e0ed18c2724a13cb05806ac75}{par2}});}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00622}00622         ch-\/>\mbox{\hyperlink{structcisco__packet_a331b0e22cb90c948e8ddd43f589bf6ad}{rel}} = -\/1;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00623}00623         ch-\/>\mbox{\hyperlink{structcisco__packet_a93a0a0de5261dbb8bf6f31a831cbb203}{time0}} = htons((uint16\_t) (t >> 16));}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00624}00624         ch-\/>\mbox{\hyperlink{structcisco__packet_a9d6808c02f62d475cfb955d548e3ae52}{time1}} = htons((uint16\_t) t);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00626}00626         \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error, sc-\/>downstream.hook, m);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00627}00627         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00628}00628 \}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00629}00629 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00630}00630 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00631}00631 \textcolor{comment}{ * Send linkstate to upstream node.}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00632}00632 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00633}00633 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00634}\mbox{\hyperlink{ng__cisco_8c_aef442729c255816ab9da5449572181e8}{00634}} \mbox{\hyperlink{ng__cisco_8c_aef442729c255816ab9da5449572181e8}{cisco\_notify}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, uint32\_t \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}})}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00635}00635 \{}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00636}00636         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00637}00637         \textcolor{keywordtype}{int} dummy\_error = 0;}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00638}00638 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00639}00639         \textcolor{keywordflow}{if} (sc-\/>inet.hook == NULL) \textcolor{comment}{/* nothing to notify */}}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00640}00640                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00641}00641                 }
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00642}00642         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__message_8h_a788a2cd8ade33121c7b27de1799b96c8}{NGM\_FLOW\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}, 0, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00643}00643         \textcolor{keywordflow}{if} (msg != NULL)}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00644}00644                 \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(dummy\_error, sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}}, msg, sc-\/>inet.hook, 0);}
\DoxyCodeLine{\Hypertarget{ng__cisco_8c_source_l00645}00645 \}}

\end{DoxyCode}
