/external/boringssl/src/crypto/stack/ |
D | stack.c | 98 size_t sk_num(const _STACK *sk) { in sk_num() argument 99 if (sk == NULL) { in sk_num() 102 return sk->num; in sk_num() 105 void sk_zero(_STACK *sk) { in sk_zero() argument 106 if (sk == NULL || sk->num == 0) { in sk_zero() 109 OPENSSL_memset(sk->data, 0, sizeof(void*) * sk->num); in sk_zero() 110 sk->num = 0; in sk_zero() 111 sk->sorted = 0; in sk_zero() 114 void *sk_value(const _STACK *sk, size_t i) { in sk_value() argument 115 if (!sk || i >= sk->num) { in sk_value() [all …]
|
/external/libnl/lib/ |
D | socket.c | 183 struct nl_sock *sk; in __alloc_socket() local 185 sk = calloc(1, sizeof(*sk)); in __alloc_socket() 186 if (!sk) in __alloc_socket() 189 sk->s_fd = -1; in __alloc_socket() 190 sk->s_cb = nl_cb_get(cb); in __alloc_socket() 191 sk->s_local.nl_family = AF_NETLINK; in __alloc_socket() 192 sk->s_peer.nl_family = AF_NETLINK; in __alloc_socket() 193 sk->s_seq_expect = sk->s_seq_next = time(0); in __alloc_socket() 196 sk->s_flags = NL_OWN_PORT; in __alloc_socket() 198 return sk; in __alloc_socket() [all …]
|
D | nl.c | 96 int nl_connect(struct nl_sock *sk, int protocol) in nl_connect() argument 106 if (sk->s_fd != -1) in nl_connect() 109 sk->s_fd = socket(AF_NETLINK, SOCK_RAW | flags, protocol); in nl_connect() 110 if (sk->s_fd < 0) { in nl_connect() 112 NL_DBG(4, "nl_connect(%p): socket() failed with %d\n", sk, errsv); in nl_connect() 117 if (!(sk->s_flags & NL_SOCK_BUFSIZE_SET)) { in nl_connect() 118 err = nl_socket_set_buffer_size(sk, 0, 0); in nl_connect() 123 if (_nl_socket_is_local_port_unspecified (sk)) { in nl_connect() 128 port = _nl_socket_generate_local_port_no_release(sk); in nl_connect() 131 NL_DBG(4, "nl_connect(%p): no more unused local ports.\n", sk); in nl_connect() [all …]
|
/external/boringssl/src/include/openssl/ |
D | stack.h | 128 OPENSSL_EXPORT size_t sk_num(const _STACK *sk); 132 OPENSSL_EXPORT void sk_zero(_STACK *sk); 136 OPENSSL_EXPORT void *sk_value(const _STACK *sk, size_t i); 140 OPENSSL_EXPORT void *sk_set(_STACK *sk, size_t i, void *p); 144 OPENSSL_EXPORT void sk_free(_STACK *sk); 148 OPENSSL_EXPORT void sk_pop_free(_STACK *sk, void (*free_func)(void *)); 153 OPENSSL_EXPORT size_t sk_insert(_STACK *sk, void *p, size_t where); 158 OPENSSL_EXPORT void *sk_delete(_STACK *sk, size_t where); 163 OPENSSL_EXPORT void *sk_delete_ptr(_STACK *sk, void *p); 171 OPENSSL_EXPORT int sk_find(_STACK *sk, size_t *out_index, void *p); [all …]
|
/external/ltp/utils/sctp/testlib/ |
D | sctputil.h | 135 int sk = socket(domain, type, protocol); in test_socket() local 136 if (-1 == sk) in test_socket() 138 return sk; in test_socket() 141 static inline int test_bind(int sk, struct sockaddr *addr, socklen_t addrlen) in test_bind() argument 143 int error = bind(sk, addr, addrlen); in test_bind() 149 static inline int test_bindx_add(int sk, struct sockaddr *addr, int count) in test_bindx_add() argument 151 int error = sctp_bindx(sk, addr, count, SCTP_BINDX_ADD_ADDR); in test_bindx_add() 157 static inline int test_listen(int sk, int backlog) in test_listen() argument 159 int error = listen(sk, backlog); in test_listen() 165 static inline int test_connect(int sk, struct sockaddr *addr, socklen_t addrlen) in test_connect() argument [all …]
|
/external/ltp/utils/sctp/func_tests/ |
D | test_1_to_1_socket_bind_listen.c | 85 int sk,pf_class; in main() local 102 sk = socket(-1, SOCK_STREAM, IPPROTO_SCTP); in main() 103 if (sk != -1 || errno != EAFNOSUPPORT) in main() 110 sk = socket(pf_class, -1, IPPROTO_SCTP); in main() 111 if (sk != -1 || errno != EINVAL) in main() 118 sk = socket(pf_class, SOCK_STREAM, IPPROTO_SCTP); in main() 119 if (sk < 0) in main() 126 error = bind(sk, (struct sockaddr *)-1, sizeof(struct sockaddr_in)); in main() 138 error = bind(sk, (struct sockaddr *) &bind_addr, sizeof(bind_addr)-2); in main() 165 error = bind(sk, (struct sockaddr *) &bind_addr, sizeof(bind_addr)); in main() [all …]
|
D | test_1_to_1_send.c | 69 int sk,sk1,pf_class,lstn_sk,acpt_sk,acpt1_sk, flag, count; in main() local 85 sk = test_socket(pf_class, SOCK_STREAM, IPPROTO_SCTP); in main() 107 test_connect(sk, (struct sockaddr *) &conn_addr, len); in main() 149 count = send(sk, (char *)0x1, len_snd, flag); in main() 174 close(sk); in main() 178 sk = test_socket(pf_class, SOCK_STREAM, IPPROTO_SCTP); in main() 196 test_connect(sk, (struct sockaddr *) &conn_addr, len); in main() 203 count = send(sk, message, msg_count, flag); in main() 222 test_recv(sk, message_rcv, msg_count, flag); in main() 226 test_send(sk, message, 5 , flag); in main() [all …]
|
D | test_1_to_1_sendmsg.c | 76 int sk,sk1,pf_class,lstn_sk,acpt_sk,acpt1_sk, flag; in main() local 100 sk = test_socket(pf_class, SOCK_STREAM, IPPROTO_SCTP); in main() 122 test_connect(sk, (struct sockaddr *) &conn_addr, len); in main() 182 count = sendmsg(sk, &outmessage, flag); in main() 193 count = sendmsg(sk, &outmessage, flag); in main() 203 count = sendmsg(sk, (struct msghdr *)-1, flag); in main() 212 count = sendmsg(sk, &outmessage, -1); in main() 221 count = sendmsg(sk, &outmessage, flag); in main() 230 count = sendmsg(sk, &outmessage, flag); in main() 255 close(sk); in main() [all …]
|
/external/e2fsprogs/misc/ |
D | findsuper.c | 102 #define WHY(fmt, arg...) { printf("\r%Ld: " fmt, sk, ##arg) ; continue; } 118 loff_t sk=0, skl=0; in main() local 166 sk = skl = strtoll(argv[optind], &s, 0) << 10; in main() 174 if (sk < 0) { in main() 175 fprintf(stderr, _("startkb should be positive, not %llu\n"),sk); in main() 186 printf(_("starting at %llu, with %u byte increments\n"), sk, skiprate); in main() 191 for (; lseek64(fd, sk, SEEK_SET) != -1 && in main() 192 read(fd, &ext2, 512) == 512; sk += skiprate) { in main() 197 if (sk && !(sk & (interval - 1))) { in main() 206 printf("\r%11Lu: %8LukB/s @ %s", sk, in main() [all …]
|
/external/linux-kselftest/tools/testing/selftests/bpf/ |
D | test_tcp_estats.c | 82 struct sock sk; member 83 #define inet_daddr sk.__sk_common.skc_daddr 84 #define inet_dport sk.__sk_common.skc_dport 93 static inline struct inet_sock *inet_sk(const struct sock *sk) in inet_sk() argument 95 return (struct inet_sock *)sk; in inet_sk() 212 struct sock *sk) in tcp_estats_conn_id_init() argument 214 conn_id->localport = _(inet_sk(sk)->inet_sport); in tcp_estats_conn_id_init() 215 conn_id->remport = _(inet_sk(sk)->inet_dport); in tcp_estats_conn_id_init() 217 if (_(sk->sk_family) == AF_INET6) in tcp_estats_conn_id_init() 219 sk->sk_v6_rcv_saddr.s6_addr32, in tcp_estats_conn_id_init() [all …]
|
/external/boringssl/src/crypto/x509/ |
D | x509_v3.c | 83 int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, in X509v3_get_ext_by_OBJ() argument 89 if (sk == NULL) in X509v3_get_ext_by_OBJ() 94 n = sk_X509_EXTENSION_num(sk); in X509v3_get_ext_by_OBJ() 96 ex = sk_X509_EXTENSION_value(sk, lastpos); in X509v3_get_ext_by_OBJ() 103 int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, in X509v3_get_ext_by_critical() argument 109 if (sk == NULL) in X509v3_get_ext_by_critical() 114 n = sk_X509_EXTENSION_num(sk); in X509v3_get_ext_by_critical() 116 ex = sk_X509_EXTENSION_value(sk, lastpos); in X509v3_get_ext_by_critical() 146 STACK_OF(X509_EXTENSION) *sk = NULL; in STACK_OF() 154 if ((sk = sk_X509_EXTENSION_new_null()) == NULL) in STACK_OF() [all …]
|
D | x509name.c | 120 STACK_OF(X509_NAME_ENTRY) *sk; in X509_NAME_get_index_by_OBJ() 126 sk = name->entries; in X509_NAME_get_index_by_OBJ() 127 n = sk_X509_NAME_ENTRY_num(sk); in X509_NAME_get_index_by_OBJ() 129 ne = sk_X509_NAME_ENTRY_value(sk, lastpos); in X509_NAME_get_index_by_OBJ() 149 STACK_OF(X509_NAME_ENTRY) *sk; in X509_NAME_delete_entry() 154 sk = name->entries; in X509_NAME_delete_entry() 155 ret = sk_X509_NAME_ENTRY_delete(sk, loc); in X509_NAME_delete_entry() 156 n = sk_X509_NAME_ENTRY_num(sk); in X509_NAME_delete_entry() 163 set_prev = (sk_X509_NAME_ENTRY_value(sk, loc - 1))->set; in X509_NAME_delete_entry() 166 set_next = sk_X509_NAME_ENTRY_value(sk, loc)->set; in X509_NAME_delete_entry() [all …]
|
D | x509_lu.c | 244 STACK_OF(X509_LOOKUP) *sk; in X509_STORE_free() 256 sk = vfy->get_cert_methods; in X509_STORE_free() 257 for (j = 0; j < sk_X509_LOOKUP_num(sk); j++) { in X509_STORE_free() 258 lu = sk_X509_LOOKUP_value(sk, j); in X509_STORE_free() 262 sk_X509_LOOKUP_free(sk); in X509_STORE_free() 273 STACK_OF(X509_LOOKUP) *sk; in X509_STORE_add_lookup() 276 sk = v->get_cert_methods; in X509_STORE_add_lookup() 277 for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) { in X509_STORE_add_lookup() 278 lu = sk_X509_LOOKUP_value(sk, i); in X509_STORE_add_lookup() 519 STACK_OF(X509) *sk; in STACK_OF() [all …]
|
/external/boringssl/src/crypto/ |
D | ex_data.c | 171 if (ad->sk == NULL) { in CRYPTO_set_ex_data() 172 ad->sk = sk_void_new_null(); in CRYPTO_set_ex_data() 173 if (ad->sk == NULL) { in CRYPTO_set_ex_data() 179 n = sk_void_num(ad->sk); in CRYPTO_set_ex_data() 183 if (!sk_void_push(ad->sk, NULL)) { in CRYPTO_set_ex_data() 189 sk_void_set(ad->sk, index, val); in CRYPTO_set_ex_data() 194 if (ad->sk == NULL || idx < 0 || (size_t)idx >= sk_void_num(ad->sk)) { in CRYPTO_get_ex_data() 197 return sk_void_value(ad->sk, idx); in CRYPTO_get_ex_data() 229 ad->sk = NULL; in CRYPTO_new_ex_data() 234 if (ad->sk == NULL) { in CRYPTO_free_ex_data() [all …]
|
/external/libnl/tests/ |
D | test-create-bridge.c | 8 int create_bridge(struct nl_sock *sk, struct nl_cache *link_cache, const char *name) { in create_bridge() argument 19 if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) { in create_bridge() 31 struct nl_sock *sk; in main() local 34 sk = nl_socket_alloc(); in main() 35 if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) { in main() 40 if ((err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache)) < 0) { in main() 45 if ((err = create_bridge(sk, link_cache, TEST_BRIDGE_NAME)) < 0) { in main() 50 nl_cache_refill(sk, link_cache); in main() 59 if ((err = rtnl_link_enslave(sk, link, ltap)) < 0) { in main() 77 nl_socket_free(sk); in main()
|
D | test-create-vlan.c | 9 struct nl_sock *sk; in main() local 12 sk = nl_socket_alloc(); in main() 13 if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) { in main() 18 if ((err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache)) < 0) { in main() 34 if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) { in main() 40 nl_close(sk); in main()
|
D | test-create-veth.c | 8 struct nl_sock *sk; in main() local 12 sk = nl_socket_alloc(); in main() 13 if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) { in main() 19 rtnl_link_veth_add(sk, "veth2", "veth3", getpid()); in main() 31 if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) { in main() 39 nl_close(sk); in main()
|
D | test-create-macvlan.c | 9 struct nl_sock *sk; in main() local 13 sk = nl_socket_alloc(); in main() 14 if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) { in main() 19 if ((err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache)) < 0) { in main() 39 if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) { in main() 45 nl_close(sk); in main()
|
D | test-create-ip6tnl.c | 9 struct nl_sock *sk; in main() local 12 sk = nl_socket_alloc(); in main() 13 if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) { in main() 18 err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache); in main() 45 err = rtnl_link_add(sk, link, NLM_F_CREATE); in main() 52 nl_close(sk); in main()
|
D | test-create-ipvti.c | 9 struct nl_sock *sk; in main() local 12 sk = nl_socket_alloc(); in main() 13 if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) { in main() 18 err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache); in main() 45 err = rtnl_link_add(sk, link, NLM_F_CREATE); in main() 52 nl_close(sk); in main()
|
/external/wpa_supplicant_8/src/drivers/ |
D | driver_macsec_linux.c | 43 struct nl_sock *sk; member 52 struct nl_sock *sk; member 134 ctx->sk = nl_socket_alloc(); in init_genl_ctx() 135 if (!ctx->sk) { in init_genl_ctx() 140 if (genl_connect(ctx->sk) < 0) { in init_genl_ctx() 146 ctx->macsec_genl_id = genl_ctrl_resolve(ctx->sk, "macsec"); in init_genl_ctx() 155 nl_socket_modify_cb(ctx->sk, NL_CB_VALID, NL_CB_CUSTOM, dump_callback, in init_genl_ctx() 161 nl_socket_free(ctx->sk); in init_genl_ctx() 162 ctx->sk = NULL; in init_genl_ctx() 171 if (!drv->sk) in try_commit() [all …]
|
/external/syslinux/extlinux/ |
D | main.c | 778 struct btrfs_ioctl_search_key *sk = &args.key; in get_default_subvol() local 806 sk->tree_id = 1; in get_default_subvol() 812 sk->max_type = BTRFS_DIR_ITEM_KEY; in get_default_subvol() 813 sk->min_type = BTRFS_DIR_ITEM_KEY; in get_default_subvol() 819 sk->min_objectid = BTRFS_ROOT_TREE_DIR_OBJECTID; in get_default_subvol() 820 sk->max_objectid = BTRFS_ROOT_TREE_DIR_OBJECTID; in get_default_subvol() 822 sk->max_offset = (u64)-1; in get_default_subvol() 823 sk->min_offset = 0; in get_default_subvol() 824 sk->max_transid = (u64)-1; in get_default_subvol() 827 sk->nr_items = 4096; in get_default_subvol() [all …]
|
/external/libnl/lib/route/ |
D | route.c | 80 int rtnl_route_alloc_cache(struct nl_sock *sk, int family, int flags, in rtnl_route_alloc_cache() argument 92 if (sk && (err = nl_cache_refill(sk, cache)) < 0) { in rtnl_route_alloc_cache() 133 int rtnl_route_add(struct nl_sock *sk, struct rtnl_route *route, int flags) in rtnl_route_add() argument 141 err = nl_send_auto_complete(sk, msg); in rtnl_route_add() 146 return wait_for_ack(sk); in rtnl_route_add() 155 int rtnl_route_delete(struct nl_sock *sk, struct rtnl_route *route, int flags) in rtnl_route_delete() argument 163 err = nl_send_auto_complete(sk, msg); in rtnl_route_delete() 168 return wait_for_ack(sk); in rtnl_route_delete()
|
D | cls.c | 184 int rtnl_cls_add(struct nl_sock *sk, struct rtnl_cls *cls, int flags) in rtnl_cls_add() argument 192 return nl_send_sync(sk, msg); in rtnl_cls_add() 226 int rtnl_cls_change(struct nl_sock *sk, struct rtnl_cls *cls, int flags) in rtnl_cls_change() argument 234 return nl_send_sync(sk, msg); in rtnl_cls_change() 295 int rtnl_cls_delete(struct nl_sock *sk, struct rtnl_cls *cls, int flags) in rtnl_cls_delete() argument 303 return nl_send_sync(sk, msg); in rtnl_cls_delete() 327 int rtnl_cls_alloc_cache(struct nl_sock *sk, int ifindex, uint32_t parent, struct nl_cache **res… in rtnl_cls_alloc_cache() argument 338 if (sk && (err = nl_cache_refill(sk, cache)) < 0) { in rtnl_cls_alloc_cache() 384 static int cls_request_update(struct nl_cache *cache, struct nl_sock *sk) in cls_request_update() argument 392 return nl_send_simple(sk, RTM_GETTFILTER, NLM_F_DUMP, &tchdr, in cls_request_update()
|
/external/ltp/testcases/kernel/syscalls/setsockopt/ |
D | setsockopt02.c | 71 static int sk; variable 81 if (sk > 0) in cleanup() 82 SAFE_CLOSE(sk); in cleanup() 98 sk = SAFE_SOCKET(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); in create_skbuf() 99 TEST(setsockopt(sk, SOL_PACKET, PACKET_VERSION, &ver, sizeof(ver))); in create_skbuf() 105 return setsockopt(sk, SOL_PACKET, PACKET_RX_RING, &req, sizeof(req)); in create_skbuf() 135 SAFE_CLOSE(sk); in run()
|