~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to iocore/dns/P_DNSConnection.h

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 
 
3
  A brief file description
 
4
 
 
5
  @section license License
 
6
 
 
7
  Licensed to the Apache Software Foundation (ASF) under one
 
8
  or more contributor license agreements.  See the NOTICE file
 
9
  distributed with this work for additional information
 
10
  regarding copyright ownership.  The ASF licenses this file
 
11
  to you under the Apache License, Version 2.0 (the
 
12
  "License"); you may not use this file except in compliance
 
13
  with the License.  You may obtain a copy of the License at
 
14
 
 
15
      http://www.apache.org/licenses/LICENSE-2.0
 
16
 
 
17
  Unless required by applicable law or agreed to in writing, software
 
18
  distributed under the License is distributed on an "AS IS" BASIS,
 
19
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
20
  See the License for the specific language governing permissions and
 
21
  limitations under the License.
 
22
 */
 
23
 
 
24
/**************************************************************************
 
25
 
 
26
  P_DNSConnection.h
 
27
  Description:
 
28
  struct DNSConnection
 
29
  **************************************************************************/
 
30
 
 
31
#ifndef __P_DNSCONNECTION_H__
 
32
#define __P_DNSCONNECTION_H__
 
33
 
 
34
#include "I_EventSystem.h"
 
35
 
 
36
//
 
37
// Defines
 
38
//
 
39
 
 
40
#define NON_BLOCKING_CONNECT     true
 
41
#define BLOCKING_CONNECT         false
 
42
#define CONNECT_WITH_TCP         true
 
43
#define CONNECT_WITH_UDP         false
 
44
#define NON_BLOCKING             true
 
45
#define BLOCKING                 false
 
46
#define BIND_RANDOM_PORT         true
 
47
#define BIND_ANY_PORT            false
 
48
#define ENABLE_MC_LOOPBACK       true
 
49
#define DISABLE_MC_LOOPBACK      false
 
50
#define BC_NO_CONNECT            true
 
51
#define BC_CONNECT               false
 
52
#define BC_NO_BIND               true
 
53
#define BC_BIND                  false
 
54
 
 
55
//
 
56
// Connection
 
57
//
 
58
struct DNSHandler;
 
59
 
 
60
struct DNSConnection
 
61
{
 
62
  int fd;
 
63
  struct sockaddr_in sa;
 
64
  int num;
 
65
  LINK(DNSConnection, link);
 
66
  EventIO eio;
 
67
  InkRand generator;
 
68
  DNSHandler* handler;
 
69
 
 
70
  int connect(unsigned int ip, int port,
 
71
              bool non_blocking_connect = NON_BLOCKING_CONNECT,
 
72
              bool use_tcp = CONNECT_WITH_TCP, bool non_blocking = NON_BLOCKING, bool bind_random_port = BIND_ANY_PORT);
 
73
  int close();
 
74
  void trigger();
 
75
 
 
76
  virtual ~DNSConnection();
 
77
  DNSConnection();
 
78
};
 
79
 
 
80
#endif /*_P_DNSConnection_h*/