FreeBSD kernel netgraph code
ng_l2cap_misc.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/queue.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/bluetooth/include/ng_bluetooth.h>
#include <netgraph/bluetooth/include/ng_hci.h>
#include <netgraph/bluetooth/include/ng_l2cap.h>
#include <netgraph/bluetooth/l2cap/ng_l2cap_var.h>
#include <netgraph/bluetooth/l2cap/ng_l2cap_cmds.h>
#include <netgraph/bluetooth/l2cap/ng_l2cap_evnt.h>
#include <netgraph/bluetooth/l2cap/ng_l2cap_llpi.h>
#include <netgraph/bluetooth/l2cap/ng_l2cap_ulpi.h>
#include <netgraph/bluetooth/l2cap/ng_l2cap_misc.h>
Include dependency graph for ng_l2cap_misc.c:

Go to the source code of this file.

Functions

static u_int16_t ng_l2cap_get_cid (ng_l2cap_p, int)
 
void ng_l2cap_send_hook_info (node_p node, hook_p hook, void *arg1, int arg2)
 
ng_l2cap_con_p ng_l2cap_new_con (ng_l2cap_p l2cap, bdaddr_p bdaddr, int type)
 
void ng_l2cap_con_ref (ng_l2cap_con_p con)
 
void ng_l2cap_con_unref (ng_l2cap_con_p con)
 
int ng_l2cap_discon_timeout (ng_l2cap_con_p con)
 
int ng_l2cap_discon_untimeout (ng_l2cap_con_p con)
 
void ng_l2cap_free_con (ng_l2cap_con_p con)
 
ng_l2cap_con_p ng_l2cap_con_by_addr (ng_l2cap_p l2cap, bdaddr_p bdaddr, unsigned int type)
 
ng_l2cap_con_p ng_l2cap_con_by_handle (ng_l2cap_p l2cap, u_int16_t con_handle)
 
ng_l2cap_chan_p ng_l2cap_new_chan (ng_l2cap_p l2cap, ng_l2cap_con_p con, u_int16_t psm, int idtype)
 
ng_l2cap_chan_p ng_l2cap_chan_by_scid (ng_l2cap_p l2cap, u_int16_t scid, int idtype)
 
ng_l2cap_chan_p ng_l2cap_chan_by_conhandle (ng_l2cap_p l2cap, uint16_t scid, u_int16_t con_handle)
 
void ng_l2cap_free_chan (ng_l2cap_chan_p ch)
 
ng_l2cap_cmd_p ng_l2cap_new_cmd (ng_l2cap_con_p con, ng_l2cap_chan_p ch, u_int8_t ident, u_int8_t code, u_int32_t token)
 
ng_l2cap_cmd_p ng_l2cap_cmd_by_ident (ng_l2cap_con_p con, u_int8_t ident)
 
int ng_l2cap_lp_timeout (ng_l2cap_con_p con)
 
int ng_l2cap_lp_untimeout (ng_l2cap_con_p con)
 
int ng_l2cap_command_timeout (ng_l2cap_cmd_p cmd, int timo)
 
int ng_l2cap_command_untimeout (ng_l2cap_cmd_p cmd)
 
struct mbuf * ng_l2cap_prepend (struct mbuf *m, int size)
 
ng_l2cap_flow_p ng_l2cap_default_flow (void)
 
u_int8_t ng_l2cap_get_ident (ng_l2cap_con_p con)
 

Function Documentation

◆ ng_l2cap_chan_by_conhandle()

ng_l2cap_chan_p ng_l2cap_chan_by_conhandle ( ng_l2cap_p  l2cap,
uint16_t  scid,
u_int16_t  con_handle 
)

Definition at line 405 of file ng_l2cap_misc.c.

References ng_l2cap_chan::con, ng_l2cap_con::con_handle, scid, and ng_l2cap_chan::scid.

Referenced by ng_l2cap_l2ca_discon_req(), ng_l2cap_l2ca_receive(), and ng_l2cap_l2ca_write_req().

Here is the caller graph for this function:

◆ ng_l2cap_chan_by_scid()

◆ ng_l2cap_cmd_by_ident()

◆ ng_l2cap_command_timeout()

int ng_l2cap_command_timeout ( ng_l2cap_cmd_p  cmd,
int  timo 
)

Definition at line 551 of file ng_l2cap_misc.c.

References ng_callout(), NG_L2CAP_CMD_PENDING, ng_l2cap_process_command_timeout(), and NG_NODE_NAME.

Referenced by ng_l2cap_con_wakeup(), ng_l2cap_process_cfg_rsp(), and ng_l2cap_process_con_rsp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_l2cap_command_untimeout()

int ng_l2cap_command_untimeout ( ng_l2cap_cmd_p  cmd)

◆ ng_l2cap_con_by_addr()

ng_l2cap_con_p ng_l2cap_con_by_addr ( ng_l2cap_p  l2cap,
bdaddr_p  bdaddr,
unsigned int  type 
)

◆ ng_l2cap_con_by_handle()

