forked from osmocom/wireshark
![Dario Lombardo](/assets/img/avatar_default.png)
Skipping dissectors dir for now. Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa Reviewed-on: https://code.wireshark.org/review/25694 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
45 lines
891 B
C
45 lines
891 B
C
/* tvbuff_base64.c
|
|
* Base-64 tvbuff implementation (based on real tvb)
|
|
*
|
|
* Wireshark - Network traffic analyzer
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
* Copyright 1998 Gerald Combs
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/tvbuff.h>
|
|
#include <wsutil/base64.h>
|
|
|
|
tvbuff_t *
|
|
base64_to_tvb(tvbuff_t *parent, const char *base64)
|
|
{
|
|
tvbuff_t *tvb;
|
|
char *data = g_strdup(base64);
|
|
gint len;
|
|
|
|
len = (gint) ws_base64_decode_inplace(data);
|
|
tvb = tvb_new_child_real_data(parent, (const guint8 *)data, len, len);
|
|
|
|
tvb_set_free_cb(tvb, g_free);
|
|
|
|
return tvb;
|
|
}
|
|
|
|
/*
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
*
|
|
* Local Variables:
|
|
* c-basic-offset: 2
|
|
* tab-width: 8
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*
|
|
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
|
* :indentSize=2:tabSize=8:noTabs=true:
|
|
*/
|