• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/bsnmp/lib/

Lines Matching refs:context

77  * Set context
79 struct context {
93 * Allocate a context
98 struct context *context;
100 if ((context = malloc(sizeof(*context))) == NULL)
103 memset(context, 0, sizeof(*context));
104 TAILQ_INIT(&context->dlist);
106 return (&context->ctx);
209 struct context context;
212 memset(&context, 0, sizeof(context));
213 context.ctx.data = data;
239 ret = (*tp->op)(&context.ctx, &resp->bindings[i],
335 do_getnext(struct context *context, const struct snmp_value *inb,
356 ret = (*tp->op)(&context->ctx, outb, tp->oid.len,
360 ret = (*tp->op)(&context->ctx, outb, tp->oid.len,
407 struct context context;
412 memset(&context, 0, sizeof(context));
413 context.ctx.data = data;
421 result = do_getnext(&context, &pdu->bindings[i],
462 struct context context;
470 memset(&context, 0, sizeof(context));
471 context.ctx.data = data;
484 result = do_getnext(&context, &pdu->bindings[i],
522 result = do_getnext(&context, &pdu->bindings[i],
525 result = do_getnext(&context,
571 rollback(struct context *context, struct snmp_pdu *pdu, u_int i)
579 np = context->node[i];
581 context->ctx.scratch = &context->scratch[i];
583 ret = (*np->op)(&context->ctx, b, np->oid.len, np->index,
603 struct context *context = (struct context *)ctx;
606 TAILQ_FOREACH(context->depend, &context->dlist, link) {
607 ctx->dep = &context->depend->dep;
613 ret = context->depend->func(ctx, ctx->dep, SNMP_DEPOP_COMMIT);
630 struct context *context = (struct context *)ctx;
636 while ((context->depend =
637 TAILQ_PREV(context->depend, depend_list, link)) != NULL) {
638 ctx->dep = &context->depend->dep;
644 ret = context->depend->func(ctx, ctx->dep, SNMP_DEPOP_ROLLBACK);
660 struct context *context = (struct context *)ctx;
663 while ((d = TAILQ_FIRST(&context->dlist)) != NULL) {
666 TAILQ_REMOVE(&context->dlist, d, link);
681 struct context context;
686 memset(&context, 0, sizeof(context));
687 TAILQ_INIT(&context.dlist);
688 context.ctx.data = data;
702 if ((np = context.node[i] = find_node(b, &except)) == NULL) {
781 context.ctx.code = SNMP_RET_OK;
789 np = context.node[i];
791 context.ctx.var_index = i + 1;
792 context.ctx.scratch = &context.scratch[i];
794 ret = (*np->op)(&context.ctx, b, np->oid.len, np->index,
850 rollback(&context, pdu, i);
853 context.ctx.code = SNMP_RET_ERR;
865 if ((ret = snmp_dep_commit(&context.ctx)) != SNMP_ERR_NOERROR) {
867 pdu->error_index = context.ctx.var_index;
869 if ((ret = snmp_dep_rollback(&context.ctx)) != SNMP_ERR_NOERROR) {
875 rollback(&context, pdu, i);
878 context.ctx.code = SNMP_RET_ERR;
893 np = context.node[i];
895 context.ctx.var_index = i + 1;
896 context.ctx.scratch = &context.scratch[i];
898 ret = (*np->op)(&context.ctx, b, np->oid.len, np->index,
910 context.ctx.code = SNMP_RET_IGN;
917 snmp_dep_finish(&context.ctx);
920 snmp_debug("set: returning %d", context.ctx.code);
922 return (context.ctx.code);
931 struct context *context;
934 context = (struct context *)(void *)
935 ((char *)ctx - offsetof(struct context, ctx));
941 TAILQ_FOREACH(d, &context->dlist, link)
965 TAILQ_INSERT_TAIL(&context->dlist, d, link);
1006 snmp_error("cannot decode msg context engine");
1013 snmp_error("cannot decode msg context name");