◆ ng_l2cap_con_ref()

void ng_l2cap_con_ref ( ng_l2cap_con_p  con)

Definition at line 156 of file ng_l2cap_misc.c.

References ng_l2cap_con::flags, ng_l2cap_con::l2cap, NG_L2CAP_CON_AUTO_DISCON_TIMO, NG_L2CAP_CON_OPEN, NG_L2CAP_CON_OUTGOING, ng_l2cap_discon_untimeout(), NG_NODE_NAME, ng_l2cap::node, ng_l2cap_con::refcnt, and ng_l2cap_con::state.

Referenced by ng_l2cap_new_chan().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_l2cap_con_unref()

void ng_l2cap_con_unref ( ng_l2cap_con_p  con)

Definition at line 177 of file ng_l2cap_misc.c.

References ng_l2cap::discon_timo, ng_l2cap_con::flags, ng_l2cap_con::l2cap, NG_L2CAP_CON_DYING, NG_L2CAP_CON_OPEN, NG_L2CAP_CON_OUTGOING, ng_l2cap_discon_timeout(), NG_NODE_NAME, ng_l2cap::node, ng_l2cap_con::refcnt, and ng_l2cap_con::state.

Referenced by ng_l2cap_free_chan().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_l2cap_default_flow()

ng_l2cap_flow_p ng_l2cap_default_flow ( void  )

Definition at line 609 of file ng_l2cap_misc.c.

References NG_HCI_SERVICE_TYPE_BEST_EFFORT.

Referenced by ng_l2cap_l2ca_cfg_req(), and ng_l2cap_new_chan().

Here is the caller graph for this function:

◆ ng_l2cap_discon_timeout()

int ng_l2cap_discon_timeout ( ng_l2cap_con_p  con)

◆ ng_l2cap_discon_untimeout()

int ng_l2cap_discon_untimeout ( ng_l2cap_con_p  con)

Definition at line 230 of file ng_l2cap_misc.c.

References ng_l2cap_con::con_timo, ng_l2cap_con::flags, ng_l2cap_con::l2cap, NG_L2CAP_CON_AUTO_DISCON_TIMO, NG_NODE_NAME, ng_uncallout(), ng_l2cap::node, and ng_l2cap_con::state.

Referenced by ng_l2cap_cleanup(), ng_l2cap_con_ref(), and ng_l2cap_lp_discon_ind().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_l2cap_free_chan()

◆ ng_l2cap_free_con()

◆ ng_l2cap_get_cid()

static u_int16_t ng_l2cap_get_cid ( ng_l2cap_p  l2cap,
int  isle 
)
static

Definition at line 630 of file ng_l2cap_misc.c.

References ng_l2cap::cid, ng_l2cap::lecid, ng_l2cap_chan_by_scid(), NG_L2CAP_FIRST_CID, NG_L2CAP_L2CA_IDTYPE_BREDR, NG_L2CAP_L2CA_IDTYPE_LE, NG_L2CAP_LAST_CID, NG_L2CAP_LELAST_CID, and NG_L2CAP_NULL_CID.

Referenced by ng_l2cap_new_chan().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_l2cap_get_ident()

u_int8_t ng_l2cap_get_ident ( ng_l2cap_con_p  con)

Definition at line 677 of file ng_l2cap_misc.c.

References ng_l2cap_con::ident, ng_l2cap_cmd_by_ident(), NG_L2CAP_FIRST_IDENT, and NG_L2CAP_NULL_IDENT.

Referenced by ng_l2cap_l2ca_cfg_req(), ng_l2cap_l2ca_con_req(), ng_l2cap_l2ca_discon_req(), ng_l2cap_l2ca_get_info_req(), and ng_l2cap_l2ca_ping_req().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_l2cap_lp_timeout()

◆ ng_l2cap_lp_untimeout()

int ng_l2cap_lp_untimeout ( ng_l2cap_con_p  con)

Definition at line 529 of file ng_l2cap_misc.c.

References ng_l2cap_con::con_timo, ng_l2cap_con::flags, ng_l2cap_con::l2cap, NG_L2CAP_CON_LP_TIMO, NG_NODE_NAME, ng_uncallout(), ng_l2cap::node, and ng_l2cap_con::state.

Referenced by ng_l2cap_cleanup(), ng_l2cap_lp_con_cfm(), ng_l2cap_lp_con_ind(), and ng_l2cap_lp_con_req().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_l2cap_new_chan()

◆ ng_l2cap_new_cmd()

◆ ng_l2cap_new_con()

◆ ng_l2cap_prepend()

struct mbuf * ng_l2cap_prepend ( struct mbuf *  m,
int  size 
)

Definition at line 595 of file ng_l2cap_misc.c.

Referenced by ng_l2cap_con_wakeup(), ng_l2cap_lp_send(), and ng_l2cap_process_echo_req().

Here is the caller graph for this function:

◆ ng_l2cap_send_hook_info()

void ng_l2cap_send_hook_info ( node_p  node,
hook_p  hook,
void *  arg1,
int  arg2 
)