| 3932 | } |
| 3933 | |
| 3934 | int pv_parse_avp_name(pv_spec_p sp, const str *in) |
| 3935 | { |
| 3936 | char *p; |
| 3937 | char *s; |
| 3938 | pv_spec_p nsp = 0; |
| 3939 | |
| 3940 | if(in==NULL || in->s==NULL || sp==NULL) |
| 3941 | return -1; |
| 3942 | p = in->s; |
| 3943 | if(*p==PV_MARKER) |
| 3944 | { |
| 3945 | nsp = (pv_spec_p)pkg_malloc(sizeof(pv_spec_t)); |
| 3946 | if(nsp==NULL) |
| 3947 | { |
| 3948 | LM_ERR("no more memory\n"); |
| 3949 | return -1; |
| 3950 | } |
| 3951 | s = pv_parse_spec(in, nsp); |
| 3952 | if(s==NULL) |
| 3953 | { |
| 3954 | LM_ERR("invalid name [%.*s]\n", in->len, in->s); |
| 3955 | pv_spec_free(nsp); |
| 3956 | return -1; |
| 3957 | } |
| 3958 | //LM_ERR("dynamic name [%.*s]\n", in->len, in->s); |
| 3959 | //pv_print_spec(nsp); |
| 3960 | sp->pvp.pvn.type = PV_NAME_PVAR; |
| 3961 | sp->pvp.pvn.u.dname = (void*)nsp; |
| 3962 | return 0; |
| 3963 | } |
| 3964 | /*LM_DBG("static name [%.*s]\n", in->len, in->s);*/ |
| 3965 | /* always an int type from now */ |
| 3966 | sp->pvp.pvn.u.isname.type = 0; |
| 3967 | if(parse_avp_spec(in, &sp->pvp.pvn.u.isname.name.n)!=0) |
| 3968 | { |
| 3969 | LM_ERR("bad avp name [%.*s]\n", in->len, in->s); |
| 3970 | return -1; |
| 3971 | } |
| 3972 | sp->pvp.pvn.type = PV_NAME_INTSTR; |
| 3973 | return 0; |
| 3974 | } |
| 3975 | |
| 3976 | static int pv_parse_avp_index(pv_spec_p sp, const str *in) |
| 3977 | { |
nothing calls this directly
no test coverage detected