index  prev  next

push_string/pull_string

--------------------------------------------------------------------------------------

Most of the string smarts in Samba 3.0 are in the following two functions:

int push_string(const void *base_ptr, void *dest, const char *src, 
                int dest_len, int flags);
int pull_string(const void *base_ptr, char *dest, const void *src, 
                int dest_len, int src_len, int flags);
These two functions are the entry points to the code used to parse or construct strings in SMB packets.

The base_ptr provides access to the base SMB packet, both for the FLAGS2_UNICODE_STRINGS flag and string alignment.

The flags parameter tells the functions what type of string this field in the protocol uses. Possible flags include STR_TERMINATE, STR_UNICODE, STR_ASCII and STR_NOALIGN. None of these flags should really be necessary if the protocol had a consistent string format, but unfortunately it doesn't.

--------------------------------------------------------------------------------------

CIFS2001 Seattle
tridge@valinux.com