bootloader, firmware: update visuals
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 10 KiB |
|
@ -1,4 +1,4 @@
|
||||||
static const uint8_t icon_cross[] = {
|
static const uint8_t toi_icon_cross[] = {
|
||||||
// magic
|
// magic
|
||||||
'T', 'O', 'I', 'g',
|
'T', 'O', 'I', 'g',
|
||||||
// width (16-bit), height (16-bit)
|
// width (16-bit), height (16-bit)
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
static const uint8_t toi_icon_lock[] = {
|
||||||
|
/*
|
||||||
|
// magic
|
||||||
|
'T', 'O', 'I', 'g',
|
||||||
|
// width (16-bit), height (16-bit)
|
||||||
|
0x7c, 0x00, 0xb4, 0x00,
|
||||||
|
// compressed data length (32-bit)
|
||||||
|
0xe2, 0x02, 0x00, 0x00,
|
||||||
|
*/
|
||||||
|
// compressed data
|
||||||
|
0xed, 0xd2, 0x3f, 0x6c, 0x52, 0x41, 0x1c, 0x07, 0xf0, 0x1f, 0x7f, 0x84, 0x46, 0x53, 0xcb, 0x88, 0x26, 0x56, 0xd6, 0x36, 0x31, 0x65, 0xd1, 0xa5, 0x0e, 0xcc, 0x06, 0xd3, 0x26, 0xae, 0x9a, 0x92, 0x38, 0x38, 0x11, 0x70, 0x31, 0x0e, 0x06, 0xca, 0xe4, 0x62, 0x42, 0x71, 0x73, 0x22, 0x21, 0x71, 0xe9, 0x82, 0x49, 0xdd, 0x71, 0xe8, 0xe0, 0x62, 0xd0, 0x34, 0xa2, 0x83, 0x09, 0xdd, 0xe8, 0x86, 0xb6, 0x69, 0xf9, 0xff, 0x7e, 0x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e, 0x1e, 0xc4, 0xc1, 0x19, 0x7f, 0x59, 0x0f, 0xf7, 0x63, 0x20, 0x8a, 0xaf, 0xa8, 0x83, 0x7b, 0x11, 0x90, 0x24, 0xa7, 0xc6, 0x5d, 0x29, 0x06, 0x48, 0xab, 0x70, 0x0b, 0xa8, 0x24, 0x69, 0xdc, 0x00, 0x3a, 0xeb, 0x14, 0xde, 0x07, 0x55, 0x56, 0xe5, 0x78, 0x0f, 0xd4, 0x59, 0x91, 0xe1, 0x0a, 0xe8, 0x24, 0x2a, 0xc6, 0x25, 0xd0, 0x4b, 0xb8, 0x2d, 0xc0, 0x05, 0xd0, 0x4d, 0xa8, 0x39, 0x6b, 0xad, 0x2c, 0xe8, 0x27, 0x58, 0xe7, 0xf1, 0x28, 0x05, 0x6e, 0x12, 0xa8, 0xb1, 0x78, 0x98, 0x00, 0x77, 0x09, 0x54, 0x6d, 0x3c, 0x88, 0x83, 0xdb, 0xf8, 0xcb, 0x53, 0xdc, 0x8f, 0x81, 0xfb, 0xf8, 0x8a, 0x13, 0xdc, 0x8b, 0x80, 0xa7, 0xe4, 0xc6, 0xb8, 0xeb, 0x11, 0x03, 0xa4, 0x11, 0x8f, 0xc0, 0x7b, 0x92, 0x5f, 0xe0, 0x1f, 0xe6, 0x27,
|
||||||
|
};
|
|
@ -1,4 +1,4 @@
|
||||||
static const uint8_t icon_tick[] = {
|
static const uint8_t toi_icon_tick[] = {
|
||||||
// magic
|
// magic
|
||||||
'T', 'O', 'I', 'g',
|
'T', 'O', 'I', 'g',
|
||||||
// width (16-bit), height (16-bit)
|
// width (16-bit), height (16-bit)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
static const uint8_t icon_tools[] = {
|
static const uint8_t toi_icon_tools[] = {
|
||||||
/*
|
/*
|
||||||
// magic
|
// magic
|
||||||
'T', 'O', 'I', 'g',
|
'T', 'O', 'I', 'g',
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
static const uint8_t toi_icon_update[] = {
|
||||||
|
/*
|
||||||
|
// magic
|
||||||
|
'T', 'O', 'I', 'g',
|
||||||
|
// width (16-bit), height (16-bit)
|
||||||
|
0x18, 0x00, 0x18, 0x00,
|
||||||
|
// compressed data length (32-bit)
|
||||||
|
0xb1, 0x00, 0x00, 0x00,
|
||||||
|
*/
|
||||||
|
// compressed data
|
||||||
|
0x63, 0x60, 0x40, 0x03, 0x02, 0x70, 0x96, 0xfa, 0xb9, 0x77, 0x37, 0x1d, 0x20, 0x4c, 0xce, 0xff, 0x40, 0xf0, 0xdb, 0x00, 0xc4, 0x64, 0x3a, 0x0f, 0x62, 0xff, 0xff, 0x0a, 0x62, 0xcb, 0xfe, 0xff, 0xbf, 0x3d, 0x6d, 0xde, 0xff, 0xff, 0x01, 0x40, 0xf6, 0xfe, 0xff, 0x87, 0x19, 0x18, 0x18, 0xfb, 0xff, 0x3f, 0x62, 0x60, 0x60, 0xf9, 0xff, 0x1b, 0x24, 0xcb, 0xfa, 0xff, 0x27, 0x03, 0x03, 0xf7, 0xff, 0x87, 0x60, 0x13, 0xfa, 0xff, 0x0b, 0x30, 0xc8, 0xff, 0x6f, 0x00, 0xb3, 0xe5, 0xfe, 0x27, 0x30, 0xf8, 0xff, 0x07, 0x9b, 0x06, 0x94, 0x9f, 0xc0, 0x10, 0xff, 0x1f, 0x64, 0x29, 0xe3, 0x9e, 0x73, 0xff, 0xdf, 0x9c, 0x80, 0xb0, 0x81, 0x42, 0xff, 0xff, 0x3f, 0x82, 0xaa, 0x61, 0xfd, 0xff, 0xff, 0x9f, 0x82, 0xfe, 0xff, 0x02, 0xb0, 0xfa, 0xfc, 0xff, 0x5f, 0xe0, 0x66, 0xb2, 0x03, 0xcd, 0x81, 0xda, 0xc5, 0xc0, 0xd0, 0x01, 0x76, 0xc3, 0x66, 0xa0, 0x39, 0x2d, 0x50, 0x4b, 0xfe, 0x2f, 0x0b, 0x9b, 0x07, 0x31, 0x81, 0xe9, 0x3e, 0xd8, 0xcd, 0x17, 0xc1, 0x12, 0x92, 0x20, 0xe6, 0x1f, 0x88, 0xed, 0x0c, 0x16, 0xe7, 0xfe, 0xdd, 0x72, 0x80, 0x79, 0x98, 0x51, 0x90, 0x01, 0x03, 0x00, 0x00,
|
||||||
|
};
|
|
@ -0,0 +1,12 @@
|
||||||
|
static const uint8_t toi_icon_wipe[] = {
|
||||||
|
/*
|
||||||
|
// magic
|
||||||
|
'T', 'O', 'I', 'g',
|
||||||
|
// width (16-bit), height (16-bit)
|
||||||
|
0x18, 0x00, 0x18, 0x00,
|
||||||
|
// compressed data length (32-bit)
|
||||||
|
0x97, 0x00, 0x00, 0x00,
|
||||||
|
*/
|
||||||
|
// compressed data
|
||||||
|
0x45, 0xcf, 0xb1, 0x0d, 0xc2, 0x30, 0x10, 0x85, 0x61, 0xdb, 0x28, 0x82, 0x08, 0x21, 0xb9, 0xa5, 0xa3, 0xa2, 0x85, 0x0d, 0x60, 0x03, 0xd8, 0x00, 0xc4, 0x04, 0x8c, 0xc0, 0x06, 0x88, 0x92, 0x8a, 0x6c, 0xc0, 0x0a, 0x6c, 0x10, 0x36, 0xc8, 0x08, 0x69, 0x40, 0x20, 0x40, 0xfe, 0xb1, 0x9d, 0x4b, 0xfc, 0x1a, 0x7f, 0xb6, 0x4e, 0xe7, 0x3b, 0xa5, 0x42, 0x8c, 0x4a, 0x39, 0x27, 0xe6, 0xef, 0xe4, 0x4b, 0x72, 0x9f, 0x6f, 0xe7, 0x15, 0x4c, 0x84, 0xba, 0x82, 0x42, 0x3c, 0x00, 0x9e, 0xe2, 0x99, 0x77, 0x5b, 0x74, 0x0c, 0xbe, 0x35, 0xae, 0x82, 0x5f, 0x91, 0xbd, 0x40, 0x5c, 0x74, 0x16, 0xcd, 0xb2, 0xf9, 0x09, 0x57, 0xc3, 0x5e, 0x5a, 0x3e, 0x16, 0x70, 0x90, 0xf7, 0x22, 0x17, 0xfb, 0xfa, 0xb9, 0x91, 0x1a, 0x83, 0xb3, 0xaa, 0x66, 0x1d, 0x1b, 0x95, 0x58, 0x5d, 0xfb, 0x7b, 0xc8, 0x86, 0x6d, 0x86, 0x6c, 0x30, 0xe4, 0x3e, 0x6a, 0x67, 0xd0, 0xe5, 0xe7, 0xfa, 0xb3, 0x32, 0xe8, 0x18, 0x4e, 0xdd, 0x62, 0xd3, 0x5d, 0x3c, 0xfe,
|
||||||
|
};
|
|
@ -12,8 +12,11 @@
|
||||||
#include "mini_printf.h"
|
#include "mini_printf.h"
|
||||||
|
|
||||||
#include "icon_cross.h"
|
#include "icon_cross.h"
|
||||||
|
#include "icon_lock.h"
|
||||||
#include "icon_tick.h"
|
#include "icon_tick.h"
|
||||||
#include "icon_tools.h"
|
#include "icon_tools.h"
|
||||||
|
#include "icon_update.h"
|
||||||
|
#include "icon_wipe.h"
|
||||||
#include "messages.h"
|
#include "messages.h"
|
||||||
#include "style.h"
|
#include "style.h"
|
||||||
|
|
||||||
|
@ -29,23 +32,37 @@ void display_fade(int start, int end, int delay)
|
||||||
display_backlight(end);
|
display_backlight(end);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_header(const char *text)
|
#define ICON_TOOLS 0
|
||||||
|
#define ICON_UPDATE 1
|
||||||
|
#define ICON_WIPE 2
|
||||||
|
|
||||||
|
void display_header(int icon, const char *text)
|
||||||
{
|
{
|
||||||
display_bar(0, 0, 240, 32, COLOR_BL_ORANGE);
|
display_bar(0, 0, DISPLAY_RESX, 32, COLOR_BL_ORANGE);
|
||||||
display_icon(8, 4, 24, 24, icon_tools, sizeof(icon_tools), COLOR_BLACK, COLOR_BL_ORANGE);
|
switch (icon) {
|
||||||
|
case ICON_TOOLS :
|
||||||
|
display_icon(8, 4, 24, 24, toi_icon_tools, sizeof(toi_icon_tools), COLOR_BLACK, COLOR_BL_ORANGE);
|
||||||
|
break ;
|
||||||
|
case ICON_UPDATE:
|
||||||
|
display_icon(8, 4, 24, 24, toi_icon_update, sizeof(toi_icon_update), COLOR_BLACK, COLOR_BL_ORANGE);
|
||||||
|
break;
|
||||||
|
case ICON_WIPE:
|
||||||
|
display_icon(8, 4, 24, 24, toi_icon_wipe, sizeof(toi_icon_wipe), COLOR_BLACK, COLOR_BL_ORANGE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
display_text(8 + 24 + 8, 23, text, -1, FONT_BOLD, COLOR_BLACK, COLOR_BL_ORANGE);
|
display_text(8 + 24 + 8, 23, text, -1, FONT_BOLD, COLOR_BLACK, COLOR_BL_ORANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_footer(const char *text, uint16_t color)
|
void display_footer(const char *text, uint16_t color)
|
||||||
{
|
{
|
||||||
display_bar(0, 184, 240, 56, COLOR_BLACK);
|
display_bar(0, 184, DISPLAY_RESX, 56, COLOR_BLACK);
|
||||||
display_text_center(120, 220, text, -1, FONT_BOLD, color, COLOR_BLACK);
|
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 20, text, -1, FONT_BOLD, color, COLOR_BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_done(int restart)
|
void display_done(int restart)
|
||||||
{
|
{
|
||||||
if (restart == 0 || restart == 3) {
|
if (restart == 0 || restart == 3) {
|
||||||
display_loader(1000, 0, COLOR_BL_GREEN, COLOR_BLACK, icon_tick, sizeof(icon_tick), COLOR_WHITE);
|
display_loader(1000, 0, COLOR_BL_GREEN, COLOR_BLACK, toi_icon_tick, sizeof(toi_icon_tick), COLOR_WHITE);
|
||||||
}
|
}
|
||||||
if (restart == 3) {
|
if (restart == 3) {
|
||||||
display_footer("Done! Restarting in 3s", COLOR_BL_GREEN);
|
display_footer("Done! Restarting in 3s", COLOR_BL_GREEN);
|
||||||
|
@ -62,25 +79,33 @@ void display_done(int restart)
|
||||||
|
|
||||||
void display_error(void)
|
void display_error(void)
|
||||||
{
|
{
|
||||||
display_loader(1000, 0, COLOR_BL_RED, COLOR_BLACK, icon_cross, sizeof(icon_cross), COLOR_WHITE);
|
display_loader(1000, 0, COLOR_BL_RED, COLOR_BLACK, toi_icon_cross, sizeof(toi_icon_cross), COLOR_WHITE);
|
||||||
display_footer("Error! Unplug the device", COLOR_BL_RED);
|
display_footer("Error! Unplug the device", COLOR_BL_RED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_welcome(void)
|
void display_welcome(void)
|
||||||
{
|
{
|
||||||
|
vendor_header vhdr;
|
||||||
|
bool firmware_present = vendor_parse_header((const uint8_t *)FIRMWARE_START, &vhdr);
|
||||||
display_clear();
|
display_clear();
|
||||||
display_header("TREZOR Bootloader");
|
if (!firmware_present) {
|
||||||
|
display_icon((DISPLAY_RESX - 124) / 2, (DISPLAY_RESY - 40 - 180) / 2, 124, 180, toi_icon_lock, sizeof(toi_icon_lock), COLOR_WHITE, COLOR_BLACK);
|
||||||
uint8_t dom[32];
|
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 20, "Go to trezor.io/start", -1, FONT_BOLD, COLOR_WHITE, COLOR_BLACK);
|
||||||
// format: TREZOR2-YYMMDD
|
} else {
|
||||||
if (flash_otp_read(0, 0, dom, 32) && 0 == memcmp(dom, "TREZOR2-", 8) && dom[14] == 0) {
|
display_header(ICON_TOOLS, "TREZOR Bootloader");
|
||||||
display_qrcode(120, 120, (const char *)dom, 14, 4);
|
uint8_t dom[32];
|
||||||
display_text_center(120, 210, (const char *)dom, 14, FONT_BOLD, COLOR_WHITE, COLOR_BLACK);
|
// format: TREZOR2-YYMMDD
|
||||||
|
if (flash_otp_read(0, 0, dom, 32) && 0 == memcmp(dom, "TREZOR2-", 8) && dom[14] == 0) {
|
||||||
|
display_qrcode(DISPLAY_RESX / 2, DISPLAY_RESY / 2, (const char *)dom, 14, 4);
|
||||||
|
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 30, (const char *)dom, 14, FONT_BOLD, COLOR_WHITE, COLOR_BLACK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
display_fade(0, BACKLIGHT_NORMAL, 1000);
|
display_fade(0, BACKLIGHT_NORMAL, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define VENDOR_IMAGE_RESX 120
|
||||||
|
#define VENDOR_IMAGE_RESY 120
|
||||||
|
|
||||||
void display_vendor(const uint8_t *vimg, const char *vstr, uint32_t vstr_len, uint32_t fw_version)
|
void display_vendor(const uint8_t *vimg, const char *vstr, uint32_t vstr_len, uint32_t fw_version)
|
||||||
{
|
{
|
||||||
display_clear();
|
display_clear();
|
||||||
|
@ -89,12 +114,12 @@ void display_vendor(const uint8_t *vimg, const char *vstr, uint32_t vstr_len, ui
|
||||||
}
|
}
|
||||||
uint16_t w = *(uint16_t *)(vimg + 4);
|
uint16_t w = *(uint16_t *)(vimg + 4);
|
||||||
uint16_t h = *(uint16_t *)(vimg + 6);
|
uint16_t h = *(uint16_t *)(vimg + 6);
|
||||||
if (w != 120 || h != 120) {
|
if (w != VENDOR_IMAGE_RESX || h != VENDOR_IMAGE_RESY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint32_t datalen = *(uint32_t *)(vimg + 8);
|
uint32_t datalen = *(uint32_t *)(vimg + 8);
|
||||||
display_image(60, 32, w, h, vimg + 12, datalen);
|
display_image((DISPLAY_RESX - w) / 2, 32, w, h, vimg + 12, datalen);
|
||||||
display_text_center(120, 192, vstr, vstr_len, FONT_BOLD, COLOR_WHITE, COLOR_BLACK);
|
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 48, vstr, vstr_len, FONT_BOLD, COLOR_WHITE, COLOR_BLACK);
|
||||||
char ver_str[32];
|
char ver_str[32];
|
||||||
mini_snprintf(ver_str, sizeof(ver_str), "%d.%d.%d.%d",
|
mini_snprintf(ver_str, sizeof(ver_str), "%d.%d.%d.%d",
|
||||||
(int)(fw_version & 0xFF),
|
(int)(fw_version & 0xFF),
|
||||||
|
@ -102,7 +127,7 @@ void display_vendor(const uint8_t *vimg, const char *vstr, uint32_t vstr_len, ui
|
||||||
(int)((fw_version >> 16) & 0xFF),
|
(int)((fw_version >> 16) & 0xFF),
|
||||||
(int)((fw_version >> 24) & 0xFF)
|
(int)((fw_version >> 24) & 0xFF)
|
||||||
);
|
);
|
||||||
display_text_center(120, 215, ver_str, -1, FONT_BOLD, COLOR_GRAY128, COLOR_BLACK);
|
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 25, ver_str, -1, FONT_BOLD, COLOR_GRAY128, COLOR_BLACK);
|
||||||
display_refresh();
|
display_refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +221,7 @@ bool bootloader_loop(void)
|
||||||
case 5: // WipeDevice
|
case 5: // WipeDevice
|
||||||
display_fade(BACKLIGHT_NORMAL, 0, 100);
|
display_fade(BACKLIGHT_NORMAL, 0, 100);
|
||||||
display_clear();
|
display_clear();
|
||||||
display_header("Wiping Device");
|
display_header(ICON_WIPE, "Wiping Device");
|
||||||
display_footer("In progress ...", COLOR_WHITE);
|
display_footer("In progress ...", COLOR_WHITE);
|
||||||
display_fade(0, BACKLIGHT_NORMAL, 100);
|
display_fade(0, BACKLIGHT_NORMAL, 100);
|
||||||
r = process_msg_WipeDevice(USB_IFACE_NUM, msg_size, buf);
|
r = process_msg_WipeDevice(USB_IFACE_NUM, msg_size, buf);
|
||||||
|
@ -215,7 +240,7 @@ bool bootloader_loop(void)
|
||||||
case 6: // FirmwareErase
|
case 6: // FirmwareErase
|
||||||
display_fade(BACKLIGHT_NORMAL, 0, 100);
|
display_fade(BACKLIGHT_NORMAL, 0, 100);
|
||||||
display_clear();
|
display_clear();
|
||||||
display_header("Updating Firmware");
|
display_header(ICON_UPDATE, "Updating Firmware");
|
||||||
display_footer("In progress ...", COLOR_WHITE);
|
display_footer("In progress ...", COLOR_WHITE);
|
||||||
display_fade(0, BACKLIGHT_NORMAL, 100);
|
display_fade(0, BACKLIGHT_NORMAL, 100);
|
||||||
process_msg_FirmwareErase(USB_IFACE_NUM, msg_size, buf);
|
process_msg_FirmwareErase(USB_IFACE_NUM, msg_size, buf);
|
||||||
|
@ -314,7 +339,7 @@ int main(void)
|
||||||
display_vendor(vhdr.vimg, (const char *)vhdr.vstr, vhdr.vstr_len, hdr.version);
|
display_vendor(vhdr.vimg, (const char *)vhdr.vstr, vhdr.vstr_len, hdr.version);
|
||||||
display_fade(0, BACKLIGHT_NORMAL, 1000);
|
display_fade(0, BACKLIGHT_NORMAL, 1000);
|
||||||
if (vhdr.vtrust < 50) {
|
if (vhdr.vtrust < 50) {
|
||||||
display_text_center(120, 238, "click to continue ...", -1, FONT_BOLD, COLOR_GRAY64, COLOR_BLACK);
|
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 2, "click to continue ...", -1, FONT_BOLD, COLOR_GRAY64, COLOR_BLACK);
|
||||||
touch_click();
|
touch_click();
|
||||||
} else {
|
} else {
|
||||||
hal_delay(1000);
|
hal_delay(1000);
|
||||||
|
|
|
@ -19,8 +19,8 @@ async def dim_screen():
|
||||||
def display_homescreen():
|
def display_homescreen():
|
||||||
from apps.common import storage
|
from apps.common import storage
|
||||||
|
|
||||||
image = res.load('apps/homescreen/res/trezor_logo.toig')
|
image = res.load('apps/homescreen/res/trezor_lock.toig')
|
||||||
ui.display.icon(0, 0, image, ui.FG, ui.BG)
|
ui.display.icon((ui.SCREEN - 124) // 2, (ui.SCREEN - 40 - 180) // 2, image, ui.FG, ui.BG)
|
||||||
|
|
||||||
if not storage.is_initialized():
|
if not storage.is_initialized():
|
||||||
label = 'Go to trezor.io/start'
|
label = 'Go to trezor.io/start'
|
||||||
|
@ -28,7 +28,7 @@ def display_homescreen():
|
||||||
label = storage.get_label()
|
label = storage.get_label()
|
||||||
if not label:
|
if not label:
|
||||||
label = 'My TREZOR'
|
label = 'My TREZOR'
|
||||||
ui.display.text_center(120, 210, label, ui.BOLD, ui.FG, ui.BG)
|
ui.display.text_center(ui.SCREEN // 2, ui.SCREEN - 20, label, ui.BOLD, ui.FG, ui.BG)
|
||||||
|
|
||||||
|
|
||||||
@unimport
|
@unimport
|
||||||
|
|