• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/unbound/sldns/

Lines Matching refs:token

188 	size_t prev_len, char* token, size_t token_len)
191 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
199 if(token[0]=='@' && token[1]=='\0') {
216 } else if(*token == '\0') {
236 int s = sldns_str2wire_dname_buf_origin(token, rr, &dlen,
239 sldns_buffer_position(strbuf)-strlen(token));
247 rrinternal_get_ttl(sldns_buffer* strbuf, char* token, size_t token_len,
251 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
255 *ttl = (uint32_t) sldns_str2period(token, &endptr);
257 if (strlen(token) > 0 && !isdigit((unsigned char)token[0])) {
271 rrinternal_get_class(sldns_buffer* strbuf, char* token, size_t token_len,
274 /* if 'not_there' then we got token from previous parse routine */
276 /* parse new token for class */
277 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
282 *cl = sldns_get_rr_class_by_name(token);
283 /* class can be left out too, assume IN, current token must be type */
284 if(*cl == 0 && strcmp(token, "CLASS0") != 0) {
293 rrinternal_get_type(sldns_buffer* strbuf, char* token, size_t token_len,
296 /* if 'not_there' then we got token from previous parse routine */
298 /* parse new token for type */
299 if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
304 *tp = sldns_get_rr_type_by_name(token);
305 if(*tp == 0 && strcmp(token, "TYPE0") != 0) {
391 rrinternal_spool_hex(char* token, uint8_t* rr, size_t rr_len,
394 char* p = token;
402 p-token);
405 p-token);
409 p-token);
426 rrinternal_parse_unknown(sldns_buffer* strbuf, char* token, size_t token_len,
435 if(sldns_bget_token(strbuf, token, delim, token_len) == -1)
438 if(sldns_bget_token(strbuf, token, delim, token_len) == -1) {
443 hex_data_size = (size_t)atoi(token);
454 ssize_t c = sldns_bget_token(strbuf, token, delim, token_len);
455 if((status = rrinternal_spool_hex(token, rr, *rr_len,
458 sldns_buffer_position(strbuf)-strlen(token));
473 rrinternal_parse_rdf(sldns_buffer* strbuf, char* token, size_t token_len,
484 if(strcmp(token, "@") == 0) {
505 int s = sldns_str2wire_dname_buf_origin(token,
508 sldns_buffer_position(strbuf)-strlen(token));
519 size_t tlen = strlen(token);
520 (void)sldns_bget_token(strbuf, token+tlen, "\n",
529 if((status=sldns_str2wire_rdf_buf(token, rr+(*rr_cur_len), &len,
532 sldns_buffer_position(strbuf)-strlen(token));
538 * Parse one rdf token. Takes care of quotes and parenthesis.
541 sldns_parse_rdf_token(sldns_buffer* strbuf, char* token, size_t token_len,
554 if(sldns_bget_token_par(strbuf, token, (*quoted)?"\"":delimiters,
558 slen = strlen(token);
562 (token[0] == '"' || token[0] == '\'') &&
563 (token[slen-1] == '"' || token[slen-1] == '\'')) {
564 /* move token two smaller (quotes) with endnull */
565 memmove(token, token+1, slen-2);
566 token[slen-2] = 0;
571 (token[0] == '"' || token[0] == '\'')) {
573 * of quoted string as well into remainder of token */
574 memmove(token, token+1, slen-1);
575 token[slen-1] = 0;
584 if(sldns_bget_token_par(strbuf, token+slen,
589 slen = strlen(token);
595 /** Add space and one more rdf token onto the existing token string. */
597 sldns_affix_token(sldns_buffer* strbuf, char* token, size_t* token_len,
606 token[*token_strlen] = ' ';
607 token[++(*token_strlen)] = 0;
609 /* read another token */
611 if(!sldns_parse_rdf_token(strbuf, token+*token_strlen, addlen, quoted,
620 rrinternal_parse_rdata(sldns_buffer* strbuf, char* token, size_t token_len,
646 if(!sldns_parse_rdf_token(strbuf, token, token_len, &quoted,
656 if(token_strlen>=2 && strncmp(token, "\\#", 2) == 0 &&
657 !quoted && (token_strlen == 2 || token[2]==' ')) {
659 if((status=rrinternal_parse_unknown(strbuf, token,
666 if(!sldns_affix_token(strbuf, token,
671 if(!sldns_affix_token(strbuf, token,
677 strcmp(token, "0")!=0) {
679 if(!sldns_affix_token(strbuf, token,
687 if((status=rrinternal_parse_rdf(strbuf, token,
701 if(sldns_bget_token_par(strbuf, token, "\n", token_len,
708 if(strcmp(token, "") != 0)
739 char token[LDNS_MAX_RDFLEN+1];
751 origin_len, prev, prev_len, token, sizeof(token))) != 0)
755 if((status=rrinternal_get_ttl(&strbuf, token, sizeof(token),
758 if((status=rrinternal_get_class(&strbuf, token, sizeof(token),
761 if((status=rrinternal_get_type(&strbuf, token, sizeof(token),
775 if((status=rrinternal_parse_rdata(&strbuf, token, sizeof(token),
1280 char token[64]; /* for a type name */
1296 sldns_bget_token(&strbuf, token, delim, sizeof(token)) != -1) {
1297 uint16_t t = sldns_get_rr_type_by_name(token);
1298 if(token[0] == 0)
1300 if(t == 0 && strcmp(token, "TYPE0") != 0)
1708 char token[50], proto_str[50];
1717 while(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) > 0) {
1718 ldns_tolower_str(token);
1720 struct protoent *p = getprotobyname(token);
1723 else if(strcasecmp(token, "tcp")==0) rd[0]=6;
1724 else if(strcasecmp(token, "udp")==0) rd[0]=17;
1725 else rd[0] = (uint8_t)atoi(token);
1726 (void)strlcpy(proto_str, token, sizeof(proto_str));
1729 struct servent *serv = getservbyname(token, proto_str);
1731 else if(strcasecmp(token, "domain")==0) serv_port=53;
1733 serv_port = atoi(token);
1734 if(serv_port == 0 && strcmp(token, "0") != 0) {
1855 char token[512];
1862 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1865 rd[0] = (uint8_t)atoi(token);
1867 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1870 rd[1] = (uint8_t)atoi(token);
1873 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1876 rd[2] = (uint8_t)atoi(token);
1879 if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
1884 if(strcmp(token, ".") != 0)
1891 s = sldns_str2wire_a_buf(token, rd+3, &gwlen);
1896 s = sldns_str2wire_aaaa_buf(token, rd+3, &gwlen);
1901 s = sldns_str2wire_dname_buf(token, rd+3, &gwlen);