Skip to content

Commit

Permalink
add ability to set status in pdu in public api
Browse files Browse the repository at this point in the history
  • Loading branch information
bdodge committed Jan 19, 2025
1 parent 2da33ae commit bdaef47
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/smb2/libsmb2.h
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ void smb2_add_compound_pdu(struct smb2_context *smb2,
struct smb2_pdu *pdu, struct smb2_pdu *next_pdu);
void smb2_free_pdu(struct smb2_context *smb2, struct smb2_pdu *pdu);
void smb2_queue_pdu(struct smb2_context *smb2, struct smb2_pdu *pdu);
void smb2_set_pdu_status(struct smb2_context *smb2, struct smb2_pdu *pdu, int status);
int smb2_pdu_is_compound(struct smb2_context *smb2);

/*
Expand Down
4 changes: 3 additions & 1 deletion include/smb2/smb2-errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,4 +544,6 @@
#define SMB2_STATUS_SERVER_UNAVAILABLE 0xC0000466

/* Warning codes */
#define SMB2_STATUS_STOPPED_ON_SYMLINK 0x8000002d
#define SMB2_STATUS_BUFFER_OVERFLOW 0x80000005
#define SMB2_STATUS_STOPPED_ON_SYMLINK 0x8000002D

6 changes: 6 additions & 0 deletions lib/pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ smb2_queue_pdu(struct smb2_context *smb2, struct smb2_pdu *pdu)
smb2_add_to_outqueue(smb2, pdu);
}

void
smb2_set_pdu_status(struct smb2_context *smb2, struct smb2_pdu *pdu, int status)
{
pdu->header.status = status;
}

struct smb2_pdu *
smb2_find_pdu(struct smb2_context *smb2,
uint64_t message_id) {
Expand Down

0 comments on commit bdaef47

Please sign in to comment.