struct check_instance * create_instance(struct check_instance *cptr, grad_nas_t *nas, struct radutmp *up) { RADCK_TYPE *radck_type; if ((radck_type = find_radck_type(nas->nastype)) == NULL) { grad_log(GRAD_LOG_ERR, _("unknown NAS type: %s (nas %s)"), nas->nastype, nas->shortname); return NULL; } cptr->name = up->orig_login[0] ? up->orig_login : up->login; cptr->port = up->nas_port; cptr->sid = up->session_id; cptr->framed_ip = ntohl(up->framed_address); cptr->nas_ip = ntohl(up->nas_address); cptr->result = -1; cptr->timeout = 0; cptr->nasname = nas->shortname ? nas->shortname : nas->longname; cptr->method = radck_type->method; cptr->args = grad_envar_merge_lists((grad_envar_t*) nas->args, radck_type->args); cptr->func = slookup(cptr, "function", NULL); obstack_init(&cptr->stack); return cptr; }
void cinit(void) { Sym *s; int i; nullgen.sym = S; nullgen.offset = 0; nullgen.type = D_NONE; if(FPCHIP) nullgen.dval = 0; for(i=0; i<sizeof(nullgen.sval); i++) nullgen.sval[i] = 0; nullgen.displace = 0; nullgen.type = D_NONE; nullgen.index = D_NONE; nullgen.scale = 0; nullgen.field = 0; nerrors = 0; iostack = I; iofree = I; peekc = IGN; nhunk = 0; for(i=0; i<NHASH; i++) hash[i] = S; for(i=0; itab[i].name; i++) { s = slookup(itab[i].name); s->type = itab[i].type; s->value = itab[i].value; } pathname = allocn(pathname, 0, 100); if(mygetwd(pathname, 99) == 0) { pathname = allocn(pathname, 100, 900); if(mygetwd(pathname, 999) == 0) strcpy(pathname, "/???"); } }
void cinit(void) { Sym *s; int i; nullgen.type = D_NONE; nullgen.index = D_NONE; nerrors = 0; iostack = I; iofree = I; peekc = IGN; nhunk = 0; for(i=0; i<NHASH; i++) hash[i] = S; for(i=0; itab[i].name; i++) { s = slookup(itab[i].name); if(s->type != LNAME) yyerror("double initialization %s", itab[i].name); s->type = itab[i].type; s->value = itab[i].value; } }
void cinit(void) { Sym *s; int i; nullgen.sym = S; nullgen.offset = 0; nullgen.type = D_NONE; nullgen.name = D_NONE; nullgen.reg = NREG; if(FPCHIP) nullgen.dval = 0; for(i=0; i<sizeof(nullgen.sval); i++) nullgen.sval[i] = 0; nerrors = 0; iostack = I; iofree = I; peekc = IGN; nhunk = 0; for(i=0; i<NHASH; i++) hash[i] = S; for(i=0; itab[i].name; i++) { s = slookup(itab[i].name); s->type = itab[i].type; s->value = itab[i].value; } ALLOCN(pathname, 0, 100); if(getwd(pathname, 99) == 0) { ALLOCN(pathname, 100, 900); if(getwd(pathname, 999) == 0) strcpy(pathname, "/???"); } }