Question No. 2 How Snmpv3 Enhances Security Compared To Snmpv2? Question No. 3 A) Define Rmon B) What Are The Benefits of Rmon ?
Question No. 2 How Snmpv3 Enhances Security Compared To Snmpv2? Question No. 3 A) Define Rmon B) What Are The Benefits of Rmon ?
Question No. 2 How Snmpv3 Enhances Security Compared To Snmpv2? Question No. 3 A) Define Rmon B) What Are The Benefits of Rmon ?
Question No. 3
a) Define RMON
b) What are the benefits of RMON ?
Question No. 4 As a network manager, you are responsible for the operation of a
network. You notice heavy traffic in a host that is on a TCP/IP network and want to
find out the details:
a) What basic network monitoring tool(s) would you use?
b) What would you look for in your results?
Question No. 5 What is the difference between nslookup & dig?
Question No. 5 Install wireshark and capture IP packets on your Ethernet interface.
a) Put a screenshot of IP packets captured on your device.
b) Analyze their headers and contents. (1 mark bonus for analysis)
This question comes from a logics class. At this point we are studying sequential circuits. Please
show and explain all steps, I am lost and need to know how to think through and complete like
this.
LCD_PIN_Init() that enables GPIO clocks and configures GPIO pins as the alternative function
11 (LCD)
LCD_Display_Name() that display the first six letters of your last name
CODE:
#include "lcd.h"
#include "stm32l476xx.h"
#include <stdint.h>
/*
====================================================================
=====
LCD MAPPING
=====================================================================
====
LCD allows to display informations on six 14-segment digits and 4 bars:
1
2
3
4
5
6
----- ----- ----- ----- ----- ----|\|/| o |\|/| o |\|/| o |\|/| o |\|/| |\|/| BAR3
-- -- -- -- -- -- -- -- -- -- -- -- BAR2
|/|\| o |/|\| o |/|\| o |/|\| o |/|\| |/|\| BAR1
----- * ----- * ----- * ----- * ----- ----- BAR0
LCD segment mapping:
------------------------A----_
|\ | /| COL |_|
FH J KB
| \|/ |
_
--G-- --M-- COL |_|
| /|\ |
EQ P NC
|/ | \|
_
-----D----- DP |_|
((uint16_t) 0x0028)
((uint16_t) 0x0011)
((uint16_t) 0x00c0)
((uint16_t) 0xec00)
((uint16_t) 0xffdd)
void LCD_Initialization(void){
LCD_PIN_Init();
LCD_Clock_Init();
LCD_Configure();
LCD_Clear();
}
void LCD_PIN_Init(void){
// LCD (24 segments, 4 commons, multiplexed 1/4 duty, 1/3 bias) on DIP28 connector
// VLCD = PC3
//
// COM0 = PA8 COM1 = PA9
COM2 = PA10 COM3 = PB9
//
// SEG0 = PA7 SEG6 = PD11 SEG12 = PB5 SEG18 = PD8
// SEG1 = PC5 SEG7 = PD13 SEG13 = PC8 SEG19 = PB14
// SEG2 = PB1 SEG8 = PD15 SEG14 = PC6 SEG20 = PB12
// SEG3 = PB13 SEG9 = PC7
SEG15 = PD14 SEG21 = PB0
// SEG4 = PB15 SEG10 = PA15 SEG16 = PD12 SEG22 = PC4
// SEG5 = PD9 SEG11 = PB4
SEG17 = PD10 SEG23 = PA6
/* Enable GPIOs clock */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN | RCC_AHB2ENR_GPIOBEN |
RCC_AHB2ENR_GPIOCEN | RCC_AHB2ENR_GPIODEN;
// GPIO Mode: Input(00, reset), Output(01), AlterFunc(10), Analog(11, reset)
// GPIO Speed: Low speed (00), Medium speed (01), Fast speed (10), High speed (11)
// GPIO Push-Pull: No pull-up, pull-down (00), Pull-up (01), Pull-down (10), Reserved (11)
// GPIO Output Type: Output push-pull (0, reset), Output open drain (1)
/* Configure PA 6, 7, 8, 9, 10, 15 as Alternative Function 11 (0x0B)*/
GPIOA->MODER =
GPIOA->AFR[0] =
GPIOA->AFR[1] =
GPIOA->OSPEEDR &= ~(3U<<(2*6) | 3U<<(2*7) | 3U<<(2*8) | 3U<<(2*9) | 3U<<(2*10) |
3U<<(2*15));
GPIOA->OSPEEDR |= 2U<<(2*6) | 2U<<(2*7) | 2U<<(2*8) | 2U<<(2*9) | 2U<<(2*10) |
2U<<(2*15) ;
GPIOA->PUPDR &= ~(3U<<(2*6) | 3U<<(2*7) | 3U<<(2*8) | 3U<<(2*9) | 3U<<(2*10) |
3U<<(2*15));
/* Configure PB 0, 1, 4, 5, 9, 12, 13, 14, 15 as Alternative Function 11 (0x0B)*/
GPIOB->MODER =
GPIOB->AFR[0] =
GPIOB->AFR[1] =
GPIOB->OSPEEDR &= ~(3U<<(2*0) | 3U<<(2*1) | 3U<<(2*4) | 3U<<(2*5) | 3U<<(2*9) |
3U<<(2*12)| 3U<<(2*13)| 3U<<(2*14)| 3U<<(2*15));
GPIOB->OSPEEDR |= 2U<<(2*0) | 2U<<(2*1) | 2U<<(2*4) | 2U<<(2*5) | 2U<<(2*9) |
2U<<(2*12)| 2U<<(2*13)| 2U<<(2*14)| 2U<<(2*15);
GPIOB->PUPDR &= ~(3U<<(2*0) | 3U<<(2*1) | 3U<<(2*4) | 3U<<(2*5) | 3U<<(2*9) |
3U<<(2*12)| 3U<<(2*13)| 3U<<(2*14)| 3U<<(2*15));
// RTC Clock selection can be changed only if the Backup Domain is reset
RCC->BDCR |= RCC_BDCR_BDRST;
RCC->BDCR &= ~RCC_BDCR_BDRST;
// Note from STM32L4 Reference Manual:
// RTC/LCD Clock: (1) LSE is in the Backup domain. (2) HSE and LSI are not.
while((RCC->BDCR & RCC_BDCR_LSERDY) == 0){ // Wait until LSE clock ready
RCC->BDCR |= RCC_BDCR_LSEON;
}
// Select LSE as RTC clock source
// BDCR = Backup Domain Control Register
RCC->BDCR &= ~RCC_BDCR_RTCSEL;
// RTCSEL[1:0]: 00 = No Clock, 01 = LSE,
10 = LSI, 11 = HSE
RCC->BDCR |= RCC_BDCR_RTCSEL_0; // Select LSE as RTC clock
RCC->APB1ENR1 &= ~RCC_APB1ENR1_PWREN;
// Wait for the external capacitor Cext which is connected to the VLCD pin is charged
(approximately 2ms for Cext=1uF)
// Enable LCD peripheral Clock
RCC->APB1ENR1 |= RCC_APB1ENR1_LCDEN;
// Enable SYSCFG
// RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
}
void LCD_Configure(void){
LCD->CR &= ~LCD_CR_LCDEN;
// Disable LCD
void LCD_Clear(void){
uint8_t counter = 0;
// Wait until LCD ready */
while ((LCD->SR & LCD_SR_UDR) != 0); // Wait for Update Display Request Bit
for (counter = 0; counter <= 15; counter++) {
LCD->RAM[counter] = 0;
}
/* Update the LCD display */
LCD->SR |= LCD_SR_UDR;
}
case '*':
ch = C_STAR;
break;
case '(' :
ch = C_OPENPARMAP;
break;
case ')' :
ch = C_CLOSEPARMAP;
break;
case 'd' :
ch = C_DMAP;
break;
case 'm' :
ch = C_MMAP;
break;
case 'n' :
ch = C_NMAP;
break;
case '' :
ch = C_UMAP;
break;
case '-' :
ch = C_MINUS;
break;
case '+' :
ch = C_PLUS;
break;
case '/' :
ch = C_SLATCH;
break;
case '' :
ch = C_PERCENT_1;
break;
case '%' :
ch = C_PERCENT_2;
break;
case 255 :
ch = C_FULL;
break ;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
ch = NumberMap[*c-0x30];
break;
default:
/* The character c is one letter in upper case*/
if ( (*c < 0x5b) && (*c > 0x40) )
{
ch = CapLetterMap[*c-'A'];
}
/* The character c is one letter in lower case*/
if ( (*c <0x7b) && ( *c> 0x60) )
{
ch = CapLetterMap[*c-'a'];
}
break;
}
/* Set the digital point can be displayed if the point is on */
if (point)
{
ch |= 0x0002;
}
/* Set the "COL" segment in the character that can be displayed if the colon is on */
if (colon)
{
ch |= 0x0020;
}
for (loop = 12,index=0 ;index < 4; loop -= 4,index++)
{
digit[index] = (ch >> loop) & 0x0f; /*To isolate the less significant digit */
}
}
/**
* @brief Write a character in the LCD frame buffer
* @param ch: the character to display.
* @param Point: a point to add in front of char
* @param Colon: flag indicating if a colon character has to be added in front
*
of displayed character.
* @param Position: position in the LCD of the character to write [1:6]
*/
void LCD_WriteChar(uint8_t* ch, bool point, bool colon, uint8_t position){
uint8_t digit[4]; /* Digit frame buffer */
// Convert displayed character in segment in array digit
LCD_Conv_Char_Seg(ch, point, colon, digit);
// TO wait LCD Ready *
while ((LCD->SR & LCD_SR_UDR) != 0); // Wait for Update Display Request Bit
switch (position) {
/* Position 1 on LCD (digit1)*/
case 0:
LCD->RAM[0] &= ~( 1U << 4 | 1U << 23 | 1U << 22 | 1U << 3 );
case 2:
LCD->RAM[0] &= ~( 1U << 15 | 1U << 29 | 1U << 28 | 1U << 14 );
LCD->RAM[2] &= ~( 1U << 15 | 1U << 29 | 1U << 28 | 1U << 14 );
LCD->RAM[4] &= ~( 1U << 15 | 1U << 29 | 1U << 28 | 1U << 14 );
LCD->RAM[6] &= ~( 1U << 15 | 1U << 29 | 1U << 28 | 1U << 14 );
/* 3G 3B 3M 3E */
LCD->RAM[0] |= ((digit[0] & 0x1) << 15) | (((digit[0] & 0x2) >> 1) << 29) | (((digit[0] &
0x4) >> 2) << 28) | (((digit[0] & 0x8) >> 3) << 14);
/* 3F 3A 3C 3D */
LCD->RAM[2] |= ((digit[1] & 0x1) << 15) | (((digit[1] & 0x2) >> 1) << 29) | (((digit[1] &
0x4) >> 2) << 28) | (((digit[1] & 0x8) >> 3) << 14);
/* 3Q 3K 3Col 3P */
LCD->RAM[4] |= ((digit[2] & 0x1) << 15) | (((digit[2] & 0x2) >> 1) << 29) | (((digit[2] &
0x4) >> 2) << 28) | (((digit[2] & 0x8) >> 3) << 14);
/* 3H 3J 3DP 3N */
LCD->RAM[6] |= ((digit[3] & 0x1) << 15) | (((digit[3] & 0x2) >> 1) << 29) | (((digit[3] &
0x4) >> 2) << 28) | (((digit[3] & 0x8) >> 3) << 14);
break;
/* Position 4 on LCD (digit4)*/
case 3:
LCD->RAM[0] &= ~( 1U << 31 | 1U << 30);
LCD->RAM[1] &= ~( 1U << 1 | 1U << 0 );
LCD->RAM[2] &= ~( 1U << 31 | 1U << 30);
LCD->RAM[3] &= ~( 1U << 1 | 1U << 0 );
LCD->RAM[4] &= ~( 1U << 31 | 1U << 30);
LCD->RAM[5] &= ~( 1U << 1 | 1U << 0 );
LCD->RAM[6] &= ~( 1U << 31 | 1U << 30);
LCD->RAM[7] &= ~( 1U << 1 | 1U << 0 );
/* 4G 4B 4M 4E */
LCD->RAM[0] |= ((digit[0] & 0x1) << 31) | (((digit[0] & 0x8) >> 3) << 30);
LCD->RAM[1] |= (((digit[0] & 0x2) >> 1) << 1) | (((digit[0] & 0x4) >> 2) << 0);
/* 4F 4A 4C 4D */
LCD->RAM[2] |= ((digit[1] & 0x1) << 31) | (((digit[1] & 0x8) >> 3) << 30);
LCD->RAM[3] |= (((digit[1] & 0x2) >> 1) << 1) | (((digit[1] & 0x4) >> 2) << 0);
/* 4Q 4K 4Col 4P */
LCD->RAM[4] |= ((digit[2] & 0x1) << 31) | (((digit[2] & 0x8) >> 3) << 30);
LCD->RAM[5] |= (((digit[2] & 0x2) >> 1) << 1) | (((digit[2] & 0x4) >> 2) << 0);
/* 4H 4J 4DP 4N */
LCD->RAM[6] |= ((digit[3] & 0x1) << 31) | (((digit[3] & 0x8) >> 3) << 30);
LCD->RAM[7] |= (((digit[3] & 0x2) >> 1) << 1) | (((digit[3] & 0x4) >> 2) << 0);
break;
/* Position 5 on LCD (digit5)*/
case 4:
LCD->RAM[0] &= ~( 1U << 25 | 1U << 24);
LCD->RAM[1] &= ~( 1U << 3 | 1U << 2 );
LCD->RAM[2] &= ~( 1U << 25 | 1U << 24);
LCD->RAM[3] &= ~( 1U << 3 | 1U << 2 );
LCD->RAM[4] &= ~( 1U << 25 | 1U << 24 );
LCD->RAM[5] &= ~( 1U << 3 | 1U << 2 );
LCD->RAM[6] &= ~( 1U << 25 | 1U << 24 );
LCD->RAM[7] &= ~( 1U << 3 | 1U << 2 );
/* 5G 5B 5M 5E */
LCD->RAM[0] |= (((digit[0] & 0x2) >> 1) << 25) | (((digit[0] & 0x4) >> 2) << 24);
LCD->RAM[1] |= ((digit[0] & 0x1) << 3) | (((digit[0] & 0x8) >> 3) << 2);
/* 5F 5A 5C 5D */
LCD->RAM[2] |= (((digit[1] & 0x2) >> 1) << 25) | (((digit[1] & 0x4) >> 2) << 24);
LCD->RAM[3] |= ((digit[1] & 0x1) << 3) | (((digit[1] & 0x8) >> 3) << 2);
/* 5Q 5K 5Col 5P */
LCD->RAM[4] |= (((digit[2] & 0x2) >> 1) << 25) | (((digit[2] & 0x4) >> 2) << 24);
LCD->RAM[5] |= ((digit[2] & 0x1) << 3) | (((digit[2] & 0x8) >> 3) << 2);
/* 5H 5J 5DP 5N */
LCD->RAM[6] |= (((digit[3] & 0x2) >> 1) << 25) | (((digit[3] & 0x4) >> 2) << 24);
LCD->RAM[7] |= ((digit[3] & 0x1) << 3) | (((digit[3] & 0x8) >> 3) << 2);
break;
/* Position 6 on LCD (digit6)*/
case 5:
LCD->RAM[0] &= ~( 1U << 17 | 1U << 8 | 1U << 9 | 1U << 26 );
LCD->RAM[2] &= ~( 1U << 17 | 1U << 8 | 1U << 9 | 1U << 26 );
LCD->RAM[4] &= ~( 1U << 17 | 1U << 8 | 1U << 9 | 1U << 26 );
LCD->RAM[6] &= ~( 1U << 17 | 1U << 8 | 1U << 9 | 1U << 26 );
/* 6G 6B 6M 6E */
LCD->RAM[0] |= ((digit[0] & 0x1) << 17) | (((digit[0] & 0x2) >> 1) << 8) | (((digit[0] &
I wrote
this code to solve the problem question below about toggling bits and I was hoping
someone could help me figure out how to modify it in arduino to do parts 1-3. I feel
like they are really easy modifications I'm just not sure where to start. Also if me
code isn't right feel free to make corrections. Thanks
Please Show steps as detailed as possible. Thank You very much for your help.