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

1 // SPDX-License-Identifier: GPL-2.0-or-later
20 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR) in cifs_remap()
22 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR) in cifs_remap()
30 /* Convert character using the SFU - "Services for Unix" remapping range */
64 /* Convert character using the SFM - "Services for Mac" remapping range */
69 *target = src_char - 0xF000; in convert_sfm_char()
108 * cifs_mapchar - convert a host-endian char to proper char in codepage
109 * @target - where converted character should be copied
110 * @src_char - 2 byte host-endian source character
111 * @cp - codepage to which character should be converted
112 * @map_type - How should the 7 NTFS/SMB reserved characters be mapped to UCS2?
134 len = cp->uni2char(src_char, target, NLS_MAX_CHARSET_SIZE); in cifs_mapchar()
142 if (strcmp(cp->charset, "utf8")) in cifs_mapchar()
144 len = utf16s_to_utf8s(from, 3, UTF16_LITTLE_ENDIAN, target, 6); in cifs_mapchar()
156 * cifs_from_utf16 - convert utf16le string to local charset
157 * @to - destination buffer
158 * @from - source buffer
159 * @tolen - destination buffer size (in bytes)
160 * @fromlen - source buffer size (in bytes)
161 * @codepage - codepage to which characters should be converted
162 * @mapchar - should characters be remapped according to the mapchars option?
164 * Convert a little-endian utf16le string (as sent by the server) to a string
172 * Note that some windows versions actually send multiword UTF-16 characters
173 * instead of straight UTF16-2. The linux nls routines however aren't able to
186 __u16 ftmp[3]; /* ftmp[3] = 3array x 2bytes = 6bytes UTF-16 */ in cifs_from_utf16()
194 safelen = tolen - (NLS_MAX_CHARSET_SIZE + nullsize); in cifs_from_utf16()
215 if ((outlen + charlen) > (tolen - nullsize)) in cifs_from_utf16()
223 /* charlen (=bytes of UTF-8 for 1 character) in cifs_from_utf16()
224 * 4bytes UTF-8(surrogate pair) is charlen=4 in cifs_from_utf16()
225 * (4bytes UTF-16 code) in cifs_from_utf16()
226 * 7-8bytes UTF-8(IVS) is charlen=3+4 or 4+4 in cifs_from_utf16()
227 * (2 UTF-8 pairs divided to 2 UTF-16 pairs) */ in cifs_from_utf16()
231 /* 5-6bytes UTF-8 */ in cifs_from_utf16()
235 /* properly null-terminate string */ in cifs_from_utf16()
257 if (!strcmp(codepage->charset, "utf8")) { in cifs_strtoUTF16()
259 * convert utf8 -> utf16, we assume we have enough space in cifs_strtoUTF16()
277 for (i = 0; len && *from; i++, from += charlen, len -= charlen) { in cifs_strtoUTF16()
278 charlen = codepage->char2uni(from, len, &wchar_to); in cifs_strtoUTF16()
295 * cifs_utf16_bytes - how long will a string be after conversion?
296 * @utf16 - pointer to input string
297 * @maxbytes - don't go past this many bytes of input string
298 * @codepage - destination codepage
335 * cifs_strndup_from_utf16 - copy a string from wire format to the local
337 * @src - source string
338 * @maxlen - don't walk past this many bytes in the source string
339 * @is_unicode - is this a unicode string?
340 * @codepage - destination codepage
448 * Convert 16 bit Unicode pathname to wire format from string in current code
450 * only legal in POSIX-like OS (if they are present in the string). Path
451 * names are little endian 16 bit Unicode on the wire
462 wchar_t *wchar_to; /* UTF-16 */ in cifsConvertToUTF16()
469 wchar_to = kzalloc(6, GFP_KERNEL); in cifsConvertToUTF16()
491 if ((i == srclen - 1) || (source[i+1] == '\\')) in cifsConvertToUTF16()
505 charlen = cp->char2uni(source + i, srclen - i, &tmp); in cifsConvertToUTF16()
516 if (strcmp(cp->charset, "utf8") || !wchar_to) in cifsConvertToUTF16()
519 charlen = utf8_to_utf32(source + i, 6, &u); in cifsConvertToUTF16()
526 wchar_to, 6); in cifsConvertToUTF16()
533 /* 1-3bytes UTF-8 to 2bytes UTF-16 */ in cifsConvertToUTF16()
536 /* 4bytes UTF-8(surrogate pair) to 4bytes UTF-16 in cifsConvertToUTF16()
537 * 7-8bytes UTF-8(IVS) divided to 2 UTF-16 in cifsConvertToUTF16()
544 /* 5-6bytes UTF-8 to 6bytes UTF-16 */ in cifsConvertToUTF16()
576 * cifs_local_to_utf16_bytes - how long will a string be after conversion?
577 * @from - pointer to input string
578 * @maxbytes - don't go past this many bytes of input string
579 * @codepage - source codepage
594 for (i = 0; len && *from; i++, from += charlen, len -= charlen) { in cifs_local_to_utf16_bytes()
595 charlen = codepage->char2uni(from, len, &wchar_to); in cifs_local_to_utf16_bytes()
604 * cifs_strndup_to_utf16 - copy a string to wire format from the local codepage
605 * @src - source string
606 * @maxlen - don't walk past this many bytes in the source string
607 * @utf16_len - the length of the allocated string in bytes (including null)
608 * @cp - source codepage
609 * @remap - map special chars