Changeset 745 for trunk/server/source4/libcli/raw/raweas.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/libcli/raw/raweas.c
r414 r745 27 27 reasonable assumption 28 28 */ 29 size_t ea_list_size(u int_t num_eas, struct ea_struct *eas)30 { 31 u int_t total = 4;29 size_t ea_list_size(unsigned int num_eas, struct ea_struct *eas) 30 { 31 unsigned int total = 4; 32 32 int i; 33 33 for (i=0;i<num_eas;i++) { … … 40 40 work out how many bytes on the wire a ea name list will consume. 41 41 */ 42 static u int_t ea_name_list_size(uint_t num_names, struct ea_name *eas)43 { 44 u int_t total = 4;42 static unsigned int ea_name_list_size(unsigned int num_names, struct ea_name *eas) 43 { 44 unsigned int total = 4; 45 45 int i; 46 46 for (i=0;i<num_names;i++) { … … 55 55 reasonable assumption 56 56 */ 57 size_t ea_list_size_chained(u int_t num_eas, struct ea_struct *eas, unsigned alignment)58 { 59 u int_t total = 0;57 size_t ea_list_size_chained(unsigned int num_eas, struct ea_struct *eas, unsigned alignment) 58 { 59 unsigned int total = 0; 60 60 int i; 61 61 for (i=0;i<num_eas;i++) { 62 u int_t len = 8 + strlen(eas[i].name.s)+1 + eas[i].value.length;62 unsigned int len = 8 + strlen(eas[i].name.s)+1 + eas[i].value.length; 63 63 len = (len + (alignment-1)) & ~(alignment-1); 64 64 total += len; … … 71 71 of size ea_list_size() 72 72 */ 73 void ea_put_list(uint8_t *data, u int_t num_eas, struct ea_struct *eas)73 void ea_put_list(uint8_t *data, unsigned int num_eas, struct ea_struct *eas) 74 74 { 75 75 int i; … … 82 82 83 83 for (i=0;i<num_eas;i++) { 84 u int_t nlen = strlen(eas[i].name.s);84 unsigned int nlen = strlen(eas[i].name.s); 85 85 SCVAL(data, 0, eas[i].flags); 86 86 SCVAL(data, 1, nlen); … … 97 97 at least of size ea_list_size() 98 98 */ 99 void ea_put_list_chained(uint8_t *data, u int_t num_eas, struct ea_struct *eas,99 void ea_put_list_chained(uint8_t *data, unsigned int num_eas, struct ea_struct *eas, 100 100 unsigned alignment) 101 101 { … … 103 103 104 104 for (i=0;i<num_eas;i++) { 105 u int_t nlen = strlen(eas[i].name.s);105 unsigned int nlen = strlen(eas[i].name.s); 106 106 uint32_t len = 8+nlen+1+eas[i].value.length; 107 u int_t pad = ((len + (alignment-1)) & ~(alignment-1)) - len;107 unsigned int pad = ((len + (alignment-1)) & ~(alignment-1)) - len; 108 108 if (i == num_eas-1) { 109 109 SIVAL(data, 0, 0); … … 125 125 pull a ea_struct from a buffer. Return the number of bytes consumed 126 126 */ 127 u int_t ea_pull_struct(const DATA_BLOB *blob,127 unsigned int ea_pull_struct(const DATA_BLOB *blob, 128 128 TALLOC_CTX *mem_ctx, 129 129 struct ea_struct *ea) … … 165 165 NTSTATUS ea_pull_list(const DATA_BLOB *blob, 166 166 TALLOC_CTX *mem_ctx, 167 u int_t *num_eas, struct ea_struct **eas)167 unsigned int *num_eas, struct ea_struct **eas) 168 168 { 169 169 int n; … … 185 185 186 186 while (ofs < ea_size) { 187 u int_t len;187 unsigned int len; 188 188 DATA_BLOB blob2; 189 189 … … 214 214 NTSTATUS ea_pull_list_chained(const DATA_BLOB *blob, 215 215 TALLOC_CTX *mem_ctx, 216 u int_t *num_eas, struct ea_struct **eas)216 unsigned int *num_eas, struct ea_struct **eas) 217 217 { 218 218 int n; … … 229 229 230 230 while (ofs < blob->length) { 231 u int_t len;231 unsigned int len; 232 232 DATA_BLOB blob2; 233 233 uint32_t next_ofs = IVAL(blob->data, ofs); … … 262 262 pull a ea_name from a buffer. Return the number of bytes consumed 263 263 */ 264 static u int_t ea_pull_name(const DATA_BLOB *blob,264 static unsigned int ea_pull_name(const DATA_BLOB *blob, 265 265 TALLOC_CTX *mem_ctx, 266 266 struct ea_name *ea) … … 290 290 NTSTATUS ea_pull_name_list(const DATA_BLOB *blob, 291 291 TALLOC_CTX *mem_ctx, 292 u int_t *num_names, struct ea_name **ea_names)292 unsigned int *num_names, struct ea_name **ea_names) 293 293 { 294 294 int n; … … 310 310 311 311 while (ofs < ea_size) { 312 u int_t len;312 unsigned int len; 313 313 DATA_BLOB blob2; 314 314 … … 338 338 */ 339 339 bool ea_push_name_list(TALLOC_CTX *mem_ctx, 340 DATA_BLOB *data, u int_t num_names, struct ea_name *eas)340 DATA_BLOB *data, unsigned int num_names, struct ea_name *eas) 341 341 { 342 342 int i; … … 355 355 356 356 for (i=0;i<num_names;i++) { 357 u int_t nlen = strlen(eas[i].name.s);357 unsigned int nlen = strlen(eas[i].name.s); 358 358 SCVAL(data->data, off, nlen); 359 359 memcpy(data->data+off+1, eas[i].name.s, nlen+1);
Note:
See TracChangeset
for help on using the changeset viewer.