Разработка информационной подсистемы "Traffic Manager", осуществляющей управление и мониторинг межсетевого экрана Microsoft Forefront Threat Management Gateway 2010
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
m int, @ZERO int, @IsAlpa int@ZERO = ASCII('0')@IsNum = ASCII('9')@IsAlpa = ASCII('a') - 10@intH int, @intL int@intH = ASCII(SUBSTRING(@strInAddress, 1, 1))(@intH <= @IsNum) SET @intH = @intH - @ZERO ELSE SET @intH = @intH - @IsAlpa@intL = ASCII(SUBSTRING(@strInAddress, 2, 1))(@intL <= @IsNum) SET @intL = @intL - @ZERO ELSE SET @intL = @intL - @IsAlpa@strOutAddress = CONVERT(varchar(3), @intH * 16+ @intL)+'.'@intH = ASCII(SUBSTRING(@strInAddress, 3, 1))(@intH <= @IsNum) SET @intH = @intH - @ZERO ELSE SET @intH = @intH - @IsAlpa@intL = ASCII(SUBSTRING(@strInAddress, 4, 1))(@intL <= @IsNum) SET @intL = @intL - @ZERO ELSE SET @intL = @intL - @IsAlpa@strOutAddress = @strOutAddress + CONVERT(varchar(3), @intH * 16 + @intL) + '.'@intH = ASCII(SUBSTRING(@strInAddress, 5, 1))(@intH <= @IsNum) SET @intH = @intH - @ZERO ELSE SET @intH = @intH - @IsAlpa@intL = ASCII(SUBSTRING(@strInAddress, 6, 1))(@intL <= @IsNum) SET @intL = @intL - @ZERO ELSE SET @intL = @intL - @IsAlpa@strOutAddress = @strOutAddress + CONVERT(varchar(3), @intH * 16 + @intL) + '.'@intH = ASCII(SUBSTRING(@strInAddress, 7, 1))(@intH <= @IsNum) SET @intH = @intH - @ZERO ELSE SET @intH = @intH - @IsAlpa@intL = ASCII(SUBSTRING(@strInAddress, 8, 1))(@intL <= @IsNum) SET @intL = @intL - @ZERO ELSE SET @intL = @intL - @IsAlpa@strOutAddress = @strOutAddress + CONVERT(varchar(3), @intH * 16 + @intL)
- ipv6@strOutAddress = @strOutAddress + SUBSTRING(@strInAddress, 1, 4) + ':' + SUBSTRING(@strInAddress, 5, 4) + ':' + SUBSTRING(@strInAddress, 10, 4) + ':' + SUBSTRING(@strInAddress, 15, 4) + ':' + SUBSTRING(@strInAddress, 20, 4) + ':'+ SUBSTRING(@strInAddress, 25, 4) + ':'+ SUBSTRING(@strInAddress, 29, 4) + ':' + SUBSTRING(@strInAddress, 33, 4)
--- guid sample '6F9619FF-8B86-D011-B42D-FFF34FC964FF' @strOutAddress
END
Приложение В
Листинг создания библиотеки для веб-фильтра
Листинг файла URLConverter.cpp
#include
#include DWORD OnPreprocHeaders (PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_PREPROC_HEADERS pHeaderData);DWORD OnLogging(PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_LOG pLogData);WINAPI TerminateFilter (DWORD dwFlags)
{_PARAMETER(dwFlags);TRUE;
}WINAPI GetFilterVersion (PHTTP_FILTER_VERSION pVer)
{(pVer == NULL)
{(ERROR_INVALID_PARAMETER);FALSE;
}>dwFilterVersion = HTTP_FILTER_REVISION;>dwFlags = SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_LOG;TRUE;
}WINAPI HttpFilterProc (PHTTP_FILTER_CONTEXT pfc, DWORD NotificationType, LPVOID pvNotification)
{(NotificationType)
{SF_NOTIFY_PREPROC_HEADERS:OnPreprocHeaders(pfc, (PHTTP_FILTER_PREPROC_HEADERS)pvNotification);SF_NOTIFY_LOG:OnLogging(pfc, (PHTTP_FILTER_LOG)pvNotification);:(ERROR_INVALID_PARAMETER);SF_STATUS_REQ_ERROR;
}
}DWORD OnPreprocHeaders (PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_PREPROC_HEADERS pHeaderData)
{hostlen = 200;cbSize = 1024;dwReserved = 0;(NULL == pfc || NULL == pHeaderData)
{( ERROR_INVALID_PARAMETER);SF_STATUS_REQ_ERROR;
}(NULL == pfc->pFilterContext)
{>pFilterContext = pfc->AllocMem(pfc, cbSize, dwReserved);(NULL == pfc->pFilterContext)
{>ServerSupportFunction(pfc, SF_REQ_DISABLE_NOTIFICATIONS, NULL, SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_LOG, 0);(ERROR_NOT_ENOUGH_MEMORY);SF_STATUS_REQ_ERROR;
}
}(!pHeaderData->GetHeader(pfc, "Host:", pfc->pFilterContext, &hostlen))((CHAR*)pfc->pFilterContext, "hostname.not.found");
{(hostlen pFilterContext, "hostname.too.long");
}SF_STATUS_REQ_NEXT_NOTIFICATION;
}DWORD OnLogging (PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_LOG pLogData)
{hostname[210];* pSource;* pDest;slash = 0;i;(NULL == pfc || NULL == pLogData)
{(ERROR_INVALID_PARAMETER);SF_STATUS_REQ_ERROR;
}(NULL != pfc->pFilterContext && NULL != pLogData->pszTarget)
{(hostname, (CHAR*)pfc->pFilterContext, 200);[200] = '\0';= (CHAR*)pLogData->pszTarget;= (CHAR*)pfc->pFilterContext;(i = 0; i < 820; i++)
{(*pSource == '\0') break;(slash == 2)
{(pDest, hostname);(*pDest != '\0') pDest++;(*pSource != '/' && *pSource !='\0'&&i <820)
{++;++;
}(*pSource == '/')
{(*pSource != '\0' && i < 820)
{
*pDest = *pSource;++;++;++;
}
};
}
*pDest = *pSource;(*pSource == '/') slash++; else slash = 0;++;++;
}
*pDest = '\0';>pszTarget = (const CHAR*)pfc->pFilterContext;
}SF_STATUS_REQ_NEXT_NOTIFICATION;
}
Приложение Г
Листинг приложения Traffic Manager
Листинг файла MainForm.csSystem;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;Form1
{partial class frmView : Form
{frmView()
{();
}void Form1_Load(object sender, EventArgs e)
{
// TODO: данная строка кода позволяет загрузить данные в таблицу "dBClientDataSet.ClientBase". При необходимости она может быть перемещена или удалена..clientBaseTableAdapter.Fill(this.dBClientDataSet.ClientBase);
// TODO: данная строка кода позволяет загрузить данные в таблицу "dBClientDataSet.State". При необходимости она может быть перемещена или удалена..stateTableAdapter.Fill(this.dBClientDataSet.State);
// TODO: данная строка кода позволяет загрузить данные в таблицу "dBClientDataSet.Report". При необходимости она может быть перемещена или удалена.
this.ReportTableAdapter.Fill(this.dBClientDataSet.Report);
}void frmView_Activated(object sender, EventArgs e)
{
// TODO: данная строка кода позволяет загрузить данные в таблицу "dBClientDataSet.ClientBase". При необходимости она может быть перемещена или удалена..clientBaseTableAdapter.Fill(this.dBClientDataSet.ClientBase);
FormatDGR();
}void fillToolStripButton_Click(object sender, EventArgs e)
{
{.ReportTableAdapter.Fill(this.dBClientDataSet.Report);
}(System.Exception ex)
{.Windows.Forms.MessageBox.Show(ex.Message);
}
}void cmbReport_KeyDown(object sender, KeyEventArgs e)
{.DroppedDown = true;
}void btnNewClient_Click(object sender, EventArgs e)
{f = new frmNewClient(Convert.ToInt32(cmbReport.SelectedValue));.ShowDialog();
}void btnChangeClient_Click(object sender, EventArgs e)
{f = new frmChangeClient(Convert.ToInt32(dgrClients.Rows[dgrClients.CurrentCell.RowIndex].Cells[0].Value));.ShowDialog();
}void dgrClients_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{f = new frmChangeClient(Convert.ToInt32(dgrClients.Rows[dgrClients.CurrentCell.RowIndex].Cells[0].Value));.ShowDialog();
}
#Report ПоискFormatDGR()
{(int i = 0; i < dgrClients.RowCount; i++)
{(dgrClients.Rows[i].Cells[1].Value.ToString()=="1")
{.Rows[i].Cells[2].Style.BackColor = System.Drawing.Color.FromName("white");.Rows[i].Cells[3].Style.BackColor = System.Drawing.Color.FromName("white");
}if (dgrClients.Rows[i].Cells[1].Value.ToString()=="2")
{.Rows[i].Cells[2].Style.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);.Rows[i].Cells[3].Style.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);
}if (dgrClients.Rows[i].Cells[1].Value.ToString() == "3")
{.Rows[i].Cells[2].Style.BackColor = System.Drawing.Color.FromArgb(200, 255, 200);.Rows[i].Cells[3].Style.BackColor = System.Drawing.Color.FromArgb(200, 255, 200);
}
{.Rows[i].Cells[2].Style.BackColor = System.Drawing.Color.FromArgb(255, 148, 148);.Rows[i].Cells[3].Style.BackColor = System.Drawing.Color.FromArgb(255, 148, 148);
}
}
}Search()
{(stateBindingSource.Count != 0 && ReportBindingSource.Count != 0)
{.Filter = "Report=" + cmbReport.SelectedValue.ToString();(cmbType.SelectedValue.ToString() != "0")
{.Filter += "AND State =" + cmbType.SelectedValue.ToString();
}(txtName.Text!="")
{.Filter += "AND Name LIKE '%" + txtName.Text+"%'";
}(txtUser.Text != "")
{.Filter += "AND User LIKE '%" + txtUser.Text + "%'";
}.Refresh();();
}
}void cmbReport_SelectedValueChanged(object sender, EventArgs e)
{.Text = "";.Text = "";.SelectedValue = 0;();
}void cmbType_SelectedValueChanged(object sender, EventArgs e)
{();
}void txtName_KeyUp(object sender, KeyEventArgs e)
{();
}void txtUser_KeyUp(object sender, KeyEventArgs e)
{();
}void btnClean_Click(object sender, EventArgs e)
{.Text = "";.Text = "";.SelectedValue = 0;();
}
#endReport
}
}
Листинг файла Report.csSystem;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;Report
{par