Lines Matching refs:token

189 	size_t prev_len, char* token, size_t token_len)
192 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
200 if(token[0]=='@' && token[1]=='\0') {
217 } else if(*token == '\0') {
237 int s = sldns_str2wire_dname_buf_origin(token, rr, &dlen,
240 sldns_buffer_position(strbuf)-strlen(token));
248 rrinternal_get_ttl(sldns_buffer* strbuf, char* token, size_t token_len,
253 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
257 *ttl = (uint32_t) sldns_str2period(token, &endptr, &overflow);
263 if (strlen(token) > 0 && !isdigit((unsigned char)token[0])) {
277 rrinternal_get_class(sldns_buffer* strbuf, char* token, size_t token_len,
280 /* if 'not_there' then we got token from previous parse routine */
282 /* parse new token for class */
283 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
288 *cl = sldns_get_rr_class_by_name(token);
289 /* class can be left out too, assume IN, current token must be type */
290 if(*cl == 0 && strcmp(token, "CLASS0") != 0) {
299 rrinternal_get_type(sldns_buffer* strbuf, char* token, size_t token_len,
302 /* if 'not_there' then we got token from previous parse routine */
304 /* parse new token for type */
305 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
310 *tp = sldns_get_rr_type_by_name(token);
311 if(*tp == 0 && strcmp(token, "TYPE0") != 0) {
398 rrinternal_spool_hex(char* token, uint8_t* rr, size_t rr_len,
401 char* p = token;
409 p-token);
412 p-token);
416 p-token);
433 rrinternal_parse_unknown(sldns_buffer* strbuf, char* token, size_t token_len,
442 if(sldns_bget_token(strbuf, token, delim, token_len) == -1)
445 if(sldns_bget_token(strbuf, token, delim, token_len) == -1) {
450 hex_data_size = (size_t)atoi(token);
461 ssize_t c = sldns_bget_token(strbuf, token, delim, token_len);
462 if((status = rrinternal_spool_hex(token, rr, *rr_len,
465 sldns_buffer_position(strbuf)-strlen(token));
480 rrinternal_parse_rdf(sldns_buffer* strbuf, char* token, size_t token_len,
491 if(strcmp(token, "@") == 0) {
512 int s = sldns_str2wire_dname_buf_origin(token,
515 sldns_buffer_position(strbuf)-strlen(token));
526 size_t tlen = strlen(token);
527 (void)sldns_bget_token(strbuf, token+tlen, "\n",
536 if((status=sldns_str2wire_rdf_buf(token, rr+(*rr_cur_len), &len,
539 sldns_buffer_position(strbuf)-strlen(token));
545 * Parse one rdf token. Takes care of quotes and parenthesis.
548 sldns_parse_rdf_token(sldns_buffer* strbuf, char* token, size_t token_len,
562 if(sldns_bget_token_par(strbuf, token, (*quoted)?"\"":delimiters,
566 slen = strlen(token);
570 (token[0] == '"' || token[0] == '\'') &&
571 (token[slen-1] == '"' || token[slen-1] == '\'')) {
572 /* move token two smaller (quotes) with endnull */
573 memmove(token, token+1, slen-2);
574 token[slen-2] = 0;
579 (token[0] == '"' || token[0] == '\'')) {
581 * of quoted string as well into remainder of token */
582 memmove(token, token+1, slen-1);
583 token[slen-1] = 0;
592 if(sldns_bget_token_par(strbuf, token+slen,
597 slen = strlen(token);
603 /** Add space and one more rdf token onto the existing token string. */
605 sldns_affix_token(sldns_buffer* strbuf, char* token, size_t* token_len,
613 /* when addlen < 2, the token buffer is full considering the NULL byte
617 token[*token_strlen] = ' ';
618 token[++(*token_strlen)] = 0;
620 /* read another token */
622 if(!sldns_parse_rdf_token(strbuf, token+*token_strlen, addlen, quoted,
747 rrinternal_parse_rdata(sldns_buffer* strbuf, char* token, size_t token_len,
773 if(!sldns_parse_rdf_token(strbuf, token, token_len, &quoted,
783 if(token_strlen>=2 && strncmp(token, "\\#", 2) == 0 &&
784 !quoted && (token_strlen == 2 || token[2]==' ' ||
785 token[2]=='\t')) {
787 if((status=rrinternal_parse_unknown(strbuf, token,
794 if(!sldns_affix_token(strbuf, token,
799 if(!sldns_affix_token(strbuf, token,
805 strcmp(token, "0")!=0) {
807 if(!sldns_affix_token(strbuf, token,
815 if((status=rrinternal_parse_rdf(strbuf, token,
829 if(sldns_bget_token_par(strbuf, token, "\n", token_len,
836 if(strcmp(token, "") != 0)
903 char token[LDNS_MAX_RDFLEN+1];
915 origin_len, prev, prev_len, token, sizeof(token))) != 0)
919 if((status=rrinternal_get_ttl(&strbuf, token, sizeof(token),
922 if((status=rrinternal_get_class(&strbuf, token, sizeof(token),
925 if((status=rrinternal_get_type(&strbuf, token, sizeof(token),
939 if((status=rrinternal_parse_rdata(&strbuf, token, sizeof(token),
2005 char token[64]; /* for a type name */
2021 sldns_bget_token(&strbuf, token, delim, sizeof(token)) != -1) {
2022 uint16_t t = sldns_get_rr_type_by_name(token);
2023 if(token[0] == 0)
2025 if(t == 0 && strcmp(token, "TYPE0") != 0)
2441 char token[50], proto_str[50];
2450 while(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) > 0) {
2451 ldns_tolower_str(token);
2453 struct protoent *p = getprotobyname(token);
2456 else if(strcasecmp(token, "tcp")==0) rd[0]=6;
2457 else if(strcasecmp(token, "udp")==0) rd[0]=17;
2458 else rd[0] = (uint8_t)atoi(token);
2459 (void)strlcpy(proto_str, token, sizeof(proto_str));
2462 if(atoi(token) != 0) serv_port=atoi(token);
2463 else if(strcmp(token, "0") == 0) serv_port=0;
2464 else if(strcasecmp(token, "domain")==0) serv_port=53;
2466 struct servent *serv = getservbyname(token, proto_str);
2589 char token[512];
2596 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
2599 rd[0] = (uint8_t)atoi(token);
2601 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
2604 rd[1] = (uint8_t)atoi(token);
2607 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
2610 rd[2] = (uint8_t)atoi(token);
2613 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
2618 if(strcmp(token, ".") != 0)
2625 s = sldns_str2wire_a_buf(token, rd+3, &gwlen);
2630 s = sldns_str2wire_aaaa_buf(token, rd+3, &gwlen);
2635 s = sldns_str2wire_dname_buf(token, rd+3, &gwlen);