Lines Matching +full:6 +full:- +full:wire

1 // SPDX-License-Identifier: GPL-2.0-or-later
21 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR) in cifs_remap()
23 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR) in cifs_remap()
31 /* Convert character using the SFU - "Services for Unix" remapping range */
65 /* Convert character using the SFM - "Services for Mac" remapping range */
70 *target = src_char - 0xF000; in convert_sfm_char()
109 * cifs_mapchar - convert a host-endian char to proper char in codepage
110 * @target - where converted character should be copied
111 * @src_char - 2 byte host-endian source character
112 * @cp - codepage to which character should be converted
113 * @map_type - How should the 7 NTFS/SMB reserved characters be mapped to UCS2?
135 len = cp->uni2char(src_char, target, NLS_MAX_CHARSET_SIZE); in cifs_mapchar()
143 if (strcmp(cp->charset, "utf8")) in cifs_mapchar()
145 len = utf16s_to_utf8s(from, 3, UTF16_LITTLE_ENDIAN, target, 6); in cifs_mapchar()
157 * cifs_from_utf16 - convert utf16le string to local charset
158 * @to - destination buffer
159 * @from - source buffer
160 * @tolen - destination buffer size (in bytes)
161 * @fromlen - source buffer size (in bytes)
162 * @codepage - codepage to which characters should be converted
163 * @mapchar - should characters be remapped according to the mapchars option?
165 * Convert a little-endian utf16le string (as sent by the server) to a string
173 * Note that some windows versions actually send multiword UTF-16 characters
174 * instead of straight UTF16-2. The linux nls routines however aren't able to
187 __u16 ftmp[3]; /* ftmp[3] = 3array x 2bytes = 6bytes UTF-16 */ in cifs_from_utf16()
195 safelen = tolen - (NLS_MAX_CHARSET_SIZE + nullsize); in cifs_from_utf16()
216 if ((outlen + charlen) > (tolen - nullsize)) in cifs_from_utf16()
224 /* charlen (=bytes of UTF-8 for 1 character) in cifs_from_utf16()
225 * 4bytes UTF-8(surrogate pair) is charlen=4 in cifs_from_utf16()
226 * (4bytes UTF-16 code) in cifs_from_utf16()
227 * 7-8bytes UTF-8(IVS) is charlen=3+4 or 4+4 in cifs_from_utf16()
228 * (2 UTF-8 pairs divided to 2 UTF-16 pairs) */ in cifs_from_utf16()
232 /* 5-6bytes UTF-8 */ in cifs_from_utf16()
236 /* properly null-terminate string */ in cifs_from_utf16()
258 if (!strcmp(codepage->charset, "utf8")) { in cifs_strtoUTF16()
260 * convert utf8 -> utf16, we assume we have enough space in cifs_strtoUTF16()
278 for (i = 0; len && *from; i++, from += charlen, len -= charlen) { in cifs_strtoUTF16()
279 charlen = codepage->char2uni(from, len, &wchar_to); in cifs_strtoUTF16()
296 * cifs_utf16_bytes - how long will a string be after conversion?
297 * @utf16 - pointer to input string
298 * @maxbytes - don't go past this many bytes of input string
299 * @codepage - destination codepage
336 * cifs_strndup_from_utf16 - copy a string from wire format to the local
338 * @src - source string
339 * @maxlen - don't walk past this many bytes in the source string
340 * @is_unicode - is this a unicode string?
341 * @codepage - destination codepage
449 * Convert 16 bit Unicode pathname to wire format from string in current code
451 * only legal in POSIX-like OS (if they are present in the string). Path
452 * names are little endian 16 bit Unicode on the wire
463 wchar_t *wchar_to; /* UTF-16 */ in cifsConvertToUTF16()
470 wchar_to = kzalloc(6, GFP_KERNEL); in cifsConvertToUTF16()
492 if ((i == srclen - 1) || (source[i+1] == '\\')) in cifsConvertToUTF16()
506 charlen = cp->char2uni(source + i, srclen - i, &tmp); in cifsConvertToUTF16()
517 if (strcmp(cp->charset, "utf8") || !wchar_to) in cifsConvertToUTF16()
520 charlen = utf8_to_utf32(source + i, 6, &u); in cifsConvertToUTF16()
527 wchar_to, 6); in cifsConvertToUTF16()
534 /* 1-3bytes UTF-8 to 2bytes UTF-16 */ in cifsConvertToUTF16()
537 /* 4bytes UTF-8(surrogate pair) to 4bytes UTF-16 in cifsConvertToUTF16()
538 * 7-8bytes UTF-8(IVS) divided to 2 UTF-16 in cifsConvertToUTF16()
545 /* 5-6bytes UTF-8 to 6bytes UTF-16 */ in cifsConvertToUTF16()
577 * cifs_local_to_utf16_bytes - how long will a string be after conversion?
578 * @from - pointer to input string
579 * @maxbytes - don't go past this many bytes of input string
580 * @codepage - source codepage
595 for (i = 0; len && *from; i++, from += charlen, len -= charlen) { in cifs_local_to_utf16_bytes()
596 charlen = codepage->char2uni(from, len, &wchar_to); in cifs_local_to_utf16_bytes()
605 * cifs_strndup_to_utf16 - copy a string to wire format from the local codepage
606 * @src - source string
607 * @maxlen - don't walk past this many bytes in the source string
608 * @utf16_len - the length of the allocated string in bytes (including null)
609 * @cp - source codepage
610 * @remap - map special chars