+static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sessrec)
+{
+ const char *rtype;
+ memset(sessrec, 0, sizeof(sessrec));
+ switch (rec->FileIndex) {
+ case PRE_LABEL:
+ rtype = _("Fresh Volume Label");
+ break;
+ case VOL_LABEL:
+ rtype = _("Volume Label");
+ unser_volume_label(dev, rec);
+ break;
+ case SOS_LABEL:
+ rtype = _("Begin Job Session");
+ unser_session_label(sessrec, rec);
+ break;
+ case EOS_LABEL:
+ rtype = _("End Job Session");
+ unser_session_label(sessrec, rec);
+ break;
+ case 0:
+ case EOM_LABEL:
+ rtype = _("End of Medium");
+ break;
+ default:
+ rtype = _("Unknown");
+ break;
+ }
+ Dmsg5(10, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
+ rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
+ if (verbose) {
+ Pmsg5(-1, _("%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n"),
+ rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
+ }
+}
+