19package org.sleuthkit.datamodel;
21import java.text.MessageFormat;
22import java.util.ResourceBundle;
23import java.util.EnumSet;
32 private final static ResourceBundle bundle = ResourceBundle.getBundle(
"org.sleuthkit.datamodel.Bundle");
38 public enum TSK_FS_NAME_TYPE_ENUM {
53 private short dirType;
56 private TSK_FS_NAME_TYPE_ENUM(
int type, String
label) {
57 this.dirType = (short) type;
86 static public TSK_FS_NAME_TYPE_ENUM
valueOf(
short dir_type) {
87 for (TSK_FS_NAME_TYPE_ENUM v : TSK_FS_NAME_TYPE_ENUM.values()) {
88 if (v.dirType == dir_type) {
92 throw new IllegalArgumentException(
93 MessageFormat.format(bundle.getString(
"TskData.tskFsNameTypeEnum.exception.msg1.text"), dir_type));
101 public enum TSK_FS_META_TYPE_ENUM {
116 private short metaType;
117 private String metaTypeStr;
119 private TSK_FS_META_TYPE_ENUM(
int type, String metaTypeStr) {
120 this.metaType = (short) type;
121 this.metaTypeStr = metaTypeStr;
138 public static TSK_FS_META_TYPE_ENUM
valueOf(
short metaType) {
139 for (TSK_FS_META_TYPE_ENUM type : TSK_FS_META_TYPE_ENUM.values()) {
140 if (type.getValue() == metaType) {
144 throw new IllegalArgumentException(
145 MessageFormat.format(bundle.getString(
"TskData.tskFsMetaTypeEnum.exception.msg1.text"), metaType));
154 public enum TSK_FS_NAME_FLAG_ENUM {
156 UNKNOWN(0, bundle.getString(
"TskData.tskFsNameFlagEnum.unknown")),
157 ALLOC(1, bundle.getString(
"TskData.tskFsNameFlagEnum.allocated")),
158 UNALLOC(2, bundle.getString(
"TskData.tskFsNameFlagEnum.unallocated"));
160 private short dirFlag;
161 private String dirFlagStr;
163 private TSK_FS_NAME_FLAG_ENUM(
int flag, String dirFlagStr) {
164 this.dirFlag = (short) flag;
165 this.dirFlagStr = dirFlagStr;
189 public static TSK_FS_NAME_FLAG_ENUM
valueOf(
int dirFlag) {
190 for (TSK_FS_NAME_FLAG_ENUM flag : TSK_FS_NAME_FLAG_ENUM.values()) {
191 if (flag.dirFlag == dirFlag) {
196 return TSK_FS_NAME_FLAG_ENUM.
UNKNOWN;
205 public enum TSK_FS_META_FLAG_ENUM {
207 UNKNOWN(0, bundle.getString(
"TskData.tskFsMetaFlagEnum.unknown")),
208 ALLOC(1, bundle.getString(
"TskData.tskFsMetaFlagEnum.allocated")),
209 UNALLOC(2, bundle.getString(
"TskData.tskFsMetaFlagEnum.unallocated")),
210 USED(4, bundle.getString(
"TskData.tskFsMetaFlagEnum.used")),
211 UNUSED(8, bundle.getString(
"TskData.tskFsMetaFlagEnum.unused")),
212 COMP(16, bundle.getString(
"TskData.tskFsMetaFlagEnum.compressed")),
213 ORPHAN(32, bundle.getString(
"TskData.tskFsMetaFlagEnum.orphan"));
215 private short meta_flag;
216 private String label;
218 private TSK_FS_META_FLAG_ENUM(
int flag, String label) {
219 this.meta_flag = (short) flag;
249 public static Set<TSK_FS_META_FLAG_ENUM>
valuesOf(
short metaFlags) {
250 Set<TSK_FS_META_FLAG_ENUM> matchedFlags = EnumSet.noneOf(TSK_FS_META_FLAG_ENUM.class);
252 if (metaFlags == TSK_FS_META_FLAG_ENUM.UNKNOWN.getValue()) {
253 matchedFlags.add(TSK_FS_META_FLAG_ENUM.UNKNOWN);
257 for (TSK_FS_META_FLAG_ENUM v : TSK_FS_META_FLAG_ENUM.values()) {
258 long flag = v.getValue();
260 if ((metaFlags & flag) == flag) {
268 public static short toInt(Set<TSK_FS_META_FLAG_ENUM> metaFlags) {
270 for (TSK_FS_META_FLAG_ENUM flag : metaFlags) {
271 val |= flag.getValue();
281 public enum TSK_FS_ATTR_TYPE_ENUM {
314 private TSK_FS_ATTR_TYPE_ENUM(
int val) {
322 public static TSK_FS_ATTR_TYPE_ENUM
valueOf(
int val) {
323 for (TSK_FS_ATTR_TYPE_ENUM type : TSK_FS_ATTR_TYPE_ENUM.values()) {
324 if (type.val == val) {
328 throw new IllegalArgumentException(
329 MessageFormat.format(bundle.getString(
"TskData.tskFsAttrTypeEnum.exception.msg1.text"), val));
337 public enum TSK_VS_PART_FLAG_ENUM {
344 private long vs_flag;
346 private TSK_VS_PART_FLAG_ENUM(
long flag) {
365 public enum TSK_FS_META_MODE_ENUM {
388 private TSK_FS_META_MODE_ENUM(
int mode) {
389 this.mode = (short) mode;
409 public static Set<TSK_FS_META_MODE_ENUM>
valuesOf(
short modes) {
410 Set<TSK_FS_META_MODE_ENUM> matchedFlags = EnumSet.noneOf(TSK_FS_META_MODE_ENUM.class);
412 for (TSK_FS_META_MODE_ENUM v : TSK_FS_META_MODE_ENUM.values()) {
413 long flag = v.getMode();
415 if ((modes & flag) == flag) {
428 public static short toInt(Set<TSK_FS_META_MODE_ENUM> modes) {
430 for (TSK_FS_META_MODE_ENUM mode : modes) {
431 modesInt |= mode.getMode();
441 public enum TSK_FS_TYPE_ENUM {
476 private String displayName;
478 private TSK_FS_TYPE_ENUM(
int value, String displayName) {
480 this.displayName = displayName;
509 public static TSK_FS_TYPE_ENUM
valueOf(
int fsTypeValue) {
510 for (TSK_FS_TYPE_ENUM type : TSK_FS_TYPE_ENUM.values()) {
511 if (type.value == fsTypeValue) {
515 throw new IllegalArgumentException(
516 MessageFormat.format(bundle.getString(
"TskData.tskFsTypeEnum.exception.msg1.text"), fsTypeValue));
525 public enum TSK_IMG_TYPE_ENUM {
541 private long imgType;
544 private TSK_IMG_TYPE_ENUM(
long type, String name) {
549 public static TSK_IMG_TYPE_ENUM
valueOf(
long imgType) {
550 for (TSK_IMG_TYPE_ENUM type : TSK_IMG_TYPE_ENUM.values()) {
551 if (type.getValue() == imgType) {
555 throw new IllegalArgumentException(
556 MessageFormat.format(bundle.getString(
"TskData.tskImgTypeEnum.exception.msg1.text"), imgType));
582 public enum TSK_VS_TYPE_ENUM {
598 private TSK_VS_TYPE_ENUM(
long type, String name) {
603 public static TSK_VS_TYPE_ENUM
valueOf(
long vsType) {
604 for (TSK_VS_TYPE_ENUM type : TSK_VS_TYPE_ENUM.values()) {
605 if (type.getVsType() == vsType) {
609 throw new IllegalArgumentException(
610 MessageFormat.format(bundle.getString(
"TskData.tskVSTypeEnum.exception.msg1.text"), vsType));
636 public enum ObjectType {
638 IMG(0, bundle.getString(
"TskData.ObjectType.IMG.name")),
639 VS(1, bundle.getString(
"TskData.ObjectType.VS.name")),
640 VOL(2, bundle.getString(
"TskData.ObjectType.VOL.name")),
641 FS(3, bundle.getString(
"TskData.ObjectType.FS.name")),
642 ABSTRACTFILE(4, bundle.getString(
"TskData.ObjectType.AbstractFile.name")),
643 ARTIFACT(5, bundle.getString(
"TskData.ObjectType.Artifact.name")),
644 REPORT(6, bundle.getString(
"TskData.ObjectType.Report.name")),
645 POOL(7, bundle.getString(
"TskData.ObjectType.Pool.name")),
646 OS_ACCOUNT(8, bundle.getString(
"TskData.ObjectType.OsAccount.name")),
647 HOST_ADDRESS(9, bundle.getString(
"TskData.ObjectType.HostAddress.name")),
648 UNSUPPORTED(-1, bundle.getString(
"TskData.ObjectType.Unsupported.name"))
650 private final short objectType;
651 private final String displayName;
653 private ObjectType(
int objectType, String displayName) {
654 this.objectType = (short) objectType;
655 this.displayName = displayName;
679 public static ObjectType
valueOf(
short objectType) {
680 for (ObjectType v : ObjectType.values()) {
681 if (v.objectType == objectType) {
693 public enum TSK_DB_FILES_TYPE_ENUM {
695 FS(0,
"File System"),
707 private final short fileType;
708 private final String name;
710 private TSK_DB_FILES_TYPE_ENUM(
int fileType, String name) {
711 this.fileType = (short) fileType;
722 public static TSK_DB_FILES_TYPE_ENUM
valueOf(
short fileType) {
723 for (TSK_DB_FILES_TYPE_ENUM type : TSK_DB_FILES_TYPE_ENUM.values()) {
724 if (type.fileType == fileType) {
728 throw new IllegalArgumentException(
729 MessageFormat.format(bundle.getString(
"TskData.tskDbFilesTypeEnum.exception.msg1.text"), fileType));
757 private final short poolType;
758 private final String name;
761 this.poolType = (short) poolType;
774 if (type.poolType == poolType) {
778 throw new IllegalArgumentException(
779 MessageFormat.format(bundle.getString(
"TskData.tskDbFilesTypeEnum.exception.msg1.text"), poolType));
800 public enum FileKnown {
802 UNKNOWN(0, bundle.getString(
"TskData.fileKnown.unknown")),
803 KNOWN(1, bundle.getString(
"TskData.fileKnown.known")),
804 BAD(2, bundle.getString(
"TskData.fileKnown.knownBad"));
809 private FileKnown(
int known, String name) {
810 this.known = (byte) known;
822 for (FileKnown v : FileKnown.values()) {
823 if (v.known == known) {
827 throw new IllegalArgumentException(
828 MessageFormat.format(bundle.getString(
"TskData.fileKnown.exception.msg1.text"), known));
849 public enum TagType {
851 UNKNOWN(0, bundle.getString(
"TskData.tagType.unknown")),
852 KNOWN(1, bundle.getString(
"TskData.tagType.known")),
853 BAD(2, bundle.getString(
"TskData.tagType.knownBad")),
854 SUSPICIOUS(3, bundle.getString(
"TskData.tagType.suspicious"));
859 private TagType(
int type, String name) {
860 this.type = (byte) type;
884 throw new IllegalArgumentException(
885 MessageFormat.format(bundle.getString(
"TskData.tagType.exception.msg1.text"), tagType));
902 return TagType.KNOWN;
908 return TagType.SUSPICIOUS;
911 throw new IllegalArgumentException(
912 MessageFormat.format(bundle.getString(
"TskData.fileKnown.exception.msg1.text"), fileKnown));
923 for (TagType v : TagType.values()) {
924 if (v.type == type) {
928 throw new IllegalArgumentException(
929 MessageFormat.format(bundle.getString(
"TskData.tagType.exception.msg1.text"), type));
977 public enum EncodingType{
982 private final int type;
984 private EncodingType(
int type){
992 public static EncodingType
valueOf(
int type) {
993 for (EncodingType v : EncodingType.values()) {
994 if (v.type == type) {
998 throw new IllegalArgumentException(
999 MessageFormat.format(bundle.getString(
"TskData.encodingType.exception.msg1.text"), type));
1007 public enum CollectedStatus{
1024 private final int type;
1026 private CollectedStatus(
int type){
1035 for (CollectedStatus v : CollectedStatus.values()) {
1036 if (v.type == type) {
1040 throw new IllegalArgumentException(
1041 MessageFormat.format(bundle.getString(
"TskData.collectedStatus.exception.msg1.text"), type));
1048 public enum KeywordSearchQueryType {
1053 private final int type;
1055 private KeywordSearchQueryType(
int type){
1063 public static KeywordSearchQueryType
valueOf(
int type) {
1064 for (KeywordSearchQueryType v : KeywordSearchQueryType.values()) {
1065 if (v.type == type) {
1069 throw new IllegalArgumentException(
1070 MessageFormat.format(bundle.getString(
"TskData.keywordSearchQueryType.exception.msg1.text"), type));
static CollectedStatus valueOf(int type)
NO_UNSUPPORTED_COMPRESSION
static EncodingType valueOf(int type)
static FileKnown valueOf(byte known)
UNKNOWN
File marked as unknown by hash db.
KNOWN
File marked as a type by hash db.
BAD
File marked as bad by hash db.
static KeywordSearchQueryType valueOf(int type)
static ObjectType valueOf(short objectType)
REPORT
Artifact - see blackboard_artifacts for more details.
VOL
Volume - see tsk_vs_parts for more details.
IMG
Disk Image - see tsk_image_info for more details.
OS_ACCOUNT
OS Account - see tsk_os_accounts for more details.
VS
Volume System - see tsk_vs_info for more details.
FS
File System - see tsk_fs_info for more details.
HOST_ADDRESS
Host Address - see tsk_host_addresses for more details.
ABSTRACTFILE
File - see tsk_files for more details.
UNSUPPORTED
Unsupported type.
LAYOUT_FILE
Set of blocks from an image that have been designated as a file.
FS
File that can be found in file system tree.
CARVED
Set of blocks for a file found from carving. Could be on top of a TSK_DB_FILES_TYPE_UNALLOC_BLOCKS ra...
SLACK
Slack space for a single file.
LOCAL_DIR
Local directory that was added (not from a disk image).
LOCAL
Local file that was added (not from a disk image).
VIRTUAL_DIR
Virtual directory (not on fs) with no meta-data entry that can be used to group files of types other ...
DERIVED
File derived from a parent file (i.e. from ZIP).
UNUSED_BLOCKS
Set of blocks that are unallocated AND not used by a carved or other file type. Parent should be UNAL...
static TSK_DB_FILES_TYPE_ENUM valueOf(short fileType)
UNALLOC_BLOCKS
Set of blocks not allocated by file system. Parent should be image, volume, or file system....
TSK_FS_ATTR_TYPE_NOT_FOUND
TSK_FS_ATTR_TYPE_NTFS_VINFO
TSK_FS_ATTR_TYPE_NTFS_BITMAP
TSK_FS_ATTR_TYPE_NTFS_ATTRLIST
TSK_FS_ATTR_TYPE_NTFS_OBJID
TSK_FS_ATTR_TYPE_NTFS_LOG
TSK_FS_ATTR_TYPE_NTFS_FNAME
TSK_FS_ATTR_TYPE_NTFS_EAINFO
TSK_FS_ATTR_TYPE_NTFS_VNAME
TSK_FS_ATTR_TYPE_NTFS_REPARSE
TSK_FS_ATTR_TYPE_UNIX_INDIR
static TSK_FS_ATTR_TYPE_ENUM valueOf(int val)
TSK_FS_ATTR_TYPE_NTFS_SYMLNK
TSK_FS_ATTR_TYPE_NTFS_IDXROOT
TSK_FS_ATTR_TYPE_NTFS_SEC
TSK_FS_ATTR_TYPE_HFS_RSRC
TSK_FS_ATTR_TYPE_HFS_COMP_REC
TSK_FS_ATTR_TYPE_NTFS_DATA
TSK_FS_ATTR_TYPE_NTFS_VVER
TSK_FS_ATTR_TYPE_NTFS_PROP
TSK_FS_ATTR_TYPE_NTFS_IDXALLOC
TSK_FS_ATTR_TYPE_HFS_DEFAULT
TSK_FS_ATTR_TYPE_HFS_DATA
TSK_FS_ATTR_TYPE_HFS_EXT_ATTR
ORPHAN
Return only metadata structures that have no file name pointing to the (inode_walk flag only).
static short toInt(Set< TSK_FS_META_FLAG_ENUM > metaFlags)
UNALLOC
Metadata structure is currently in an unallocated state.
COMP
The file contents are compressed.
static Set< TSK_FS_META_FLAG_ENUM > valuesOf(short metaFlags)
ALLOC
Metadata structure is currently in an allocated state.
USED
Metadata structure has been allocated at least once.
UNUSED
Metadata structure has never been allocated.
TSK_FS_META_MODE_ISUID
set user id on execution
static Set< TSK_FS_META_MODE_ENUM > valuesOf(short modes)
TSK_FS_META_MODE_IXGRP
X for group.
TSK_FS_META_MODE_ISGID
set group id on execution
TSK_FS_META_MODE_IXUSR
X for owner.
static short toInt(Set< TSK_FS_META_MODE_ENUM > modes)
TSK_FS_META_MODE_ISVTX
sticky bit
TSK_FS_META_MODE_IROTH
R for other.
TSK_FS_META_MODE_IXOTH
X for other.
TSK_FS_META_MODE_IWOTH
W for other.
TSK_FS_META_MODE_IRGRP
R for group.
TSK_FS_META_MODE_IRUSR
R for owner.
TSK_FS_META_MODE_IWUSR
W for owner.
TSK_FS_META_MODE_IWGRP
W for group.
TSK_FS_META_TYPE_VIRT
"Virtual File" created by TSK for file system areas NON-NLS
TSK_FS_META_TYPE_FIFO
Named pipe (fifo) NON-NLS.
static TSK_FS_META_TYPE_ENUM valueOf(short metaType)
TSK_FS_META_TYPE_LNK
Symbolic link NON-NLS.
TSK_FS_META_TYPE_WHT
Whiteout NON-NLS.
TSK_FS_META_TYPE_VIRT_DIR
"Virtual Directory" created by TSK for Orphan Files NON-NLS
TSK_FS_META_TYPE_SHAD
SOLARIS ONLY NON-NLS.
TSK_FS_META_TYPE_BLK
Block device NON-NLS.
TSK_FS_META_TYPE_REG
Regular file NON-NLS.
TSK_FS_META_TYPE_SOCK
UNIX domain socket NON-NLS.
TSK_FS_META_TYPE_DIR
Directory file NON-NLS.
TSK_FS_META_TYPE_CHR
Character device NON-NLS.
static TSK_FS_NAME_FLAG_ENUM valueOf(int dirFlag)
UNALLOC
Name is in an unallocated state.
ALLOC
Name is in an allocated state.
CHR
Character device NON-NLS.
VIRT
Special (TSK added "Virtual" files) NON-NLS.
SHAD
Shadow inode (solaris) NON-NLS.
LNK
Symbolic link NON-NLS.
VIRT_DIR
Special (TSK added "Virtual" directories) NON-NLS.
static TSK_FS_NAME_TYPE_ENUM valueOf(short dir_type)
WHT
Whiteout (openbsd) NON-NLS.
TSK_FS_TYPE_RAW_DETECT
RAW auto detection.
TSK_FS_TYPE_FAT12
FAT12 file system.
TSK_FS_TYPE_DETECT
Use autodetection methods.
TSK_FS_TYPE_NTFS_DETECT
NTFS auto detection.
TSK_FS_TYPE_ISO9660
ISO9660 file system.
TSK_FS_TYPE_FFS1
UFS1 (FreeBSD, OpenBSD, BSDI ...).
TSK_FS_TYPE_EXT2
Ext2 file system.
TSK_FS_TYPE_EXT4
Ext4 file system.
TSK_FS_TYPE_SWAP_DETECT
SWAP auto detection.
TSK_FS_TYPE_RAW
RAW file system.
TSK_FS_TYPE_FAT_DETECT
FAT auto detection.
TSK_FS_TYPE_HFS_DETECT
HFS auto detection.
TSK_FS_TYPE_EXT3
Ext3 file system.
TSK_FS_TYPE_UNSUPP
Unsupported file system.
static TSK_FS_TYPE_ENUM valueOf(int fsTypeValue)
TSK_FS_TYPE_HFS
HFS file system.
TSK_FS_TYPE_FFS_DETECT
UFS auto detection.
TSK_FS_TYPE_EXFAT
ExFAT file system.
TSK_FS_TYPE_ISO9660_DETECT
ISO9660 auto detection.
TSK_FS_TYPE_APFS
APFS file system.
TSK_FS_TYPE_FFS2
UFS2 - FreeBSD, NetBSD.
TSK_FS_TYPE_YAFFS2_DETECT
YAFFS2 auto detection.
TSK_FS_TYPE_BTRFS_DETECT
Btrfs auto detection.
TSK_FS_TYPE_FFS1B
UFS1b (Solaris - has no type).
TSK_FS_TYPE_EXT_DETECT
ExtX auto detection.
TSK_FS_TYPE_FAT16
FAT16 file system.
TSK_FS_TYPE_APFS_DETECT
APFS auto detection.
TSK_FS_TYPE_YAFFS2
YAFFS2 file system.
TSK_FS_TYPE_BTRFS
Btrfs file system.
TSK_FS_TYPE_SWAP
SWAP file system.
TSK_FS_TYPE_NTFS
NTFS file system.
TSK_FS_TYPE_FAT32
FAT32 file system.
static TSK_IMG_TYPE_ENUM valueOf(long imgType)
TSK_IMG_TYPE_UNSUPP
Logical directory.
TSK_POOL_TYPE_DETECT
Use autodetection methods.
TSK_POOL_TYPE_APFS
APFS Pooled Volumes.
TSK_POOL_TYPE_LVM
LVM Pooled Volumes.
TSK_POOL_TYPE_UNSUPP
Unsupported pool container type.
TSK_POOL_TYPE_ENUM(int poolType, String name)
static TSK_POOL_TYPE_ENUM valueOf(long poolType)
TSK_VS_PART_FLAG_ALL
Show all sectors in the walk.
TSK_VS_PART_FLAG_META
Sectors contain volume system metadata and could also be ALLOC or UNALLOC.
TSK_VS_PART_FLAG_ALLOC
Sectors are allocated to a volume in the volume system.
TSK_VS_PART_FLAG_UNALLOC
Sectors are not allocated to a volume.
TSK_VS_TYPE_UNSUPP
Unsupported.
static TSK_VS_TYPE_ENUM valueOf(long vsType)
TSK_VS_TYPE_DBFILLER
fake partition table type for loaddb (for images that do not have a volume system)
TSK_VS_TYPE_DETECT
Use autodetection methods.
TSK_VS_TYPE_APFS
APFS pool NON-NLS.
TSK_VS_TYPE_BSD
BSD Partition table NON-NLS.
TSK_VS_TYPE_GPT
GPT partition table NON-NLS.
TSK_VS_TYPE_LVM
LVM pool NON-NLS.
TSK_VS_TYPE_MAC
Mac partition table NON-NLS.
TSK_VS_TYPE_DOS
DOS Partition table NON-NLS.
TSK_VS_TYPE_SUN
Sun VTOC NON-NLS.
static TagType valueOf(byte type)
static TagType convertFileKnownToTagType(FileKnown fileKnown)
static FileKnown convertTagTypeToFileKnown(TagType tagType)