aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-gpe/lisp_gpe.h
AgeCommit message (Expand)AuthorFilesLines
2017-10-31LISP: add P-ITR/P-ETR/xTR API handlers, ONE-24Filip Tehlar1-1/+2
2017-10-24Add extern to *_main global variable declarations in header files.Dave Wallace1-1/+1
2017-06-08LISP: add NSH supportFilip Tehlar1-0/+3
2017-06-08Add gpe native-forward static route supportFlorin Coras1-1/+11
2017-06-05LISP-GPE: return index of newly created fwd entry, VPP-868Filip Tehlar1-0/+3
2017-05-22LISP-GPE: add dump call for VNIs in useFilip Tehlar1-0/+1
2017-04-13LISP: make statistics thread safeFilip Tehlar1-9/+4
2017-04-07Fix gpe dp args to allow for 32 bit bridge domain ids, VPP-690Florin Coras1-1/+1
2017-03-22LISP: improve DP speedFilip Tehlar1-0/+2
2017-03-21LISP statisticsFilip Tehlar1-0/+30
2017-03-01VPP-598: tcp stack initial commitDave Barach1-1/+3
2017-02-27Add GPE CLI/API for setting encap modeFilip Tehlar1-0/+12
2017-02-25Add NSH to GPE decap pathFlorin Coras1-0/+3
2017-02-13Basic support for LISP-GPE encapsulated NSH packetsFlorin Coras1-0/+9
2017-01-30LISP: add dump calls for GPE entries APIFilip Tehlar1-0/+11
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+257
eption */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2015 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef included_dns_packet_h
#define included_dns_packet_h

/**
 * DNS packet header format
 */

/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  u16 id;                       /**< transaction ID */
  u16 flags;                    /**< flags  */
  u16 qdcount;                  /**< number of questions */
  u16 anscount;                 /**< number of answers */
  u16 nscount;                  /**< number of name servers */
  u16 arcount;                  /**< number of additional records */
}) dns_header_t;
/* *INDENT-ON* */

#define DNS_RCODE_MASK (0xf)
#define DNS_RCODE_NO_ERROR 0
#define DNS_RCODE_FORMAT_ERROR 1
#define DNS_RCODE_SERVER_FAILURE 2
#define DNS_RCODE_NAME_ERROR 3
#define DNS_RCODE_NOT_IMPLEMENTED 4
#define DNS_RCODE_REFUSED 5

#define DNS_RA (1<<7)		/**< recursion available */
#define DNS_RD (1<<8)		/**< recursion desired */
#define DNS_TC (1<<9)	       /**< truncation  */
#define DNS_AA (1<<10)		/**< authoritative answer  */
#define DNS_OPCODE_MASK (0xf<<11) /**< opcode mask */
#define DNS_OPCODE_QUERY (0<<11)  /**< standard query */
#define DNS_OPCODE_IQUERY (1<<11) /**< inverse query (deprecated) */
#define DNS_OPCODE_STATUS (2<<11) /**< server status  */
#define DNS_QR (1<<15)		/**< query=0, response=1  */


/*
 * Note: in DNS-land, www.foobar.com is encoded as three "labels,"
 * each of which amount to a 1 octet length followed by up to 63
 * octets of name. Don't forget to add a "null root label" after the last
 * real one, or the poor slob trying to parse the name will have
 * no chance whatsoever.
 *
 * All RRs have the same top level format shown below:
 *
 *                                    1  1  1  1  1  1
 *      0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
 *    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *    |                                               |
 *    /                                               /
 *    /                      NAME                     /
 *    |                                               |
 *    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *    |                      TYPE                     |
 *    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *    |                     CLASS                     |
 *    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *    |                      TTL                      |
 *    |                                               |
 *    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *    |                   RDLENGTH                    |
 *    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
 *    /                     RDATA                     /
 *    /                                               /
 *    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *
 *
 *  DNS "questions" have the following format:
 *
 *                                     1  1  1  1  1  1
 *       0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
 *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *     |                                               |
 *     /                     QNAME                     /
 *     /                                               /
 *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *     |                     QTYPE                     |
 *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 *     |                     QCLASS                    |
 *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 */

/**
 * DNS "question" fixed header.
 */
/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  u16 type;	/**< record type requested */
  u16 class;	/**< class, 1 = internet */
}) dns_query_t;
/* *INDENT-ON* */

/**
 * DNS RR fixed header.
 */
/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  u16 type;	/**< record type */
  u16 class;	/**< class, 1 = internet */
  u32 ttl;	/**< time to live, in seconds */
  u16 rdlength;
  /**< length of r */
  u8 rdata[0];
}) dns_rr_t;
/* *INDENT-ON* */

/*
 * There are quite a number of DNS record types
 * Feel free to add as needed
 */
#define foreach_dns_type                        \
_(A, 1) 	/**< ip4 host address */        \
_(AAAA, 28)     /**< ip6 host address */        \
_(ALL, 255)     /**< all available data */      \
_(TEXT, 16)     /**< a text string */           \
_(NAMESERVER, 2) /**< a nameserver */           \
_(CNAME, 5)      /**< a CNAME (alias) */	\
_(MAIL_EXCHANGE, 15) /**< a mail exchange  */	\
_(PTR, 12)      /**< a PTR (pointer) record */	\
_(HINFO, 13)	/**< Host info */

typedef enum
{
#define _(name,value) DNS_TYPE_##name = value,
  foreach_dns_type
#undef _
} dns_type_t;

#define DNS_CLASS_IN	1	/**< The Internet */


#endif /* included_dns_packet_h */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */