type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | int mem_check(struct sock *sk)
{
struct ipv6_fl_socklist *sfl;
int room = FL_MAX_SIZE - atomic_read(&fl_size);
int count = 0;
if (room > FL_MAX_SIZE - FL_MAX_PER_SOCK)
return 0;
for (sfl = sk->net_pinfo.af_inet6.ipv6_fl_list; sfl; sfl = sfl->next)
count++;
if (room <= 0 ||
((count >= FL_MAX_PER_SOCK |... |
functions | int ipv6_hdr_cmp(struct ipv6_opt_hdr *h1, struct ipv6_opt_hdr *h2)
{
if (h1 == h2)
return 0;
if (h1 == NULL || h2 == NULL)
return 1;
if (h1->hdrlen != h2->hdrlen)
return 1;
return memcmp(h1+1, h2+1, ((h1->hdrlen+1)<<3) - sizeof(*h1));
} |
functions | int ipv6_opt_cmp(struct ipv6_txoptions *o1, struct ipv6_txoptions *o2)
{
if (o1 == o2)
return 0;
if (o1 == NULL || o2 == NULL)
return 1;
if (o1->opt_nflen != o2->opt_nflen)
return 1;
if (ipv6_hdr_cmp(o1->hopopt, o2->hopopt))
return 1;
if (ipv6_hdr_cmp(o1->dst0opt, o2->dst0opt))
return 1;
if (ipv6_hdr_cm... |
functions | int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen)
{
int err;
struct ipv6_pinfo *np = &sk->net_pinfo.af_inet6;
struct in6_flowlabel_req freq;
struct ipv6_fl_socklist *sfl1=NULL;
struct ipv6_fl_socklist *sfl, **sflp;
struct ip6_flowlabel *fl;
if (optlen < sizeof(freq))
return -EINVAL;
if (copy... |
functions | int ip6_fl_read_proc(char *buffer, char **start, off_t offset,
int length, int *eof, void *data)
{
off_t pos=0;
off_t begin=0;
int len=0;
int i, k;
struct ip6_flowlabel *fl;
len+= sprintf(buffer,"Label S Owner Users Linger Expires "
"Dst Opt\n");
read_lock_bh(&ip6... |
functions | void ip6_flowlabel_init()
{
init_timer(&ip6_fl_gc_timer);
ip6_fl_gc_timer.function = ip6_fl_gc;
#ifdef CONFIG_PROC_FS
create_proc_read_entry("net/ip6_flowlabel", 0, 0, ip6_fl_read_proc, NULL);
#endif
} |
functions | void ip6_flowlabel_cleanup()
{
del_timer(&ip6_fl_gc_timer);
#ifdef CONFIG_PROC_FS
remove_proc_entry("net/ip6_flowlabel", 0);
#endif
} |
includes | #include <stdio.h> |
includes | #include <openssl/ebcdic.h> |
defines | #define CHARSET_EBCDIC 1 |
includes |
#include <stdio.h> |
includes | #include <sys/time.h> |
includes | #include <unistd.h> |
includes | #include <stdlib.h> |
includes |
#include <string.h> |
includes | #include <signal.h> |
includes |
#include <x86info.h> |
includes | #include <rdtsc.h> |
functions | void display_MHz(struct cpudata *cpu)
{
if (cpu->MHz < 1000)
printf("%uMHz", cpu->MHz);
else {
unsigned int a = (cpu->MHz / 1000);
unsigned int b = ((cpu->MHz % 1000)/100);
unsigned int c = (a*1000)+(b*100);
printf("%u.%u%uGHz", a, b, (cpu->MHz - c)/10);
} |
functions | void estimate_MHz(struct cpudata *cpu)
{
unsigned long long int cycles[2]; /* gotta be 64 bit */
unsigned int eax, ebx, ecx, edx;
// coverity[DC.WEAK_CRYPTO]
unsigned long r = rand();
if (cpu->number != 0) {
if (all_cpus == 0) {
cpu->MHz = firstcpu->MHz;
return;
} |
includes |
#include <linux/kernel.h> |
includes | #include <linux/clk.h> |
includes | #include <linux/io.h> |
includes |
#include <asm/mach-types.h> |
includes |
#include <plat/clock.h> |
includes | #include <plat/cpu.h> |
includes | #include <plat/clkdev_omap.h> |
includes | #include <plat/usb.h> |
functions | __init omap1_clk_init(void)
{
struct omap_clk *c;
const struct omap_clock_config *info;
int crystal_type = 0; /* Default 12 MHz */
u32 reg, cpu_mask;
#ifdef CONFIG_DEBUG_LL
/*
* Resets some clocks that may be left on from bootloader,
* but leaves serial clocks on.
*/
omap_writel(0x3 << 29, MOD_CONF_CTRL_0)... |
includes | #include <config.h> |
functions | int testQemuAddPPC64Guest(virCapsPtr caps)
{
static const char *machine[] = { "pseries" } |
functions | int testQemuAddPPCGuest(virCapsPtr caps)
{
static const char *machine[] = { "g3beige",
"mac99",
"prep",
"ppce500v2" } |
functions | int testQemuAddS390Guest(virCapsPtr caps)
{
static const char *s390_machines[] = { "s390-virtio",
"s390-ccw-virtio" } |
functions | int testQemuAddArmGuest(virCapsPtr caps)
{
static const char *machines[] = { "vexpress-a9",
"vexpress-a15",
"versatilepb" } |
functions | int testQemuAddAARCH64Guest(virCapsPtr caps)
{
static const char *machines[] = { "virt"} |
functions | virCapsPtr testQemuCapsInit(void) {
virCapsPtr caps;
virCapsGuestPtr guest;
virCapsGuestMachinePtr *machines = NULL;
int nmachines = 0;
static const char *const xen_machines[] = {
"xenner"
} |
includes |
#include <libsecret/secret.h> |
defines | #define SECRETSERVICE_NAME N_("Secret Service") |
defines | #define SECRETSERVICE_ID "keyring-libsecret" |
defines | #define SECRETSERVICE_DOMAIN (g_quark_from_static_string(SECRETSERVICE_ID)) |
structs | struct _InfoStorage
{
PurpleAccount *account;
gpointer cb;
gpointer user_data;
}; |
functions | void
ss_read_continue(GObject *object, GAsyncResult *result, gpointer data)
{
InfoStorage *storage = data;
PurpleAccount *account = storage->account;
PurpleKeyringReadCallback cb = storage->cb;
char *password;
GError *error = NULL;
password = secret_password_lookup_finish(result, &error);
if (error != NULL) {
... |
functions | else if (password == NULL) {
error = g_error_new(PURPLE_KEYRING_ERROR,
PURPLE_KEYRING_ERROR_NOPASSWORD,
"No password found for account: %s",
purple_account_get_username(account));
if (cb != NULL)
cb(account, NULL, error, storage->user_data);
g_error_free(error);
} |
functions | void
ss_read(PurpleAccount *account, PurpleKeyringReadCallback cb, gpointer data)
{
InfoStorage *storage = g_new0(InfoStorage, 1);
storage->account = account;
storage->cb = cb;
storage->user_data = data;
secret_password_lookup(&purple_schema, NULL, ss_read_continue, storage,
"user", purple_account_get_username... |
functions | void
ss_save_continue(GObject *object, GAsyncResult *result, gpointer data)
{
InfoStorage *storage = data;
PurpleKeyringSaveCallback cb;
GError *error = NULL;
PurpleAccount *account;
account = storage->account;
cb = storage->cb;
secret_password_store_finish(result, &error);
if (error != NULL) {
int code = ... |
functions | void
ss_save(PurpleAccount *account,
const gchar *password,
PurpleKeyringSaveCallback cb,
gpointer data)
{
InfoStorage *storage = g_new0(InfoStorage, 1);
storage->account = account;
storage->cb = cb;
storage->user_data = data;
if (password != NULL && *password != '\0') {
const char *... |
functions | void
ss_close(void)
{
} |
functions | gboolean
ss_init(GError **error)
{
keyring_handler = purple_keyring_new();
purple_keyring_set_name(keyring_handler, _(SECRETSERVICE_NAME));
purple_keyring_set_id(keyring_handler, SECRETSERVICE_ID);
purple_keyring_set_read_password(keyring_handler, ss_read);
purple_keyring_set_save_password(keyring_handler, ss_sav... |
functions | void
ss_uninit(void)
{
ss_close();
purple_keyring_unregister(keyring_handler);
purple_keyring_free(keyring_handler);
keyring_handler = NULL;
} |
functions | gboolean
plugin_load(PurplePlugin *plugin, GError **error)
{
return ss_init(error);
} |
functions | gboolean
plugin_unload(PurplePlugin *plugin, GError **error)
{
if (purple_keyring_get_inuse() == keyring_handler) {
g_set_error(error, SECRETSERVICE_DOMAIN, 0, "The keyring is currently "
"in use.");
return FALSE;
} |
includes |
#include <stdarg.h> |
includes | #include <string.h> |
functions | int file_write_dep(const char *name)
{
struct symbol *sym, *env_sym;
struct expr *e;
struct file *file;
FILE *out;
if (!name)
name = ".kconfig.d";
out = fopen("..config.tmp", "w");
if (!out)
return 1;
fprintf(out, "deps_config := \\\n");
for (file = file_list; file; file = file->next) {
if (file->next)
... |
functions | gstr str_new(void)
{
struct gstr gs;
gs.s = malloc(sizeof(char) * 64);
gs.len = 64;
gs.max_width = 0;
strcpy(gs.s, "\0");
return gs;
} |
functions | gstr str_assign(const char *s)
{
struct gstr gs;
gs.s = strdup(s);
gs.len = strlen(s) + 1;
gs.max_width = 0;
return gs;
} |
functions | void str_free(struct gstr *gs)
{
if (gs->s)
free(gs->s);
gs->s = NULL;
gs->len = 0;
} |
functions | void str_append(struct gstr *gs, const char *s)
{
size_t l;
if (s) {
l = strlen(gs->s) + strlen(s) + 1;
if (l > gs->len) {
gs->s = realloc(gs->s, l);
gs->len = l;
} |
functions | void str_printf(struct gstr *gs, const char *fmt, ...)
{
va_list ap;
char s[10000]; /* big enough... */
va_start(ap, fmt);
vsnprintf(s, sizeof(s), fmt, ap);
str_append(gs, s);
va_end(ap);
} |
includes |
#include <glib.h> |
includes | #include <glib/gstdio.h> |
includes | #include <glib/gi18n.h> |
defines | #define VIK_ROUTING_ENGINE_PRIVATE(o) (vik_routing_engine_get_instance_private (VIK_ROUTING_ENGINE(o))) |
structs | struct _VikRoutingEnginePrivate
{
gchar *id;
gchar *label;
gchar *format;
}; |
functions | void
vik_routing_engine_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
VikRoutingEnginePrivate *priv = VIK_ROUTING_ENGINE_PRIVATE ( object );
switch (property_id)
{
case... |
functions | void
vik_routing_engine_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
VikRoutingEnginePrivate *priv = VIK_ROUTING_ENGINE_PRIVATE ( object );
switch (property_id)
{
case PROP_ID... |
functions | void
vik_routing_engine_class_init ( VikRoutingEngineClass *klass )
{
GObjectClass *object_class;
VikRoutingEngineClass *routing_class;
GParamSpec *pspec = NULL;
object_class = G_OBJECT_CLASS (klass);
object_class->set_property = vik_routing_engine_set_property;
object_class->get_property = vik_routing_en... |
functions | void
vik_routing_engine_init ( VikRoutingEngine *self )
{
VikRoutingEnginePrivate *priv = VIK_ROUTING_ENGINE_PRIVATE (self);
priv->id = NULL;
priv->label = NULL;
priv->format = NULL;
} |
functions | void
vik_routing_engine_finalize ( GObject *self )
{
VikRoutingEnginePrivate *priv = VIK_ROUTING_ENGINE_PRIVATE (self);
g_free (priv->id);
priv->id = NULL;
g_free (priv->label);
priv->label = NULL;
g_free (priv->format);
priv->format = NULL;
G_OBJECT_CLASS(parent_class)->finalize(self);
} |
functions | gboolean
vik_routing_engine_find ( VikRoutingEngine *self, VikTrwLayer *vtl, struct LatLon start, struct LatLon end )
{
VikRoutingEngineClass *klass;
g_return_val_if_fail ( VIK_IS_ROUTING_ENGINE (self), FALSE );
klass = VIK_ROUTING_ENGINE_GET_CLASS( self );
g_return_val_if_fail ( klass->find != NULL, FALSE );
r... |
functions | gboolean
vik_routing_engine_supports_direction ( VikRoutingEngine *self )
{
VikRoutingEngineClass *klass;
g_return_val_if_fail ( VIK_IS_ROUTING_ENGINE (self), FALSE );
klass = VIK_ROUTING_ENGINE_GET_CLASS( self );
g_return_val_if_fail ( klass->supports_direction != NULL, FALSE );
return klass->supports_dire... |
functions | gboolean
vik_routing_engine_refine ( VikRoutingEngine *self, VikTrwLayer *vtl, VikTrack *vt )
{
VikRoutingEngineClass *klass;
g_return_val_if_fail ( VIK_IS_ROUTING_ENGINE (self), FALSE );
klass = VIK_ROUTING_ENGINE_GET_CLASS ( self );
g_return_val_if_fail ( klass->refine != NULL, FALSE );
return klass->refi... |
functions | gboolean
vik_routing_engine_supports_refine ( VikRoutingEngine *self )
{
VikRoutingEngineClass *klass;
g_return_val_if_fail ( VIK_IS_ROUTING_ENGINE (self), FALSE );
klass = VIK_ROUTING_ENGINE_GET_CLASS ( self );
g_return_val_if_fail ( klass->supports_refine != NULL, FALSE );
return klass->supports_refine ( ... |
includes |
#include <stdio.h> |
includes | #include <stdint.h> |
includes | #include <string.h> |
includes | #include <arpa/inet.h> |
includes | #include <errno.h> |
includes | #include <libmnl/libmnl.h> |
includes | #include <linux/netfilter/nf_tables.h> |
includes | #include <libnftnl/expr.h> |
includes | #include <libnftnl/rule.h> |
structs | struct nftnl_expr_bitwise {
enum nft_registers sreg;
enum nft_registers dreg;
unsigned int len;
union nftnl_data_reg mask;
union nftnl_data_reg xor;
}; |
functions | int
nftnl_expr_bitwise_set(struct nftnl_expr *e, uint16_t type,
const void *data, uint32_t data_len)
{
struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e);
switch(type) {
case NFTNL_EXPR_BITWISE_SREG:
bitwise->sreg = *((uint32_t *)data);
break;
case NFTNL_EXPR_BITWISE_DREG:
bitwise->dreg = *((uint32... |
functions | int nftnl_expr_bitwise_cb(const struct nlattr *attr, void *data)
{
const struct nlattr **tb = data;
int type = mnl_attr_get_type(attr);
if (mnl_attr_type_valid(attr, NFTA_BITWISE_MAX) < 0)
return MNL_CB_OK;
switch(type) {
case NFTA_BITWISE_SREG:
case NFTA_BITWISE_DREG:
case NFTA_BITWISE_LEN:
if (mnl_attr_v... |
functions | void
nftnl_expr_bitwise_build(struct nlmsghdr *nlh, struct nftnl_expr *e)
{
struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e);
if (e->flags & (1 << NFTNL_EXPR_BITWISE_SREG))
mnl_attr_put_u32(nlh, NFTA_BITWISE_SREG, htonl(bitwise->sreg));
if (e->flags & (1 << NFTNL_EXPR_BITWISE_DREG))
mnl_attr_put_u32(nlh,... |
functions | int
nftnl_expr_bitwise_parse(struct nftnl_expr *e, struct nlattr *attr)
{
struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e);
struct nlattr *tb[NFTA_BITWISE_MAX+1] = {} |
functions | int
nftnl_expr_bitwise_json_parse(struct nftnl_expr *e, json_t *root,
struct nftnl_parse_err *err)
{
#ifdef JSON_PARSING
struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e);
uint32_t reg, len;
if (nftnl_jansson_parse_reg(root, "sreg", NFTNL_TYPE_U32, ®, err) == 0)
nftnl_expr_set_u32(e, NFTNL_EXPR_BITW... |
functions | int
nftnl_expr_bitwise_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
struct nftnl_parse_err *err)
{
#ifdef XML_PARSING
struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e);
uint32_t sreg, dreg, len;
if (nftnl_mxml_reg_parse(tree, "sreg", &sreg, MXML_DESCEND_FIRST,
NFTNL_XML_MAND, err) == 0)
... |
functions | int nftnl_expr_bitwise_export(char *buf, size_t size,
struct nftnl_expr *e, int type)
{
struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e);
NFTNL_BUF_INIT(b, buf, size);
if (e->flags & (1 << NFTNL_EXPR_BITWISE_SREG))
nftnl_buf_u32(&b, type, bitwise->sreg, SREG);
if (e->flags & (1 << NFTNL_EXPR_BITWISE_... |
functions | int nftnl_expr_bitwise_snprintf_default(char *buf, size_t size,
struct nftnl_expr *e)
{
struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e);
int len = size, offset = 0, ret;
ret = snprintf(buf, len, "reg %u = (reg=%u & ",
bitwise->dreg, bitwise->sreg);
SNPRINTF_BUFFER_SIZE(ret, size, len, offs... |
functions | int
nftnl_expr_bitwise_snprintf(char *buf, size_t size, uint32_t type,
uint32_t flags, struct nftnl_expr *e)
{
switch (type) {
case NFTNL_OUTPUT_DEFAULT:
return nftnl_expr_bitwise_snprintf_default(buf, size, e);
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
return nftnl_expr_bitwise_export(buf, size,... |
includes |
#include <linux/module.h> |
includes | #include <linux/init.h> |
includes | #include <linux/sched.h> |
includes | #include <linux/time.h> |
includes | #include <linux/kernel.h> |
includes | #include <linux/mm.h> |
includes | #include <linux/string.h> |
includes | #include <linux/stat.h> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.