squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
src
dns
rfc2671.cc
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3
*
4
* Squid software is distributed under GPLv2+ license and includes
5
* contributions from numerous individuals and organizations.
6
* Please see the COPYING and CONTRIBUTORS files for details.
7
*/
8
9
#include "
squid.h
"
10
#include "
dns/rfc1035.h
"
11
#include "
dns/rfc2671.h
"
12
13
int
14
rfc2671RROptPack
(
char
*buf,
size_t
sz
, ssize_t edns_sz)
15
{
16
// set the OPT record correctly. base it on a macro size of the Squid DNS read buffer
17
static
rfc1035_rr
opt;
18
19
// EDNS OPT record says only what our DNS buffer size is so far.
20
snprintf(opt.
name
,
RFC1035_MAXHOSTNAMESZ
,
"."
);
21
opt.
type
=
RFC1035_TYPE_OPT
;
22
opt.
_class
=
min
(edns_sz, (ssize_t)
SQUID_UDP_SO_RCVBUF
-1);
23
opt.
ttl
= 0;
// relevant?
24
opt.
rdata
=
NULL
;
25
opt.
rdlength
= 0;
26
27
return
rfc1035RRPack
(buf,
sz
, &opt);
28
}
29
rfc1035_rr::type
unsigned short type
Definition:
rfc1035.h:40
rfc1035_rr::rdlength
unsigned short rdlength
Definition:
rfc1035.h:43
rfc1035RRPack
int rfc1035RRPack(char *buf, const size_t sz, const rfc1035_rr *RR)
Definition:
rfc1035.cc:329
rfc2671.h
rfc2671RROptPack
int rfc2671RROptPack(char *buf, size_t sz, ssize_t edns_sz)
Definition:
rfc2671.cc:14
RFC1035_MAXHOSTNAMESZ
#define RFC1035_MAXHOSTNAMESZ
Definition:
rfc1035.h:32
rfc1035_rr::rdata
char * rdata
Definition:
rfc1035.h:44
NULL
#define NULL
Definition:
types.h:166
SQUID_UDP_SO_RCVBUF
#define SQUID_UDP_SO_RCVBUF
Definition:
squid.h:55
rfc1035_rr::_class
unsigned short _class
Definition:
rfc1035.h:41
rfc1035.h
sz
void const char int sz
Definition:
stub_cbdata.cc:16
rfc1035_rr::ttl
unsigned int ttl
Definition:
rfc1035.h:42
rfc1035_rr
Definition:
rfc1035.h:37
RFC1035_TYPE_OPT
#define RFC1035_TYPE_OPT
Definition:
rfc2671.h:13
rfc1035_rr::name
char name[RFC1035_MAXHOSTNAMESZ]
Definition:
rfc1035.h:39
squid.h
min
A const & min(A const &lhs, A const &rhs)
Definition:
compat_shared.h:121
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
gr
il
jp
pl
...
full list
FTP Package Archive