summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relayd.h
AgeCommit message (Collapse)Author
2008-07-09Use OpenBSD's knuth shuffle algorithm of random values from bind toReyk Floeter
produce the DNS request ids instead of a simple per-request arc4random(). This ensure randomness but also satisfies the non-repeating property we need. ok deraadt@
2008-07-09also set the protocol, either TCP or UDP, in the NAT lookup. thisReyk Floeter
unbreaks NAT lookups with UDP; tested as a transparent DNS relay.
2008-07-09update the relay dns code to open a new udp socket to send theReyk Floeter
forwarded dns request to the server instead of sending from the server socket. this will fix the limitation the the dns relay had to listen to the "0.0.0.0" address, and will also enable relayd to use the udp source port randomization. relayd will know randomize the source port (on OpenBSD) and DNS request identifier for the clients behind it. ok pyr@
2008-06-11add support for "transparent" forwarding in relays: normally the l7Reyk Floeter
relay will connect to the target host with its own ip address, but this mode will let it use the address of the client that is connecting from the other side. for example, there is no need to add the X-Forwarded-For HTTP headers for internal webservers in this mode anymore since they magically see the remote client ip address in the connection. it also allows to build fully-transparent ssl encapsulation for tcp sessions and many other things... based on an initial idea from dlg@ and pascoe@ (dlg's talk at opencon) using the new BINDANY and divert-reply interfaces from markus@ (since n2k8) ok markus@ pyr@
2008-05-08move the session keys used by dns in a protocol-specific private ptr.Reyk Floeter
2008-05-07add an alternative "route to" mode to relayd redirections which mapsReyk Floeter
to pf route-to instead of the default rdr. it is a first steps towards support for "direct server return" (dsr), an asynchronous mode where the load balanced servers send the replies to a different gateway like a l3 switch/router to handle higher amounts of return traffic. because the state handling in pf isn't optimal for this case yet, it just sees half of the TCP connection, the sessions are forced to time out after fixed number of seconds. discussed with many, thought about in the onsen
2008-05-06Do not unconditionnaly load pf. If pf isn't required by the configurationPierre-Yves Ritschard
the initialisation isn't done properly.
2008-02-13bump copyrightReyk Floeter
2008-02-13stylistic change: move code to add protonodes from the BNF intoReyk Floeter
seperate functions in relayd.c (protonode_add/protonode_header). this code got to big to look nice in the BNF statements...
2008-02-11Marry relayd with snmpd using new "send trap" option: Request to sendReyk Floeter
a SNMP trap when the state of a host changes. relayd(8) will try to (re-)connect to snmpd(8) and request it to send a trap to the registered trap receivers, see snmpd.conf(5) for more information about the configuration. ok pyr@ thib@
2008-02-04Move some prototypes from relay.c to relayd.h and remove there externsThordur I. Bjornsson
in other places; ok reyk@
2008-02-04Move the declaration of DPRINTF from relay.c too relayd.h so it can beThordur I. Bjornsson
reused; ok reyk@
2008-02-04declare se_relay as pointer to a struct relay not as a void pointer;Thordur I. Bjornsson
shuffle the forward decleration of struct relay around too accommodate this change; ok reyk@
2008-01-31add prefixes to names of structure elements to make it easier to grepThordur I. Bjornsson
for code, next struct session; ok reyk@;
2008-01-31add prefixes to names of structure elements to make it easier to grepReyk Floeter
for code, next struct relay. knf long line fixes will follow later. ok thib@
2008-01-31add prefixes to names of structure elements to make it easier to grepReyk Floeter
for code, start with struct relayd. finally. ok thib@
2007-12-20implement statistics for redirections, like the existing statisticsReyk Floeter
for relays. they can be viewed with the new "relayctl show redirects" command. (uses the previous change to pf_table.c to get the statistics) looks good pyr@
2007-12-08Rename everything which reffered to services refer to rdr for internalsPierre-Yves Ritschard
(for instance: rename struct service to struct rdr), refer to redirects otherwise (hoststatectl output). ok reyk@
2007-12-08some changes to the relayd.conf configuration language and grammar.Reyk Floeter
the tables will look more like pf tables, it is easier to re-use tables with different options, "services" will become "redirections" (they refer to rdr pf rules), sync configuration directives of redirect (l3, ex-service) relay (l7) sections (for example "virtual host" will become "listen on"), all target definitions will start with "forward to", etc. pp. (see relay.conf(5) and etc/relayd.conf) discussed with pyr and deraadt ok pyr@
2007-12-07hoststated gets renamed to relayd. easier to type, and actually saysReyk Floeter
what the daemon does - it is a relayer that pays attention to the status of pools of hosts; not a status checkers that happens to do some relaying
2007-11-26allow to add labels to protocol actions, they will be printed in httpReyk Floeter
error pages and can be used to refer to additional information. ok pyr@
2007-11-24extend the url lookup algorithm to match the full URL and differentReyk Floeter
possible suffix/prefix combinations by stripping subdomains, path components, and the query args. ok and tested by gilles@
2007-11-23re-implement the "mark" action and document it in the manpage:Reyk Floeter
it is possible to attach a mark to a session based on matching an entity (header, url, cookie, ...) and add conditional action for this mark. it works a bit like the tag/tagged keywords in pf, but i decided to pick a different name to avoid confusion. ok pyr@ gilles@
2007-11-22shuffle some structure elements; avoid using enums in *_config structs.Reyk Floeter
2007-11-22Fix relay roundrobin mode to work correctly when multiple hosts in aReyk Floeter
table are down. Thanks to Preston Norvell at serialssolutions dot com for reporting the problem.
2007-11-22add (new) "url" protocol action, this can be used to match/filter URLReyk Floeter
suffix/prefix expressions like "example.com/index.html?args". a digest mode allows to match against anonymized SHA1/MD5 digests of suffix/prefix expressions.
2007-11-21spacingReyk Floeter
2007-11-21move digest string handling into an extra function.Reyk Floeter
2007-11-21rename the "url" filter action to "query" to use the correct term.Reyk Floeter
please update your hoststated.conf configurations. also add more examples to the manpage. alright pyr@
2007-11-21allow the http digest type to be either SHA1 or MD5 determined by theReyk Floeter
digest string length; it is compatible to any existing SHA1-only configurations. ok pyr@ gilles@
2007-11-20it may be desirable to send a HTTP error page with error code and aReyk Floeter
meaningful message if a HTTP/HTTPS relay closes the connection for some reason. for example, a "403 Forbidden" if the request was rejected by a filter. this will be enabled with the "return error" option and is disabled by default, the standard behaviour is to silently drop the connection; the browser may display an empty page in this case. the look+feel of the HTTP error page can be customized with a CSS style sheet, but we do not intend to allow customization of the error page contents (hoststated is not a webserver!). ok pyr@
2007-11-20Allow overriding the global interval in a table.Pierre-Yves Ritschard
Table specific intervals must be multiples of the global interval. help and ok reyk@
2007-11-20bump table name size.Pierre-Yves Ritschard
ok reyk@
2007-11-19rework the internal handling of protocol actions a little bit:Reyk Floeter
- allow to use a key for multiple times by appending a queue of additional matches to the tree node. for example, this allows to specify multiple "expect" or "filter" actions to white-/black-list a list of HTTP-headers, URLs, .. - prevent specifing an HTTP header for multiple times when using the expect action. - minor code shuffling
2007-11-14make protos dynamic tooPierre-Yves Ritschard
2007-10-22load certificates text at parse time. then load them in relay processes.Pierre-Yves Ritschard
this separation will ease reload a bit more. ok reyk@ who spotted a stupid mistake again...
2007-10-19Move relays from static TAILQs to allocated ones.Pierre-Yves Ritschard
This syncs it with other hoststated entities and will make reload easier. This is step 1 out of 7 for reload.
2007-10-19Add the ability to schedule an immediate check through hoststatectl.Pierre-Yves Ritschard
Especially useful when interval is rather long. I was supposed to commit this before 4.2.
2007-10-12Silence some lint(1) warningsBret Lambert
ok pyr@
2007-10-05stylistic changes in the relay/relay_config structure.Reyk Floeter
2007-10-05using an enum in the imsg_hdr is gross, use a fixed u_int16_t insteadReyk Floeter
2007-10-02stop messing with lgetc to please hoststated's check/expect.Pierre-Yves Ritschard
instead move some of the logic in yylex and do hoststated specific translations into hoststated.c ok gilles@
2007-09-28Correct my mail address.Pierre-Yves Ritschard
2007-09-28Change the ssl_privsep code to work on char buffers.Pierre-Yves Ritschard
The fd based code introduced weirdness since all children were accessing the same fd at once. This will also greatly facilitate reloading, no fd-passing will be involved between the parent and relay children. While there, cleanup the code diverting from the original ssl_rsa.c code a bit more. Weird behavior discovery by pascoe@.
2007-09-27Simplify ssl_privsep.c, since it won't need to remain synced with thePierre-Yves Ritschard
equivalent openssl functions.
2007-09-25Introduce two new functions to be able to load certificates whilePierre-Yves Ritschard
already chrooted and with privileges dropped. This is the very first step in being able to reload a layer 7 configuration. not ok reyk who's away but should be glad to see this in.
2007-09-10add support for relaying DNS traffic (with a little bit of packetReyk Floeter
header randomization). this adds an infrastructure to support UDP-based protocols. ok gilles@, tested by some
2007-09-07add an interface to dump running relay sessions to the control socketReyk Floeter
2007-09-07remove unused flags field from the structureReyk Floeter
2007-09-07add a function to print delays in hours, minutes, and secondsReyk Floeter