Lines Matching refs:text
25 int __t2q_get_rate(const char **text,int up)
33 if (!strncmp(*text,"max",3)) {
34 *text += 3;
37 rate = strtoul(*text,&end,10);
75 *text = end;
80 static int params(const char **text,struct atm_trafprm *a,
86 if (*(*text)++ != ':') return -1;
88 if (!**text) return -1;
89 switch (fetch(text,"max_pcr=","pcr=","min_pcr=","max_sdu=","sdu=",
92 if ((value = __t2q_get_rate(text,0)) == RATE_ERROR) return -1;
97 if ((value = __t2q_get_rate(text,0)) == RATE_ERROR) return -1;
102 if ((value = __t2q_get_rate(text,1)) == RATE_ERROR) return -1;
109 value = strtol(*text,&end,10);
111 *text = end;
118 if (!**text) break;
119 if (*(*text)++ != ',') return -1;
125 int text2qos(const char *text,struct atm_qos *qos,int flags)
135 item = fetch(&text,"!none","ubr","cbr","vbr","abr","aal0","aal5",NULL);
151 while (*text == ',' ? text++ : 0);
156 if (!*text) return 0;
157 if (params(&text,qos ? &qos->txtp : NULL,qos ? &qos->rxtp : NULL))
159 if (!*text) return 0;
160 switch (fetch(&text,"tx","rx",NULL)) {
162 if (!fetch(&text,":none",NULL)) {
164 if (*text == ',') text++;
167 if (params(&text,qos ? &qos->txtp : NULL,NULL)) return -1;
170 text -= 2;
175 if (!*text) return 0;
176 if (fetch(&text,"rx",NULL)) return -1;
177 if (!fetch(&text,":none",NULL) && qos) qos->rxtp.traffic_class = ATM_NONE;
178 else if (params(&text,qos ? &qos->rxtp : NULL,NULL)) return -1;
179 return *text ? -1 : 0;