new SE_COPY_ADDRESS macro

svn path=/trunk/; revision=21364
This commit is contained in:
Tomas Kukosa 2007-04-10 13:35:39 +00:00
parent d72a70d653
commit 36fe262fa8
1 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,8 @@
#ifndef __ADDRESS_H__
#define __ADDRESS_H__
#include "emem.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@ -111,6 +113,15 @@ typedef struct _address {
(to)->data = COPY_ADDRESS_data; \
}
#define SE_COPY_ADDRESS(to, from) { \
guint8 *SE_COPY_ADDRESS_data; \
(to)->type = (from)->type; \
(to)->len = (from)->len; \
SE_COPY_ADDRESS_data = se_alloc((from)->len); \
memcpy(SE_COPY_ADDRESS_data, (from)->data, (from)->len); \
(to)->data = SE_COPY_ADDRESS_data; \
}
/* Types of port numbers Wireshark knows about. */
typedef enum {
PT_NONE, /* no port number */