summaryrefslogtreecommitdiff
path: root/source3/libsmb/nmblib.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-04 18:07:12 +0100
committerVolker Lendecke <vl@samba.org>2011-01-07 13:28:04 +0100
commitd801d4da2d9f6146b4dfe5e2a0be00e8d2d3ae1b (patch)
tree92e0d8efb9c597cccc3b73584188c1244245c314 /source3/libsmb/nmblib.c
parent5297f3fcffbe42c646048abf63e63ed10d971d46 (diff)
downloadsamba-d801d4da2d9f6146b4dfe5e2a0be00e8d2d3ae1b.tar.gz
samba-d801d4da2d9f6146b4dfe5e2a0be00e8d2d3ae1b.tar.bz2
samba-d801d4da2d9f6146b4dfe5e2a0be00e8d2d3ae1b.zip
s3: Add packet_trn_id()
Diffstat (limited to 'source3/libsmb/nmblib.c')
-rw-r--r--source3/libsmb/nmblib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index e10bd7aa7b..fd011ebf27 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -726,6 +726,22 @@ void free_packet(struct packet_struct *packet)
SAFE_FREE(packet);
}
+int packet_trn_id(struct packet_struct *p)
+{
+ int result;
+ switch (p->packet_type) {
+ case NMB_PACKET:
+ result = p->packet.nmb.header.name_trn_id;
+ break;
+ case DGRAM_PACKET:
+ result = p->packet.dgram.header.dgm_id;
+ break;
+ default:
+ result = -1;
+ }
+ return result;
+}
+
/*******************************************************************
Parse a packet buffer into a packet structure.
******************************************************************/