Lines Matching refs:token

182 	size_t prev_len, char* token, size_t token_len)
185 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
190 if(strcmp(token, "@") == 0) {
207 } else if(strlen(token) == 0) {
227 int s = sldns_str2wire_dname_buf_origin(token, rr, &dlen,
230 sldns_buffer_position(strbuf)-strlen(token));
238 rrinternal_get_ttl(sldns_buffer* strbuf, char* token, size_t token_len,
242 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
246 *ttl = (uint32_t) sldns_str2period(token, &endptr);
248 if (strlen(token) > 0 && !isdigit((unsigned char)token[0])) {
262 rrinternal_get_class(sldns_buffer* strbuf, char* token, size_t token_len,
265 /* if 'not_there' then we got token from previous parse routine */
267 /* parse new token for class */
268 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
273 *cl = sldns_get_rr_class_by_name(token);
274 /* class can be left out too, assume IN, current token must be type */
275 if(*cl == 0 && strcmp(token, "CLASS0") != 0) {
284 rrinternal_get_type(sldns_buffer* strbuf, char* token, size_t token_len,
287 /* if 'not_there' then we got token from previous parse routine */
289 /* parse new token for type */
290 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
295 *tp = sldns_get_rr_type_by_name(token);
296 if(*tp == 0 && strcmp(token, "TYPE0") != 0) {
382 rrinternal_spool_hex(char* token, uint8_t* rr, size_t rr_len,
385 char* p = token;
393 p-token);
396 p-token);
400 p-token);
417 rrinternal_parse_unknown(sldns_buffer* strbuf, char* token, size_t token_len,
426 if(sldns_bget_token(strbuf, token, delim, token_len) == -1)
429 if(sldns_bget_token(strbuf, token, delim, token_len) == -1) {
434 hex_data_size = (size_t)atoi(token);
445 ssize_t c = sldns_bget_token(strbuf, token, delim, token_len);
446 if((status = rrinternal_spool_hex(token, rr, *rr_len,
449 sldns_buffer_position(strbuf)-strlen(token));
464 rrinternal_parse_rdf(sldns_buffer* strbuf, char* token, size_t token_len,
475 if(strcmp(token, "@") == 0) {
496 int s = sldns_str2wire_dname_buf_origin(token,
499 sldns_buffer_position(strbuf)-strlen(token));
510 size_t tlen = strlen(token);
511 (void)sldns_bget_token(strbuf, token+tlen, "\n",
520 if((status=sldns_str2wire_rdf_buf(token, rr+(*rr_cur_len), &len,
523 sldns_buffer_position(strbuf)-strlen(token));
529 * Parse one rdf token. Takes care of quotes and parenthesis.
532 sldns_parse_rdf_token(sldns_buffer* strbuf, char* token, size_t token_len,
545 if(sldns_bget_token_par(strbuf, token, (*quoted)?"\"":delimiters,
549 slen = strlen(token);
553 (token[0] == '"' || token[0] == '\'') &&
554 (token[slen-1] == '"' || token[slen-1] == '\'')) {
555 /* move token two smaller (quotes) with endnull */
556 memmove(token, token+1, slen-2);
557 token[slen-2] = 0;
562 (token[0] == '"' || token[0] == '\'')) {
564 * of quoted string as well into remainder of token */
565 memmove(token, token+1, slen-1);
566 token[slen-1] = 0;
575 if(sldns_bget_token_par(strbuf, token+slen,
580 slen = strlen(token);
586 /** Add space and one more rdf token onto the existing token string. */
588 sldns_affix_token(sldns_buffer* strbuf, char* token, size_t* token_len,
597 token[*token_strlen] = ' ';
598 token[++(*token_strlen)] = 0;
600 /* read another token */
602 if(!sldns_parse_rdf_token(strbuf, token+*token_strlen, addlen, quoted,
611 rrinternal_parse_rdata(sldns_buffer* strbuf, char* token, size_t token_len,
637 if(!sldns_parse_rdf_token(strbuf, token, token_len, &quoted,
647 if(token_strlen>=2 && strncmp(token, "\\#", 2) == 0 &&
648 !quoted && (token_strlen == 2 || token[2]==' ')) {
650 if((status=rrinternal_parse_unknown(strbuf, token,
657 if(!sldns_affix_token(strbuf, token,
662 if(!sldns_affix_token(strbuf, token,
670 if((status=rrinternal_parse_rdf(strbuf, token,
684 if(sldns_bget_token_par(strbuf, token, "\n", token_len,
691 if(strcmp(token, "") != 0)
722 char token[LDNS_MAX_RDFLEN+1];
734 origin_len, prev, prev_len, token, sizeof(token))) != 0)
738 if((status=rrinternal_get_ttl(&strbuf, token, sizeof(token),
741 if((status=rrinternal_get_class(&strbuf, token, sizeof(token),
744 if((status=rrinternal_get_type(&strbuf, token, sizeof(token),
758 if((status=rrinternal_parse_rdata(&strbuf, token, sizeof(token),
1223 char token[64]; /* for a type name */
1239 sldns_bget_token(&strbuf, token, delim, sizeof(token)) != -1) {
1240 uint16_t t = sldns_get_rr_type_by_name(token);
1241 if(token[0] == 0)
1243 if(t == 0 && strcmp(token, "TYPE0") != 0)
1618 char token[50], proto_str[50];
1627 while(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) > 0) {
1628 ldns_tolower_str(token);
1630 struct protoent *p = getprotobyname(token);
1633 else rd[0] = (uint8_t)atoi(token);
1634 (void)strlcpy(proto_str, token, sizeof(proto_str));
1637 struct servent *serv = getservbyname(token, proto_str);
1640 serv_port = atoi(token);
1641 if(serv_port == 0 && strcmp(token, "0") != 0) {
1762 char token[512];
1769 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1772 rd[0] = (uint8_t)atoi(token);
1774 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1777 rd[1] = (uint8_t)atoi(token);
1780 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1783 rd[2] = (uint8_t)atoi(token);
1786 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1791 if(strcmp(token, ".") != 0)
1798 s = sldns_str2wire_a_buf(token, rd+3, &gwlen);
1803 s = sldns_str2wire_aaaa_buf(token, rd+3, &gwlen);
1808 s = sldns_str2wire_dname_buf(token, rd+3, &gwlen);