1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

s3: Add packet_trn_id()

This commit is contained in:
Volker Lendecke 2011-01-04 18:07:12 +01:00
parent 5297f3fcff
commit d801d4da2d
2 changed files with 17 additions and 0 deletions

View File

@ -2772,6 +2772,7 @@ void put_name(char *dest, const char *name, int pad, unsigned int name_type);
char *nmb_namestr(const struct nmb_name *n);
struct packet_struct *copy_packet(struct packet_struct *packet);
void free_packet(struct packet_struct *packet);
int packet_trn_id(struct packet_struct *p);
struct packet_struct *parse_packet(char *buf,int length,
enum packet_type packet_type,
struct in_addr ip,

View File

@ -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.
******************************************************************/