![David Perry](/assets/img/avatar_default.png)
As requested [here][1], help with replacing calls to `wmem_packet_scope()` with references to `pinfo->pool`. My principles were: * Plugins chosen semi-randomly. * When a calling function already has a `pinfo` argument, just use that. * Remove `_U_` from its signature if it was there. * Don't go more than 2 or 3 levels deep of changing signatures. * If a function is clearly allocing memory to return, change the function signature to take a `wmem_allocator_t *`. Otherwise, either that or take a `packet_info *` as seems to make sense. * No mention of `wmem_packet_scope()` should remain in the files I've touched. * I didn't always succeed at this, but I made a dent. [1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
31 lines
970 B
C
31 lines
970 B
C
/* packet-smb-common.h
|
|
* Routines for SMB packet dissection
|
|
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
|
|
*
|
|
* Wireshark - Network traffic analyzer
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
* Copyright 1998 Gerald Combs
|
|
*
|
|
* Copied from packet-pop.c
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef __PACKET_SMB_COMMON_H__
|
|
#define __PACKET_SMB_COMMON_H__
|
|
|
|
/* **data is allocated with ephemeral scope and will be automatically freed
|
|
* when packet dissection completes.
|
|
* You do NOT need to g_free() that string.
|
|
*/
|
|
int display_unicode_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, char **data);
|
|
|
|
int display_ms_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, char **data);
|
|
|
|
int dissect_ms_compressed_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index,
|
|
const char **data);
|
|
|
|
extern const value_string share_type_vals[];
|
|
|
|
#endif
|