aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/http_static/http_static.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2023-07-31 20:07:31 +0200
committerDamjan Marion <damarion@cisco.com>2023-07-31 20:10:57 +0200
commitf566524a210dcf55a667e54bdaae2a833a9b13a5 (patch)
tree507da518e5f23499457692cc778332c79bbf9443 /src/plugins/http_static/http_static.c
parent83ca6e66d090b91c84637d7a5ed6a91fa41f8359 (diff)
vppinfra: add unformat_c_string_array
Type: improvement Change-Id: Iea5ecca5d4cbc6c7aea69104830afcfe78c708ee Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/http_static/http_static.c')
0 files changed, 0 insertions, 0 deletions
; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .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 */
/*
 * mc_socket.h: socket based multicast for vlib mc
 *
 * Copyright (c) 2010 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_mc_socket_h__
#define __included_mc_socket_h__

#include <vlib/unix/unix.h>
#include <netinet/in.h>

typedef struct
{
  int socket;
  struct sockaddr_in tx_addr;
} mc_multicast_socket_t;

/* TCP catchup socket */
typedef struct
{
  int socket;
  u32 clib_file_index;

  u8 *input_vector;
  u8 *output_vector;
  u32 output_vector_n_written;

  u32 connect_in_progress;
} mc_socket_catchup_t;

typedef struct mc_socket_main_t
{
  mc_main_t mc_main;

  /* Multicast mastership/to-relay/from-relay sockets. */
  mc_multicast_socket_t multicast_sockets[MC_N_TRANSPORT_TYPE];

  /* Unicast UDP ack sockets */
  int ack_socket;

  /* TCP catchup server socket */
  int catchup_server_socket;

  /* Pool of stream-private catchup sockets */
  mc_socket_catchup_t *catchups;

  uword *catchup_index_by_file_descriptor;

  u32 rx_mtu_n_bytes;

  /* Receive MTU in bytes and VLIB buffers. */
  u32 rx_mtu_n_buffers;

  /* Vector of RX VLIB buffers. */
  u32 *rx_buffers;
  /* Vector of scatter/gather descriptors for sending/receiving VLIB buffers
     via kernel. */
  struct iovec *iovecs;

  /* IP address of interface to use for multicast. */
  u32 if_ip4_address_net_byte_order;

  u32 ack_udp_port;
  u32 catchup_tcp_port;

  /* Interface on which to listen for multicasts. */
  char *multicast_interface_name;

  /* Multicast address to use (e.g. 0xefff0000).
     Host byte order. */
  u32 multicast_tx_ip4_address_host_byte_order;

  /* TTL to use for multicasts. */
  u32 multicast_ttl;

  /* Multicast ports for mastership, joins, etc. will be chosen
     starting at the given port in host byte order.
     A total of MC_N_TRANSPORT_TYPE ports will be used. */
  u32 base_multicast_udp_port_host_byte_order;
} mc_socket_main_t;

always_inline u32
mc_socket_peer_id_get_address (mc_peer_id_t i)
{
  u32 a = ((i.as_u8[0] << 24)
	   | (i.as_u8[1] << 16) | (i.as_u8[2] << 8) | (i.as_u8[3] << 0));
  return clib_host_to_net_u32 (a);
}

always_inline u32
mc_socket_peer_id_get_port (mc_peer_id_t i)
{
  return clib_host_to_net_u16 ((i.as_u8[4] << 8) | i.as_u8[5]);
}

static_always_inline mc_peer_id_t
mc_socket_set_peer_id (u32 address_net_byte_order, u32 port_host_byte_order)
{
  mc_peer_id_t i;
  u32 a = ntohl (address_net_byte_order);
  u32 p = port_host_byte_order;
  i.as_u8[0] = (a >> 24) & 0xff;
  i.as_u8[1] = (a >> 16) & 0xff;
  i.as_u8[2] = (a >> 8) & 0xff;
  i.as_u8[3] = (a >> 0) & 0xff;
  i.as_u8[4] = (p >> 8) & 0xff;
  i.as_u8[5] = (p >> 0) & 0xff;
  i.as_u8[6] = 0;
  i.as_u8[7] = 0;
  return i;
}

clib_error_t *mc_socket_main_init (mc_socket_main_t * msm,
				   char **intfc_probe_list,
				   int n_intfcs_to_probe);
#endif /* __included_mc_socket_h__ */


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