type
stringclasses
5 values
content
stringlengths
9
163k
includes
#include <sys/types.h>
includes
#include <sys/stat.h>
includes
#include <fcntl.h>
includes
#include <unistd.h>
includes
#include <stdio.h>
includes
#include <string.h>
includes
#include <errno.h>
functions
int getMyInfo() { int fd, status; fd = open("/dev/vme_ctl", 0); if(fd < 0){ return(1); }
functions
void usage(int argc, char *argv[]) { printf("Usage: %s window_number mode\n", argv[0]); }
main
int main(int argc, char *argv[]) { int fd; int status; vmeInWindowCfg_t vmeIn; int window, mode; if(getMyInfo()){ printf("%s: getMyInfo failed. Errno = %d\n", argv[0], errno); _exit(1); }
defines
#define x1 p
defines
#define y1 (p + ecc->p.size)
defines
#define z1 (p + 2*ecc->p.size)
defines
#define x2 q
defines
#define y2 (q + ecc->p.size)
defines
#define z2 (q + 2*ecc->p.size)
defines
#define x3 r
defines
#define y3 (r + ecc->p.size)
defines
#define z3 (r + 2*ecc->p.size)
defines
#define T scratch
defines
#define E (scratch + 1*ecc->p.size)
defines
#define G E
defines
#define C (scratch + 2*ecc->p.size)
defines
#define D (scratch + 3*ecc->p.size)
defines
#define B D
functions
void ecc_add_ehh (const struct ecc_curve *ecc, mp_limb_t *r, const mp_limb_t *p, const mp_limb_t *q, mp_limb_t *scratch) { /* Formulas (from djb, http://www.hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#addition-add-2007-bl): Computation Operation Live variables C = x1*...
includes
#include <vlib/vlib.h>
includes
#include <vnet/vnet.h>
includes
#include <vppinfra/error.h>
includes
#include <srv6-am/am.h>
defines
#define foreach_srv6_am_rewrite_counter \
defines
#define _(sym,str) SRV6_AM_REWRITE_COUNTER_##sym,
defines
#define _(sym,string) string,
functions
void end_am_processing (vlib_buffer_t * b0, ip6_header_t * ip0, ip6_sr_header_t * sr0, ip6_sr_localsid_t * ls0, u32 * next0) { ip6_address_t *new_dst0; if (PREDICT_FALSE (ip0->protocol != IP_PROTOCOL_IPV6_ROUTE || sr0->type != ROUTING_HEADER_TYPE_SR)) { *next0 = SRV6_AM_LOCALSID_NEX...
functions
uword srv6_am_localsid_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { ip6_sr_main_t *sm = &sr_main; u32 n_left_from, next_index, *from, *to_next; u32 cnt_packets = 0; from = vlib_frame_vector_args (frame); n_left_from = frame->n_vectors; next_index = node->cached_next_inde...
functions
void end_am_rewriting (vlib_node_runtime_t * node, vlib_buffer_t * b0, ip6_header_t * ip0, ip6_sr_header_t * sr0, u32 * next0) { if (PREDICT_FALSE (ip0->protocol != IP_PROTOCOL_IPV6_ROUTE || sr0->type != ROUTING_HEADER_TYPE_SR)) { b0->error = node->errors[SRV6_AM_REWRITE_COUNTER_NO_SRH]; ...
functions
uword srv6_am_rewrite_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { u32 n_left_from, next_index, *from, *to_next; u32 cnt_packets = 0; from = vlib_frame_vector_args (frame); n_left_from = frame->n_vectors; next_index = node->cached_next_index; while (n_left_from > 0) ...
includes
#include <string.h>
includes
#include <stdio.h>
defines
#define GATT_VALIDATE_HANDLE_RANGE(x, y, a, b) (y >= a && x <= b)
defines
#define GATT_GET_NEXT_VALID_HANDLE(x) (((x)/10 + 1) * 10)
functions
void gatt_free_pending_ind(tGATT_TCB *p_tcb) { GATT_TRACE_DEBUG("gatt_free_pending_ind"); if (p_tcb->pending_ind_q == NULL) { return; }
functions
void gatt_free_pending_enc_queue(tGATT_TCB *p_tcb) { GATT_TRACE_DEBUG("gatt_free_pending_enc_queue"); if (p_tcb->pending_enc_clcb == NULL) { return; }
functions
void gatt_free_pending_prepare_write_queue(tGATT_TCB *p_tcb) { GATT_TRACE_DEBUG("gatt_free_pending_prepare_write_queue"); if (p_tcb->prepare_write_record.queue) { /* release all queued prepare write packets */ while (!fixed_queue_is_empty(p_tcb->prepare_write_record.queue)) { osi_fr...
functions
void gatt_delete_dev_from_srv_chg_clt_list(BD_ADDR bd_addr) { tGATTS_SRV_CHG *p_buf; tGATTS_SRV_CHG_REQ req; GATT_TRACE_DEBUG ("gatt_delete_dev_from_srv_chg_clt_list"); if ((p_buf = gatt_is_bda_in_the_srv_chg_clt_list(bd_addr)) != NULL) { if (gatt_cb.cb_info.p_srv_chg_callback) { ...
functions
void gatt_set_srv_chg(void) { GATT_TRACE_DEBUG ("gatt_set_srv_chg"); if (fixed_queue_is_empty(gatt_cb.srv_chg_clt_q)) { return; }
functions
void gatt_free_attr_value_buffer(tGATT_HDL_LIST_ELEM *p) { if (p){ tGATT_SVC_DB *p_db = &(p->svc_db); tGATT_ATTR16 *p_attr = p_db->p_attr_list; tGATT_ATTR_VALUE *p_value = NULL; while(p_attr){ if (p_attr->mask & GATT_ATTR_VALUE_ALLOCATED){ p_value = p_att...
functions
void gatt_free_hdl_buffer(tGATT_HDL_LIST_ELEM *p) { if (p) { while (!fixed_queue_is_empty(p->svc_db.svc_buffer)) { osi_free(fixed_queue_try_dequeue(p->svc_db.svc_buffer)); }
functions
void gatt_free_srvc_db_buffer_app_id(tBT_UUID *p_app_id) { tGATT_HDL_LIST_ELEM *p_elem = &gatt_cb.hdl_list[0]; UINT8 i; for (i = 0; i < GATT_MAX_SR_PROFILES; i ++, p_elem ++) { if (memcmp(p_app_id, &p_elem->asgn_range.app_uuid128, sizeof(tBT_UUID)) == 0) { gatt_free_attr_value_buffer...
functions
BOOLEAN gatt_is_last_attribute(tGATT_SRV_LIST_INFO *p_list, tGATT_SRV_LIST_ELEM *p_start, tBT_UUID value) { tGATT_SRV_LIST_ELEM *p_srv = p_start->p_next; BOOLEAN is_last_attribute = TRUE; tGATT_SR_REG *p_rcb = NULL; tBT_UUID *p_svc_uuid; p_list->p_last_primary = NULL;...
functions
void gatt_update_last_pri_srv_info(tGATT_SRV_LIST_INFO *p_list) { tGATT_SRV_LIST_ELEM *p_srv = p_list->p_first; p_list->p_last_primary = NULL; while (p_srv) { if (p_srv->is_primary) { p_list->p_last_primary = p_srv; }
functions
void gatts_update_srv_list_elem(UINT8 i_sreg, UINT16 handle, BOOLEAN is_primary) { UNUSED(handle); gatt_cb.srv_list[i_sreg].in_use = TRUE; gatt_cb.srv_list[i_sreg].i_sreg = i_sreg; gatt_cb.srv_list[i_sreg].s_hdl = gatt_cb.sr_reg[i_sreg].s_hdl; gatt_cb.srv_list[i_sreg].is_primary...
functions
BOOLEAN gatt_add_a_srv_to_list(tGATT_SRV_LIST_INFO *p_list, tGATT_SRV_LIST_ELEM *p_new) { tGATT_SRV_LIST_ELEM *p_old; if (!p_new) { GATT_TRACE_DEBUG("p_new==NULL"); return FALSE; }
functions
BOOLEAN gatt_remove_a_srv_from_list(tGATT_SRV_LIST_INFO *p_list, tGATT_SRV_LIST_ELEM *p_remove) { if (!p_remove || !p_list->p_first) { GATT_TRACE_DEBUG("p_remove==NULL || p_list->p_first==NULL"); return FALSE; }
functions
else if (p_remove->p_next == NULL) { p_list->p_last = p_remove->p_prev; p_remove->p_prev->p_next = NULL; }
functions
BOOLEAN gatt_add_an_item_to_list(tGATT_HDL_LIST_INFO *p_list, tGATT_HDL_LIST_ELEM *p_new) { tGATT_HDL_LIST_ELEM *p_old; if (!p_new) { GATT_TRACE_DEBUG("p_new==NULL"); return FALSE; }
functions
BOOLEAN gatt_remove_an_item_from_list(tGATT_HDL_LIST_INFO *p_list, tGATT_HDL_LIST_ELEM *p_remove) { if (!p_remove || !p_list->p_first) { GATT_TRACE_DEBUG("p_remove==NULL || p_list->p_first==NULL"); return FALSE; }
functions
else if (p_remove->p_next == NULL) { p_list->p_last = p_remove->p_prev; p_remove->p_prev->p_next = NULL; }
functions
BOOLEAN gatt_find_the_connected_bda(UINT8 start_idx, BD_ADDR bda, UINT8 *p_found_idx, tBT_TRANSPORT *p_transport) { UINT8 i; BOOLEAN found = FALSE; GATT_TRACE_DEBUG("gatt_find_the_connected_bda start_idx=%d", start_idx); for (i = start_idx ; i < GATT_MAX_PHY_CHANNEL;...
functions
BOOLEAN gatt_is_srv_chg_ind_pending (tGATT_TCB *p_tcb) { BOOLEAN srv_chg_ind_pending = FALSE; GATT_TRACE_DEBUG("gatt_is_srv_chg_ind_pending is_queue_empty=%d", fixed_queue_is_empty(p_tcb->pending_ind_q)); if (p_tcb->indicate_handle == gatt_cb.handle_of_h_r) { srv_chg_ind_pendi...
functions
BOOLEAN gatt_is_bda_connected(BD_ADDR bda) { UINT8 i = 0; BOOLEAN connected = FALSE; for ( i = 0; i < GATT_MAX_PHY_CHANNEL; i ++) { if (gatt_cb.tcb[i].in_use && !memcmp(gatt_cb.tcb[i].peer_bda, bda, BD_ADDR_LEN)) { connected = TRUE; break; }
functions
UINT8 gatt_find_i_tcb_by_addr(BD_ADDR bda, tBT_TRANSPORT transport) { UINT8 i = 0; for ( ; i < GATT_MAX_PHY_CHANNEL; i ++) { if (!memcmp(gatt_cb.tcb[i].peer_bda, bda, BD_ADDR_LEN) && gatt_cb.tcb[i].transport == transport) { return i; }
functions
UINT8 gatt_find_i_tcb_free(void) { UINT8 i = 0, j = GATT_INDEX_INVALID; for (i = 0; i < GATT_MAX_PHY_CHANNEL; i ++) { if (!gatt_cb.tcb[i].in_use) { j = i; break; }
functions
void gatt_convert_uuid16_to_uuid128(UINT8 uuid_128[LEN_UUID_128], UINT16 uuid_16) { UINT8 *p = &uuid_128[LEN_UUID_128 - 4]; memcpy (uuid_128, base_uuid, LEN_UUID_128); UINT16_TO_STREAM(p, uuid_16); }
functions
void gatt_convert_uuid32_to_uuid128(UINT8 uuid_128[LEN_UUID_128], UINT32 uuid_32) { UINT8 *p = &uuid_128[LEN_UUID_128 - 4]; memcpy (uuid_128, base_uuid, LEN_UUID_128); UINT32_TO_STREAM(p, uuid_32); }
functions
BOOLEAN gatt_uuid_compare (tBT_UUID src, tBT_UUID tar) { UINT8 su[LEN_UUID_128], tu[LEN_UUID_128]; UINT8 *ps, *pt; /* any of the UUID is unspecified */ if (src.len == 0 || tar.len == 0) { return TRUE; }
functions
else if (src.len == LEN_UUID_32) { gatt_convert_uuid32_to_uuid128(su, src.uu.uuid32); ps = su; }
functions
else if (tar.len == LEN_UUID_32) { /* convert a 32 bits UUID to 128 bits value */ gatt_convert_uuid32_to_uuid128(tu, tar.uu.uuid32); pt = tu; }
functions
UINT8 gatt_build_uuid_to_stream(UINT8 **p_dst, tBT_UUID uuid) { UINT8 *p = *p_dst; UINT8 len = 0; if (uuid.len == LEN_UUID_16) { UINT16_TO_STREAM (p, uuid.uu.uuid16); len = LEN_UUID_16; }
functions
else if (uuid.len == LEN_UUID_32) { /* always convert 32 bits into 128 bits as alwats */ gatt_convert_uuid32_to_uuid128(p, uuid.uu.uuid32); p += LEN_UUID_128; len = LEN_UUID_128; }
functions
else if (uuid.len == LEN_UUID_128) { ARRAY_TO_STREAM (p, uuid.uu.uuid128, LEN_UUID_128); len = LEN_UUID_128; }
functions
BOOLEAN gatt_parse_uuid_from_cmd(tBT_UUID *p_uuid_rec, UINT16 uuid_size, UINT8 **p_data) { BOOLEAN is_base_uuid, ret = TRUE; UINT8 xx; UINT8 *p_uuid = *p_data; memset(p_uuid_rec, 0, sizeof(tBT_UUID)); switch (uuid_size) { case LEN_UUID_16: p_uuid_rec->len = uuid_size; STREAM_T...
functions
void gatt_start_rsp_timer(UINT16 clcb_idx) { tGATT_CLCB *p_clcb = &gatt_cb.clcb[clcb_idx]; UINT32 timeout = GATT_WAIT_FOR_RSP_TOUT; p_clcb->rsp_timer_ent.param = (TIMER_PARAM_TYPE)p_clcb; if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY && p_clcb->op_subtype == GATT_DISC_SRVC_ALL) { ...
functions
void gatt_start_conf_timer(tGATT_TCB *p_tcb) { p_tcb->conf_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb; btu_start_timer (&p_tcb->conf_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_RSP, GATT_WAIT_FOR_RSP_TOUT); }
functions
void gatt_start_ind_ack_timer(tGATT_TCB *p_tcb) { p_tcb->ind_ack_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb; /* start notification cache timer */ btu_start_timer (&p_tcb->ind_ack_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_IND_ACK, GATT_WAIT_FOR_IND_ACK_TOUT); }
functions
void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle) { tGATT_CLCB *p_clcb = (tGATT_CLCB *)p_tle->param; if (p_clcb == NULL || p_clcb->p_tcb == NULL) { GATT_TRACE_WARNING("gatt_rsp_timeout clcb is already deleted"); return; }
functions
void gatt_ind_ack_timeout(TIMER_LIST_ENT *p_tle) { tGATT_TCB *p_tcb = (tGATT_TCB *)p_tle->param; GATT_TRACE_WARNING("gatt_ind_ack_timeout send ack now"); if (p_tcb != NULL) { p_tcb->ind_count = 0; }
functions
UINT8 gatt_sr_find_i_rcb_by_handle(UINT16 handle) { UINT8 i_rcb = 0; for ( ; i_rcb < GATT_MAX_SR_PROFILES; i_rcb++) { if (gatt_cb.sr_reg[i_rcb].in_use && gatt_cb.sr_reg[i_rcb].s_hdl <= handle && gatt_cb.sr_reg[i_rcb].e_hdl >= handle ) { break; }
functions
UINT8 gatt_sr_find_i_rcb_by_app_id(tBT_UUID *p_app_uuid128, tBT_UUID *p_svc_uuid, UINT16 svc_inst) { UINT8 i_rcb = 0; tGATT_SR_REG *p_sreg; tBT_UUID *p_this_uuid; for (i_rcb = 0, p_sreg = gatt_cb.sr_reg; i_rcb < GATT_MAX_SR_PROFILES; i_rcb++, p_sreg++) { if ( p_sreg->in_use ...
functions
UINT8 gatt_sr_alloc_rcb(tGATT_HDL_LIST_ELEM *p_list ) { UINT8 ii = 0; tGATT_SR_REG *p_sreg = NULL; /*this is a new application servoce start */ for (ii = 0, p_sreg = gatt_cb.sr_reg; ii < GATT_MAX_SR_PROFILES; ii++, p_sreg++) { if (!p_sreg->in_use) { memset (p_sreg, 0, sizeof(tG...
functions
void gatt_sr_get_sec_info(BD_ADDR rem_bda, tBT_TRANSPORT transport, UINT8 *p_sec_flag, UINT8 *p_key_size) { UINT8 sec_flag = 0; BTM_GetSecurityFlagsByTransport(rem_bda, &sec_flag, transport); sec_flag &= (GATT_SEC_FLAG_LKEY_UNAUTHED | GATT_SEC_FLAG_LKEY_AUTHED | GATT_SEC_FLAG_ENCRYPTED); #if (SM...
functions
void gatt_sr_send_req_callback(UINT16 conn_id, UINT32 trans_id, tGATTS_REQ_TYPE type, tGATTS_DATA *p_data) { tGATT_IF gatt_if = GATT_GET_GATT_IF(conn_id); tGATT_REG *p_reg = gatt_get_regcb(gatt_if); if (!p_reg ) { GATT_TRACE...
functions
tGATT_STATUS gatt_send_error_rsp (tGATT_TCB *p_tcb, UINT8 err_code, UINT8 op_code, UINT16 handle, BOOLEAN deq) { tGATT_ERROR error; tGATT_STATUS status; BT_HDR *p_buf; error.cmd_code = op_code; error.reason = err_code; error.handle = handle; ...
functions
UINT32 gatt_add_sdp_record (tBT_UUID *p_uuid, UINT16 start_hdl, UINT16 end_hdl) { tSDP_PROTOCOL_ELEM proto_elem_list[2]; UINT32 sdp_handle; UINT16 list = UUID_SERVCLASS_PUBLIC_BROWSE_GROUP; UINT8 buff[60]; UINT8 *p = buff; GATT_TRACE_DEBUG(...
functions
void gatt_set_err_rsp(BOOLEAN enable, UINT8 req_op_code, UINT8 err_status) { GATT_TRACE_DEBUG("gatt_set_err_rsp enable=%d op_code=%d, err_status=%d", enable, req_op_code, err_status); gatt_cb.enable_err_rsp = enable; gatt_cb.req_op_code = req_op_code; gatt_cb.err_status = err_status; }
functions
BOOLEAN gatt_is_clcb_allocated (UINT16 conn_id) { UINT8 i = 0; BOOLEAN is_allocated = FALSE; for (i = 0; i < GATT_CL_MAX_LCB; i++) { if (gatt_cb.clcb[i].in_use && (gatt_cb.clcb[i].conn_id == conn_id)) { is_allocated = TRUE; break; }
functions
void gatt_clcb_dealloc (tGATT_CLCB *p_clcb) { if (p_clcb && p_clcb->in_use) { memset(p_clcb, 0, sizeof(tGATT_CLCB)); }
functions
UINT8 gatt_num_apps_hold_link(tGATT_TCB *p_tcb) { UINT8 i, num = 0; for (i = 0; i < GATT_MAX_APPS; i ++) { if (p_tcb->app_hold_link[i]) { num ++; }
functions
UINT8 gatt_num_clcb_by_bd_addr(BD_ADDR bda) { UINT8 i, num = 0; for (i = 0; i < GATT_CL_MAX_LCB; i ++) { if (gatt_cb.clcb[i].in_use && memcmp(gatt_cb.clcb[i].p_tcb->peer_bda, bda, BD_ADDR_LEN) == 0) { num ++; }
functions
void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB *p_tcb ) { #if (GATTS_INCLUDED == TRUE) UINT8 i; if (p_tcb) { for (i = 0; i < GATT_MAX_APPS; i ++) { if (p_tcb->prep_cnt[i]) { p_tcb->sr_cmd.cback_cnt[i] = 1; }
functions
BOOLEAN gatt_sr_is_cback_cnt_zero(tGATT_TCB *p_tcb ) { BOOLEAN status = TRUE; #if (GATTS_INCLUDED == TRUE) UINT8 i; if (p_tcb) { for (i = 0; i < GATT_MAX_APPS; i ++) { if (p_tcb->sr_cmd.cback_cnt[i]) { status = FALSE; break; }
functions
BOOLEAN gatt_sr_is_prep_cnt_zero(tGATT_TCB *p_tcb) { BOOLEAN status = TRUE; UINT8 i; if (p_tcb) { for (i = 0; i < GATT_MAX_APPS; i ++) { if (p_tcb->prep_cnt[i]) { status = FALSE; break; }
functions
void gatt_sr_reset_cback_cnt(tGATT_TCB *p_tcb ) { #if (GATTS_INCLUDED == TRUE) UINT8 i; if (p_tcb) { for (i = 0; i < GATT_MAX_APPS; i ++) { p_tcb->sr_cmd.cback_cnt[i] = 0; }
functions
void gatt_sr_reset_prep_cnt(tGATT_TCB *p_tcb ) { UINT8 i; if (p_tcb) { for (i = 0; i < GATT_MAX_APPS; i ++) { p_tcb->prep_cnt[i] = 0; }
functions
void gatt_sr_update_cback_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, BOOLEAN is_reset_first) { #if (GATTS_INCLUDED == TRUE) UINT8 idx = ((UINT8) gatt_if) - 1 ; if (p_tcb) { if (is_reset_first) { gatt_sr_reset_cback_cnt(p_tcb); }
functions
void gatt_sr_update_prep_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, BOOLEAN is_reset_first) { UINT8 idx = ((UINT8) gatt_if) - 1 ; GATT_TRACE_DEBUG("gatt_sr_update_prep_cnt tcb idx=%d gatt_if=%d is_inc=%d is_reset_first=%d", p_tcb->tcb_idx, gatt_if, is_inc, is_reset_first); ...
functions
BOOLEAN gatt_cancel_open(tGATT_IF gatt_if, BD_ADDR bda) { tGATT_TCB *p_tcb = NULL; BOOLEAN status = TRUE; p_tcb = gatt_find_tcb_by_addr(bda, BT_TRANSPORT_LE); if (p_tcb) { if (gatt_get_ch_state(p_tcb) == GATT_CH_OPEN) { GATT_TRACE_ERROR("GATT_CancelConnect - link connected Too late...
functions
BOOLEAN gatt_find_app_hold_link(tGATT_TCB *p_tcb, UINT8 start_idx, UINT8 *p_found_idx, tGATT_IF *p_gatt_if) { UINT8 i; BOOLEAN found = FALSE; for (i = start_idx; i < GATT_MAX_APPS; i ++) { if (p_tcb->app_hold_link[i]) { *p_gatt_if = gatt_cb.clcb[i].p_reg->gatt_if; *p_found_i...
functions
BOOLEAN gatt_cmd_enq(tGATT_TCB *p_tcb, UINT16 clcb_idx, BOOLEAN to_send, UINT8 op_code, BT_HDR *p_buf) { tGATT_CMD_Q *p_cmd = &p_tcb->cl_cmd_q[p_tcb->next_slot_inq]; p_cmd->to_send = to_send; /* waiting to be sent */ p_cmd->op_code = op_code; p_cmd->p_cmd = p_buf; p_cmd->clcb_idx = clcb_idx; ...
functions
UINT8 gatt_send_write_msg (tGATT_TCB *p_tcb, UINT16 clcb_idx, UINT8 op_code, UINT16 handle, UINT16 len, UINT16 offset, UINT8 *p_data) { tGATT_CL_MSG msg; msg.attr_value.handle = handle; msg.attr_value.len = len; msg.attr_value.offset = offset; ...