aboutsummaryrefslogtreecommitdiffstats
path: root/build-root/scripts/csit-test-branch
blob: 853e01d94d306b51dc1d28de1d270214bf43a010 (plain)
1
2
#!/bin/sh
echo oper-161120
; 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) 2022 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 SRC_PLUGINS_HTTP_HTTP_BUFFER_H_
#define SRC_PLUGINS_HTTP_HTTP_BUFFER_H_

#include <svm/svm_fifo.h>

#define HTTP_BUFFER_DATA_SZ 24

typedef enum http_buffer_type_
{
  HTTP_BUFFER_FIFO,
  HTTP_BUFFER_PTR,
} http_buffer_type_t;

typedef struct http_buffer_vft_ http_buffer_vft_t;

typedef struct http_buffer_
{
  http_buffer_vft_t *vft;
  u8 data[HTTP_BUFFER_DATA_SZ];
} http_buffer_t;

struct http_buffer_vft_
{
  void (*init) (http_buffer_t *, void *data, u32 len);
  void (*free) (http_buffer_t *);
  svm_fifo_seg_t *(*get_segs) (http_buffer_t *, u32 max_len, u32 *n_segs);
  int (*drain) (http_buffer_t *, u32 len);
  u8 (*is_drained) (http_buffer_t *);
};

void http_buffer_init (http_buffer_t *hb, http_buffer_type_t type,
		       svm_fifo_t *f, u32 data_len);

static inline void
http_buffer_free (http_buffer_t *hb)
{
  if (hb->vft)
    hb->vft->free (hb);
}

static inline svm_fifo_seg_t *
http_buffer_get_segs (http_buffer_t *hb, u32 max_len, u32 *n_segs)
{
  return hb->vft->get_segs (hb, max_len, n_segs);
}

static inline int
http_buffer_drain (http_buffer_t *hb, u32 len)
{
  return hb->vft->drain (hb, len);
}

static inline u8
http_buffer_is_drained (http_buffer_t *hb)
{
  return hb->vft->is_drained (hb);
}

#endif /* SRC_PLUGINS_HTTP_HTTP_BUFFER_H_ */

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