From 8808689fe340bec6e90ab13dd502292b0579cf1f Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Sat, 08 Dec 2012 21:19:17 +0000 Subject: initial osx port Signed-off-by: Michael Krelin --- diff --git a/.gitignore b/.gitignore index fd020f1..0370190 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,5 @@ - -# / -/Debug -/Release -/Releast -/debug -/release -/releast -/DEBUG -/RELEASE -/RELEAST -/*.mdp -/*.ncb -/*.aps -/redist - -# /help/ -/help/PUMPKIN.HLP -/help/pumpkin.LOG -/help/pumpkin.hm -/help/pumpkin.GID -/help/PumpKIN.FTS - -# /install/ -/install/debug -/install/pure -/install/canned -/install/static -/install/Debug -/install/Pure -/install/Canned -/install/Static -/install/DEBUG -/install/PURE -/install/CANNED -/install/STATIC -/install/*.aps +.DS_Store +/build +/*.xcodeproj/*.mode1v3 +/*.xcodeproj/*.pbxuser +xcuserdata/ diff --git a/ACLTargetCombo.cpp b/ACLTargetCombo.cpp deleted file mode 100644 index cdbd075..0000000 --- a/ACLTargetCombo.cpp +++ b/dev/null @@ -1,85 +0,0 @@ -// ACLTargetCombo.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "PumpKINDlg.h" -#include "ACLTargetCombo.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CACLTargetCombo - -CACLTargetCombo::CACLTargetCombo() -: m_op(-1) -{ -} - -CACLTargetCombo::~CACLTargetCombo() -{ -} - - -BEGIN_MESSAGE_MAP(CACLTargetCombo, CComboBox) - //{{AFX_MSG_MAP(CACLTargetCombo) - // NOTE - the ClassWizard will add and remove mapping macros here. - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CACLTargetCombo message handlers - -void CACLTargetCombo::SetOp(int op) -{ - m_op=op; - ResetContent(); - switch(op) { - case tftp::opRRQ: - m_tmap.RemoveAll(); - SetItemData(m_tmap[acl_rule::rrqNone]=AddString("fallback to global"),acl_rule::rrqNone); - SetItemData(m_tmap[acl_rule::rrqDeny]=AddString("deny access"),acl_rule::rrqDeny); - SetItemData(m_tmap[acl_rule::rrqPrompt]=AddString("prompt"),acl_rule::rrqPrompt); - SetItemData(m_tmap[acl_rule::rrqGrant]=AddString("grant access"),CPumpKINDlg::rrqGrant); - SetCurSel(0); - EnableWindow(TRUE); - break; - case tftp::opWRQ: - m_tmap.RemoveAll(); - SetItemData(m_tmap[acl_rule::wrqNone]=AddString("fallback to global"),acl_rule::wrqNone); - SetItemData(m_tmap[acl_rule::wrqDeny]=AddString("deny access"),acl_rule::wrqDeny); - SetItemData(m_tmap[acl_rule::wrqPrompt]=AddString("prompt"),acl_rule::wrqPrompt); - SetItemData(m_tmap[acl_rule::wrqPromptIfExists]=AddString("prompt if file exists"),acl_rule::wrqPromptIfExists); - SetItemData(m_tmap[acl_rule::wrqGrant]=AddString("grant access"),acl_rule::wrqGrant); - SetCurSel(0); - EnableWindow(TRUE); - break; - default: - EnableWindow(FALSE); - break; - } -} - -int CACLTargetCombo::GetTarget() -{ - int cs=GetCurSel(); - if(cs==CB_ERR) - return -1; - return GetItemData(cs); -} - -void CACLTargetCombo::SetTarget(int t,int op) -{ - if(op>=0) - SetOp(op); - ASSERT(m_op>=0); - int i; - if(m_tmap.Lookup(t,i)) - SetCurSel(i); - else - SetCurSel(0); -} diff --git a/ACLTargetCombo.h b/ACLTargetCombo.h deleted file mode 100644 index ef7baef..0000000 --- a/ACLTargetCombo.h +++ b/dev/null @@ -1,42 +0,0 @@ -// ACLTargetCombo.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CACLTargetCombo window - -class CACLTargetCombo : public CComboBox -{ -// Construction -public: - void SetTarget(int t,int op=-1); - int GetTarget(); - void SetOp(int op); - int m_op; - CACLTargetCombo(); - -// Attributes -public: - CMap m_tmap; - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CACLTargetCombo) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CACLTargetCombo(); - - // Generated message map functions -protected: - //{{AFX_MSG(CACLTargetCombo) - // NOTE - the ClassWizard will add and remove member functions here. - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// diff --git a/COPYING b/COPYING index 72571d7..a261fe4 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 1997-2006 Klever Group (http://www.klever.net/) +Copyright (c) 2012 Klever Group (http://www.klever.net/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/ConfirmRRQDlg.cpp b/ConfirmRRQDlg.cpp deleted file mode 100644 index 361ad14..0000000 --- a/ConfirmRRQDlg.cpp +++ b/dev/null @@ -1,67 +0,0 @@ -// ConfirmRRQDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "ConfirmRRQDlg.h" -#include "PumpKINDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CConfirmRRQDlg dialog - - -CConfirmRRQDlg::CConfirmRRQDlg(CWnd* pParent /*=NULL*/) - : CDialog(CConfirmRRQDlg::IDD, pParent) -{ - m_Daddy=NULL; - //{{AFX_DATA_INIT(CConfirmRRQDlg) - m_File = _T(""); - m_Host = _T(""); - //}}AFX_DATA_INIT -} - - -void CConfirmRRQDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CConfirmRRQDlg) - DDX_Text(pDX, IDC_FILE, m_File); - DDX_Text(pDX, IDC_HOST, m_Host); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CConfirmRRQDlg, CDialog) - //{{AFX_MSG_MAP(CConfirmRRQDlg) - ON_WM_TIMER() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CConfirmRRQDlg message handlers - -BOOL CConfirmRRQDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - m_Daddy->m_Daddy->m_bnw.StartSound(m_Daddy->m_Daddy->m_bnwRequest); - if(m_Daddy->m_Daddy->m_PromptTimeOut) - SetTimer(1,m_Daddy->m_Daddy->m_PromptTimeOut*1000,NULL); - SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CConfirmRRQDlg::OnTimer(UINT nIDEvent) -{ - if(nIDEvent==1) - EndDialog(IDCANCEL); - CDialog::OnTimer(nIDEvent); -} diff --git a/ConfirmRRQDlg.h b/ConfirmRRQDlg.h deleted file mode 100644 index 465d438..0000000 --- a/ConfirmRRQDlg.h +++ b/dev/null @@ -1,39 +0,0 @@ -// ConfirmRRQDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CConfirmRRQDlg dialog - -class CRRQSocket; -class CConfirmRRQDlg : public CDialog -{ -// Construction -public: - CRRQSocket * m_Daddy; - CConfirmRRQDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CConfirmRRQDlg) - enum { IDD = IDD_CONFIRM_RRQ }; - CString m_File; - CString m_Host; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CConfirmRRQDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CConfirmRRQDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnTimer(UINT nIDEvent); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; diff --git a/ConfirmWRQDlg.cpp b/ConfirmWRQDlg.cpp deleted file mode 100644 index c0380e3..0000000 --- a/ConfirmWRQDlg.cpp +++ b/dev/null @@ -1,89 +0,0 @@ -// ConfirmWRQDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "ConfirmWRQDlg.h" - -#include "PumpKINDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CConfirmWRQDlg dialog - - -CConfirmWRQDlg::CConfirmWRQDlg(CWnd* pParent /*=NULL*/) - : CDialog(CConfirmWRQDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CConfirmWRQDlg) - m_File = _T(""); - m_Host = _T(""); - //}}AFX_DATA_INIT -} - - -void CConfirmWRQDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CConfirmWRQDlg) - DDX_Control(pDX, IDC_RESUME, m_ResumeCtl); - DDX_Control(pDX, IDOK, m_OkCtl); - DDX_Control(pDX, IDC_RENAME, m_RenameCtl); - DDX_Text(pDX, IDC_FILE, m_File); - DDX_Text(pDX, IDC_HOST, m_Host); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CConfirmWRQDlg, CDialog) - //{{AFX_MSG_MAP(CConfirmWRQDlg) - ON_BN_CLICKED(IDC_RENAME, OnRename) - ON_WM_TIMER() - ON_BN_CLICKED(IDC_RESUME, OnResume) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CConfirmWRQDlg message handlers - -void CConfirmWRQDlg::OnRename() -{ - EndDialog(IDC_RENAME); -} - -BOOL CConfirmWRQDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - m_Daddy->m_Daddy->m_bnw.StartSound(m_Daddy->m_Daddy->m_bnwRequest); - if(m_Daddy->m_Daddy->m_PromptTimeOut) - SetTimer(1,m_Daddy->m_Daddy->m_PromptTimeOut*1000,NULL); - SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE); - m_ResumeCtl.EnableWindow(m_Daddy->m_bResume); - if(m_Daddy->m_Rename){ - m_OkCtl.SetButtonStyle(m_OkCtl.GetButtonStyle()&~BS_DEFPUSHBUTTON); - m_RenameCtl.SetButtonStyle(m_RenameCtl.GetButtonStyle()|BS_DEFPUSHBUTTON); - m_RenameCtl.SetFocus(); - return FALSE; - } - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CConfirmWRQDlg::OnTimer(UINT nIDEvent) -{ - if(nIDEvent==1) - EndDialog(IDCANCEL); - CDialog::OnTimer(nIDEvent); -} - -void CConfirmWRQDlg::OnResume() -{ - EndDialog(IDC_RESUME); -} diff --git a/ConfirmWRQDlg.h b/ConfirmWRQDlg.h deleted file mode 100644 index c14848d..0000000 --- a/ConfirmWRQDlg.h +++ b/dev/null @@ -1,44 +0,0 @@ -// ConfirmWRQDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CConfirmWRQDlg dialog - -class CWRQSocket; -class CConfirmWRQDlg : public CDialog -{ -// Construction -public: - CWRQSocket *m_Daddy; - CConfirmWRQDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CConfirmWRQDlg) - enum { IDD = IDD_CONFIRM_WRQ }; - CButton m_ResumeCtl; - CButton m_OkCtl; - CButton m_RenameCtl; - CString m_File; - CString m_Host; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CConfirmWRQDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CConfirmWRQDlg) - afx_msg void OnRename(); - virtual BOOL OnInitDialog(); - afx_msg void OnTimer(UINT nIDEvent); - afx_msg void OnResume(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; diff --git a/KTAGS b/KTAGS deleted file mode 100644 index b27cd12..0000000 --- a/KTAGS +++ b/dev/null @@ -1,12 +0,0 @@ -about-date pumpkin.rc /LTEXT\s\+"Copyright /;" kind:d -about-version pumpkin.rc /LTEXT\s\+"PumpKIN, Version /;" kind:v -help-license-date ./help/pumpkin.xml /"$@" +${TARNAME}.tar.bz2: ${TARNAME}.tar + bzip2 -v9 <"$<" >"$@" +${TARNAME}.tar: + git archive --format tar -o "$@" --prefix="${PACKAGE}/" HEAD + +.INTERMEDIATE: ${TARNAME}.tar diff --git a/PropsACL.cpp b/PropsACL.cpp deleted file mode 100644 index 6d918ad..0000000 --- a/PropsACL.cpp +++ b/dev/null @@ -1,290 +0,0 @@ -// PropsACL.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "PumpKINDlg.h" -#include "ACLTargetCombo.h" -#include "PropsACL.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropsACL property page - -IMPLEMENT_DYNCREATE(CPropsACL, CPropertyPage) - -CPropsACL::CPropsACL() : CPropertyPage(CPropsACL::IDD) -{ - //{{AFX_DATA_INIT(CPropsACL) - //}}AFX_DATA_INIT -} - -CPropsACL::~CPropsACL() -{ -} - -void CPropsACL::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropsACL) - DDX_Control(pDX, IDC_ACL_REPLACE, m_ReplaceCtl); - DDX_Control(pDX, IDC_ACL_NETMASK, m_NetmaskCtl); - DDX_Control(pDX, IDC_ACL_XFER, m_XferCtl); - DDX_Control(pDX, IDC_ACL_UP, m_UpCtl); - DDX_Control(pDX, IDC_ACL_RULE, m_RuleCtl); - DDX_Control(pDX, IDC_ACL_REMOVE, m_RemoveCtl); - DDX_Control(pDX, IDC_ACL_LIST, m_ListCtl); - DDX_Control(pDX, IDC_ACL_DOWN, m_DownCtl); - DDX_Control(pDX, IDC_ACL_ADDR, m_AddrCtl); - DDX_Control(pDX, IDC_ACL_ADD, m_AddCtl); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropsACL, CPropertyPage) - //{{AFX_MSG_MAP(CPropsACL) - ON_CBN_SELCHANGE(IDC_ACL_XFER, OnSelchangeAclXfer) - ON_NOTIFY(LVN_ITEMCHANGED, IDC_ACL_LIST, OnItemchangedAclList) - ON_BN_CLICKED(IDC_ACL_ADD, OnAclAdd) - ON_BN_CLICKED(IDC_ACL_REPLACE, OnAclReplace) - ON_BN_CLICKED(IDC_ACL_REMOVE, OnAclRemove) - ON_BN_CLICKED(IDC_ACL_UP, OnAclUp) - ON_BN_CLICKED(IDC_ACL_DOWN, OnAclDown) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropsACL message handlers - -BOOL CPropsACL::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_FocusedRule=-1; - - m_Images.Create(16,16,TRUE,2,1); - m_iRRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_RRQ)); - m_iWRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_WRQ)); - ASSERT(m_iRRQ>=0); ASSERT(m_iWRQ>=0); - m_ListCtl.SetImageList(&m_Images,LVSIL_NORMAL); - m_ListCtl.SetImageList(&m_Images,LVSIL_SMALL); - m_ListCtl.SetImageList(&m_Images,LVSIL_STATE); - - CRect lrc; m_ListCtl.GetClientRect(&lrc); - long lrcw3 = lrc.Width()/3; - m_ListCtl.InsertColumn(0,"IP",LVCFMT_LEFT,lrcw3,subitemIP); - m_ListCtl.InsertColumn(1,"netmask",LVCFMT_LEFT,lrcw3,subitemNM); - m_ListCtl.InsertColumn(2,"action",LVCFMT_LEFT,lrc.Width()-lrcw3*2,subitemAction); - - m_UpCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_UP)); - m_DownCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_DOWN)); - m_RemoveCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_REMOVE)); - - m_XferCtl.SetItemData(0,tftp::opRRQ); - m_XferCtl.SetItemData(1,tftp::opWRQ); - - m_AddrCtl.SetWindowText("192.168.0.0"); - m_NetmaskCtl.SetWindowText("255.255.255.0"); - - for(int i=0;iuChanged&LVIF_STATE) - && - (pNMListView->uNewState&LVIS_FOCUSED)!=(pNMListView->uOldState&LVIS_FOCUSED) - && - pNMListView->iItem>=0 && pNMListView->iItemuNewState&LVIS_FOCUSED) - m_FocusedRule=pNMListView->iItem; - else if(pNMListView->iItem==m_FocusedRule) - m_FocusedRule=-1; - UpdateControls(); - } - - *pResult = 0; -} - -void CPropsACL::UpdateControls() { - if(m_FocusedRule>=m_rulist.GetSize()) - m_FocusedRule=-1; - if(m_FocusedRule>=0) { - m_UpCtl.EnableWindow(m_FocusedRule>0); - m_DownCtl.EnableWindow(m_FocusedRule<(m_ListCtl.GetItemCount()-1)); - acl_rule r; - GetListRule(m_FocusedRule,r); - SetRule(r); - m_AddCtl.EnableWindow(TRUE); - m_ReplaceCtl.EnableWindow(TRUE); - }else{ - OnSelchangeAclXfer(); - m_AddCtl.EnableWindow(TRUE); - m_ReplaceCtl.EnableWindow(FALSE); - } - m_RemoveCtl.EnableWindow(m_ListCtl.GetSelectedCount()!=0 || m_FocusedRule>=0); -} - -void CPropsACL::OnAclAdd() { - acl_rule r; - UINT err=GetRule(r); - if(err) { - AfxMessageBox(err,MB_OK); - }else{ - int i=m_rulist.AppendRule(r); - ASSERT(r.op==acl_rule::opRRQ || r.op==acl_rule::opWRQ); - m_ListCtl.InsertItem(i,0); - SetListRule(i,r); - } -} - -void CPropsACL::OnAclReplace() { - acl_rule r; - UINT err=GetRule(r); - if(err) { - AfxMessageBox(err,MB_OK); - }else{ - ASSERT(m_FocusedRule>=0); - m_rulist[m_FocusedRule]=r; - SetListRule(m_FocusedRule,r); - } -} - -int CPropsACL::GetOp() { - int cs=m_XferCtl.GetCurSel(); - if(cs==CB_ERR) - return -1; - else - return m_XferCtl.GetItemData(cs); -} - -void CPropsACL::SetOp(int op) { - int os=m_XferCtl.GetCount(); - for(int i=0;i=0); - int fr=m_FocusedRule; - if(fr<0 || fr>=m_rulist.GetSize()) return; - m_rulist.DeleteRule(fr); - m_ListCtl.DeleteItem(fr); - ASSERT(m_rulist.GetSize()==m_ListCtl.GetItemCount()); - if(fr>=m_rulist.GetSize()) { - if(fr>0) { - fr=m_rulist.GetSize()-1; - } - }else - fr=-1; - if(fr>0) - SetListFocusSelection(fr); - m_ListCtl.SetFocus(); -} - -void CPropsACL::OnAclUp() { - int s=m_FocusedRule; - if(s<=0) return; - int d=s-1; - acl_rule r=m_rulist[s]; - m_rulist[s]=m_rulist[d]; - m_rulist[d]=r; - SetListRule(d,m_rulist[d]); - SetListRule(s,m_rulist[s]); - SetListFocusSelection(d); - m_ListCtl.SetFocus(); -} - -void CPropsACL::OnAclDown() { - int s=m_FocusedRule; - int d=s+1; - if(s<0 || d>=m_rulist.GetSize()) return; - acl_rule r=m_rulist[s]; - m_rulist[s]=m_rulist[d]; - m_rulist[d]=r; - SetListRule(d,m_rulist[d]); - SetListRule(s,m_rulist[s]); - SetListFocusSelection(d); - m_ListCtl.SetFocus(); -} - -void CPropsACL::SetListFocusSelection(int i) { - int s=m_ListCtl.GetItemCount(); - for(int t=0;tm_bSaveAndValidate) - m_PromptTimeOut=m_PromptTimeoutCtl.GetPos(); - else - m_PromptTimeoutCtl.SetPos(m_PromptTimeOut); -} - - -BEGIN_MESSAGE_MAP(CPropsServer, CPropertyPage) - //{{AFX_MSG_MAP(CPropsServer) - ON_BN_CLICKED(IDC_BROWSE, OnBrowse) - ON_BN_CLICKED(IDC_LOGFILE_BROWSE, OnLogfileBrowse) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropsServer message handlers - -BOOL CPropsServer::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_PromptTimeoutCtl.SetRange(5,60); - m_BrowseCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_BROWSE)); - m_LogBrowseCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_BROWSE)); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CPropsServer::OnBrowse() -{ -CString nr = m_TFTPRoot; - if(Klever::BrowseForFolder(nr,IDS_SELECT_TFTPROOT,this)){ - UpdateData(TRUE); - m_TFTPRoot=nr; - UpdateData(FALSE); - } -} - -void CPropsServer::OnLogfileBrowse() -{ - UpdateData(TRUE); - CFileDialog cfd( - FALSE, ".log", (LPCSTR)m_LogFile, - OFN_EXPLORER|OFN_HIDEREADONLY|OFN_LONGNAMES|OFN_NOCHANGEDIR|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, - "Log files (*.log)|*.log|All Files (*.*)|*.*||", - this); - if(cfd.DoModal()==IDOK) { - m_LogFile = cfd.GetPathName(); - UpdateData(FALSE); - } -} diff --git a/PropsServer.h b/PropsServer.h deleted file mode 100644 index 1563479..0000000 --- a/PropsServer.h +++ b/dev/null @@ -1,48 +0,0 @@ -// PropsServer.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropsServer dialog - -class CPropsServer : public CPropertyPage -{ - DECLARE_DYNCREATE(CPropsServer) - -// Construction -public: - UINT m_PromptTimeOut; - CPropsServer(); - ~CPropsServer(); - -// Dialog Data - //{{AFX_DATA(CPropsServer) - enum { IDD = IDD_PROPS_SERVER }; - CButton m_LogBrowseCtl; - CButton m_BrowseCtl; - CSliderCtrl m_PromptTimeoutCtl; - int m_RRQMode; - CString m_TFTPRoot; - BOOL m_TFTPSubdirs; - int m_WRQMode; - CString m_LogFile; - //}}AFX_DATA - - -// Overrides - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CPropsServer) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CPropsServer) - virtual BOOL OnInitDialog(); - afx_msg void OnBrowse(); - afx_msg void OnLogfileBrowse(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; diff --git a/PropsSounds.cpp b/PropsSounds.cpp deleted file mode 100644 index a6f68d7..0000000 --- a/PropsSounds.cpp +++ b/dev/null @@ -1,146 +0,0 @@ -// PropsSounds.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "PropsSounds.h" -#include "PumpKINDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropsSounds property page - -IMPLEMENT_DYNCREATE(CPropsSounds, CPropertyPage) - -CPropsSounds::CPropsSounds() : CPropertyPage(CPropsSounds::IDD) -{ - //{{AFX_DATA_INIT(CPropsSounds) - m_Abort = _T(""); - m_Success = _T(""); - m_Request = _T(""); - //}}AFX_DATA_INIT -} - -CPropsSounds::~CPropsSounds() -{ -} - -void CPropsSounds::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropsSounds) - DDX_Control(pDX, IDC_RING_PLAY, m_RequestPlayCtl); - DDX_Control(pDX, IDC_RING_BROWSE, m_RequestBrowseCtl); - DDX_Control(pDX, IDC_RING, m_RequestCtl); - DDX_Control(pDX, IDC_FINISHED_PLAY, m_SuccessPlayCtl); - DDX_Control(pDX, IDC_FINISHED_BROWSE, m_SuccessBrowseCtl); - DDX_Control(pDX, IDC_FINISHED, m_SuccessCtl); - DDX_Control(pDX, IDC_ABORTED_PLAY, m_AbortPlayCtl); - DDX_Control(pDX, IDC_ABORTED_BROWSE, m_AbortBrowseCtl); - DDX_Control(pDX, IDC_ABORTED, m_AbortCtl); - DDX_CBString(pDX, IDC_ABORTED, m_Abort); - DDX_CBString(pDX, IDC_FINISHED, m_Success); - DDX_CBString(pDX, IDC_RING, m_Request); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropsSounds, CPropertyPage) - //{{AFX_MSG_MAP(CPropsSounds) - ON_BN_CLICKED(IDC_ABORTED_BROWSE, OnAbortedBrowse) - ON_BN_CLICKED(IDC_FINISHED_BROWSE, OnFinishedBrowse) - ON_BN_CLICKED(IDC_RING_BROWSE, OnRingBrowse) - ON_BN_CLICKED(IDC_ABORTED_PLAY, OnAbortedPlay) - ON_BN_CLICKED(IDC_FINISHED_PLAY, OnFinishedPlay) - ON_BN_CLICKED(IDC_RING_PLAY, OnRingPlay) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropsSounds message handlers - -BOOL CPropsSounds::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - -HICON hP = AfxGetApp()->LoadIcon(IDI_PLAY); -HICON hB = AfxGetApp()->LoadIcon(IDI_BROWSE); - m_RequestPlayCtl.SetIcon(hP); - m_SuccessPlayCtl.SetIcon(hP); - m_AbortPlayCtl.SetIcon(hP); - m_RequestBrowseCtl.SetIcon(hB); - m_SuccessBrowseCtl.SetIcon(hB); - m_AbortBrowseCtl.SetIcon(hB); - -CPumpKINDlg* pd = (CPumpKINDlg*)AfxGetMainWnd(); -// ASSERT_KINDOF(CPumpKINDlg,pd); - m_bnw=&pd->m_bnw; - - m_bnw->FillInCombo(&m_RequestCtl); - m_bnw->FillInCombo(&m_SuccessCtl); - m_bnw->FillInCombo(&m_AbortCtl); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CPropsSounds::OnAbortedBrowse() -{ - Browse(m_AbortCtl); -} -void CPropsSounds::OnFinishedBrowse() -{ - Browse(m_SuccessCtl); -} -void CPropsSounds::OnRingBrowse() -{ - Browse(m_RequestCtl); -} - -void CPropsSounds::OnAbortedPlay() -{ - Play(m_AbortCtl); -} - -void CPropsSounds::OnFinishedPlay() -{ - Play(m_SuccessCtl); -} - -void CPropsSounds::OnRingPlay() -{ - Play(m_RequestCtl); -} - -void CPropsSounds::Browse(CComboBox& ctl) -{ -CString f; - ctl.GetWindowText(f); -CString filter; - filter.LoadString(IDS_FILTER_WAV); -CFileDialog fd(TRUE,NULL,(LPCTSTR)f, - OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY - |OFN_LONGNAMES|OFN_NOCHANGEDIR|OFN_PATHMUSTEXIST, - filter,this); -CString title; - title.LoadString(IDS_TITLE_WAV); - fd.m_ofn.lpstrTitle=(LPCTSTR)title; - if(fd.DoModal()==IDOK) - ctl.SetWindowText(fd.GetPathName()); -} - -void CPropsSounds::Play(CComboBox& ctl) -{ -CString s; - ctl.GetWindowText(s); -CBellsNWhistles::Whistling w = m_bnw->StartSound(s); - if(w){ - Sleep(5000); - m_bnw->StopSound(w); - } -} diff --git a/PropsSounds.h b/PropsSounds.h deleted file mode 100644 index 05aea4c..0000000 --- a/PropsSounds.h +++ b/dev/null @@ -1,58 +0,0 @@ -// PropsSounds.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropsSounds dialog - -class CPropsSounds : public CPropertyPage -{ - DECLARE_DYNCREATE(CPropsSounds) - -// Construction -public: - void Play(CComboBox& ctl); - void Browse(CComboBox& ctl); - CBellsNWhistles* m_bnw; - CPropsSounds(); - ~CPropsSounds(); - -// Dialog Data - //{{AFX_DATA(CPropsSounds) - enum { IDD = IDD_PROPS_SOUNDS }; - CButton m_RequestPlayCtl; - CButton m_RequestBrowseCtl; - CComboBox m_RequestCtl; - CButton m_SuccessPlayCtl; - CButton m_SuccessBrowseCtl; - CComboBox m_SuccessCtl; - CButton m_AbortPlayCtl; - CButton m_AbortBrowseCtl; - CComboBox m_AbortCtl; - CString m_Abort; - CString m_Success; - CString m_Request; - //}}AFX_DATA - - -// Overrides - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CPropsSounds) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CPropsSounds) - virtual BOOL OnInitDialog(); - afx_msg void OnAbortedBrowse(); - afx_msg void OnFinishedBrowse(); - afx_msg void OnRingBrowse(); - afx_msg void OnAbortedPlay(); - afx_msg void OnFinishedPlay(); - afx_msg void OnRingPlay(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp deleted file mode 100755 index 0c5c19b..0000000 --- a/PumpKINDlg.cpp +++ b/dev/null @@ -1,2178 +0,0 @@ -// PumpKINDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "PumpKINDlg.h" - -#include "ACLTargetCombo.h" -#include "PropsServer.h" -#include "PropsNetwork.h" -#include "PropsSounds.h" -#include "PropsACL.h" -#include "ConfirmRRQDlg.h" -#include "ConfirmWRQDlg.h" -#include "RequestDlg.h" -#include "Resolver.h" -#include "Retrier.h" -#include "Trayer.h" - -#include - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -IMPLEMENT_DYNAMIC(CXferSocket, CAsyncSocket) -IMPLEMENT_DYNAMIC(CWRQSocket, CXferSocket) -IMPLEMENT_DYNAMIC(CRRQSocket, CXferSocket) - -///////////////////////////////////////////////////////////////////////////// -// CAboutDlg dialog used for App About - -class CAboutDlg : public CDialog -{ -public: - CAboutDlg(); - -// Dialog Data - //{{AFX_DATA(CAboutDlg) - enum { IDD = IDD_ABOUTBOX }; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAboutDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - //{{AFX_MSG(CAboutDlg) - afx_msg void OnKlevernet(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) -{ - //{{AFX_DATA_INIT(CAboutDlg) - //}}AFX_DATA_INIT -} - -void CAboutDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAboutDlg) - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) - //{{AFX_MSG_MAP(CAboutDlg) - ON_BN_CLICKED(IDC_KLEVERNET, OnKlevernet) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPumpKINDlg dialog - -CPumpKINDlg::CPumpKINDlg(CWnd* pParent /*=NULL*/) - : CDialog(CPumpKINDlg::IDD, pParent), m_MinSize(0,0) -{ - m_Listener.m_Daddy = this; - - m_bListen = TRUE; - - m_ListenPort = 69; - m_bTFTPSubdirs = TRUE; - m_RRQMode = rrqAlwaysConfirm; - m_WRQMode = wrqAlwaysConfirm; - m_TFTPTimeOut = CTimeSpan(0,0,0,30); - m_RetryTimeOut = CTimeSpan(0,0,0,10); - m_LogLength = 100; - m_SpeakPort = 69; - m_PromptTimeOut=30; - m_bShown=TRUE; - m_bExiting=FALSE; - m_BlockSize=2048; - m_bnw.AssignSound("(bang)",IDR_WAVE_RING,CBellsNWhistles::CBang::bangResource); - m_bnw.AssignSound("(done)",IDR_WAVE_FINISHED,CBellsNWhistles::CBang::bangResource); - m_bnw.AssignSound("(oops)",IDR_WAVE_ABORTED,CBellsNWhistles::CBang::bangResource); - m_bnw.AssignSound("(none)",(int)0,CBellsNWhistles::CBang::bangNone); - m_bnwRequest="(bang)"; m_bnwSuccess="(done)"; - m_bnwAbort="(oops)"; - //{{AFX_DATA_INIT(CPumpKINDlg) - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - m_bmpBack.LoadBitmap(IDB_BACKGROUND); - m_bmpBack.GetBitmap(&m_bitmapBack); - m_Retrier = new CRetrier(this); - ASSERT(m_Retrier); - m_Trayer = new CTrayer(this); - ASSERT(m_Trayer); - /* Ensure we're backwards compatible */ - ASSERT(CPumpKINDlg::rrqGiveAll==0); - ASSERT(CPumpKINDlg::rrqAlwaysConfirm==1); - ASSERT(CPumpKINDlg::rrqDenyAll==2); - ASSERT(CPumpKINDlg::wrqTakeAll==0); - ASSERT(CPumpKINDlg::wrqConfirmIfExists==1); - ASSERT(CPumpKINDlg::wrqAlwaysConfirm==2); - ASSERT(CPumpKINDlg::wrqDenyAll==3); - /* -- */ - LoadSettings(); -} - -void CPumpKINDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPumpKINDlg) - DDX_Control(pDX, ID_HELP, m_HelpCtl); - DDX_Control(pDX, IDC_PUT, m_PutCtl); - DDX_Control(pDX, IDC_GET, m_GetCtl); - DDX_Control(pDX, IDC_EXIT, m_ExitCtl); - DDX_Control(pDX, IDC_LISTENING, m_ListenCtl); - DDX_Control(pDX, IDC_ABORT, m_AbortCtl); - DDX_Control(pDX, IDC_OPTIONS, m_OptionsCtl); - DDX_Control(pDX, IDC_LOG, m_Log); - DDX_Control(pDX, IDC_CONNECTIONS, m_List); - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CPumpKINDlg, CDialog) - //{{AFX_MSG_MAP(CPumpKINDlg) - ON_WM_SYSCOMMAND() - ON_WM_DESTROY() - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_WM_CREATE() - ON_BN_CLICKED(IDC_OPTIONS, OnOptions) - ON_WM_TIMER() - ON_BN_CLICKED(IDC_EXIT, OnExit) - ON_BN_CLICKED(IDC_PUT, OnPut) - ON_BN_CLICKED(IDC_GET, OnGet) - ON_NOTIFY(LVN_DELETEALLITEMS, IDC_CONNECTIONS, OnDeleteallitemsConnections) - ON_NOTIFY(LVN_DELETEITEM, IDC_CONNECTIONS, OnDeleteitemConnections) - ON_NOTIFY(LVN_INSERTITEM, IDC_CONNECTIONS, OnInsertitemConnections) - ON_NOTIFY(LVN_ITEMCHANGED, IDC_CONNECTIONS, OnItemchangedConnections) - ON_BN_CLICKED(IDC_ABORT, OnAbort) - ON_WM_CLOSE() - ON_COMMAND(ID_TRAY_SHOWPUMPKINWINDOW, OnTrayShowpumpkinwindow) - ON_COMMAND(ID_TRAY_LISTEN, OnTrayListen) - ON_COMMAND(ID_TRAY_EXIT, OnTrayExit) - ON_COMMAND(ID_TRAY_ABOUTPUMPKIN, OnTrayAboutpumpkin) - ON_COMMAND(ID_TRAY_FETCHFILE, OnTrayFetchfile) - ON_COMMAND(ID_TRAY_HELP, OnTrayHelp) - ON_COMMAND(ID_TRAY_OPTIONS, OnTrayOptions) - ON_COMMAND(ID_TRAY_SENDFILE, OnTraySendfile) - ON_WM_WINDOWPOSCHANGING() - ON_LBN_SELCHANGE(IDC_LOG, OnSelchangeLog) - ON_COMMAND(ID_TRAY_OPENFILESFOLDER, OnTrayOpenfilesfolder) - ON_WM_DROPFILES() - ON_BN_CLICKED(ID_HELP, OnHelp) - ON_BN_CLICKED(IDC_LISTENING, OnListening) - ON_WM_GETMINMAXINFO() - ON_WM_SIZE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPumpKINDlg message handlers - -BOOL CPumpKINDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - // Add "About..." menu item to system menu. - - // IDM_ABOUTBOX must be in the system command range. - ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); - ASSERT(IDM_ABOUTBOX < 0xF000); - - CMenu* pSysMenu = GetSystemMenu(FALSE); - CString strAboutMenu; - strAboutMenu.LoadString(IDS_ABOUTBOX); - if (!strAboutMenu.IsEmpty()) - { - pSysMenu->AppendMenu(MF_SEPARATOR); - pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); - } - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - VERIFY(m_Retrier->Create(NULL,"PumpKIN-Retrier",WS_CHILD,CRect(0,0,0,0),this,0)); - - m_Images.Create(16,16,TRUE,2,1); - m_iRRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_RRQ)); - m_iWRQ = m_Images.Add(AfxGetApp()->LoadIcon(IDI_WRQ)); - ASSERT(m_iRRQ>=0); - ASSERT(m_iWRQ>=0); - m_List.SetImageList(&m_Images,LVSIL_NORMAL); - m_List.SetImageList(&m_Images,LVSIL_SMALL); - m_List.SetImageList(&m_Images,LVSIL_STATE); - m_List.SetTextColor(RGB(255,255,0)); // Yellow - m_List.SetTextBkColor(RGB(12,167,0)); // Green - m_List.SetBkColor(RGB(12,167,0)); // Green -CRect listrc; - m_List.GetClientRect(&listrc); - m_List.InsertColumn(0,"File",LVCFMT_LEFT,listrc.Width()-((listrc.Width()/7)*3+listrc.Width()*2/7),subitemFile); - m_List.InsertColumn(1,"type",LVCFMT_CENTER,listrc.Width()/7,subitemType); - m_List.InsertColumn(2,"peer",LVCFMT_LEFT,listrc.Width()*2/7,subitemPeer); - m_List.InsertColumn(3,"ACK",LVCFMT_RIGHT,listrc.Width()/7,subitemBytes); - m_List.InsertColumn(4,"tsize",LVCFMT_RIGHT,listrc.Width()/7,subitemTSize); - - LogLine(IDS_LOG_START); - - SetupButtons(); - -CRect wrci, wrco; - GetWindowRect(&wrco); - GetClientRect(&wrci); -CRect brc; - m_GetCtl.GetWindowRect(&brc); ScreenToClient(&brc); - m_rightGapButtons = wrci.right-brc.right; - m_List.GetWindowRect(&brc); ScreenToClient(&brc); - m_rightGapList = wrci.right-brc.right; - m_ListenCtl.GetWindowRect(&brc); ScreenToClient(&brc); - m_bottomGapListen = wrci.bottom-brc.bottom; - m_Log.GetWindowRect(&brc); ScreenToClient(&brc); - m_bottomGapLog = wrci.bottom-brc.bottom; - m_MinSize.cx = wrco.Width(); m_MinSize.cy=wrco.Height(); - -CRect rc, drc; - GetWindowRect(rc); - GetDesktopWindow()->GetWindowRect(drc); - SetWindowPos(NULL,drc.right-6-rc.Width(),6,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER); - - if(m_bShown) - ShowWindow(SW_SHOW); - else - ShowWindow(SW_HIDE); - - m_ListenCtl.SetCheck(m_Listener.m_bListen?1:0); - - // CG: The following block was added by the ToolTips component. - { - // Create the ToolTip control. - m_tooltip.Create(this); - m_tooltip.Activate(TRUE); - - m_tooltip.AddTool(&m_List,IDC_CONNECTIONS); - m_tooltip.AddTool(GetDlgItem(IDC_PUT),IDC_PUT); - m_tooltip.AddTool(GetDlgItem(IDC_GET),IDC_GET); - m_tooltip.AddTool(&m_AbortCtl,IDC_ABORT); - m_tooltip.AddTool(GetDlgItem(IDC_OPTIONS),IDC_OPTIONS); - m_tooltip.AddTool(GetDlgItem(IDC_EXIT),IDC_EXIT); - m_tooltip.AddTool(GetDlgItem(ID_HELP),ID_HELP); - m_tooltip.AddTool(GetDlgItem(IDC_LOG),IDC_LOG); - } - return TRUE; // return TRUE unless you set the focus to a control -} - -void CPumpKINDlg::OnSysCommand(UINT nID, LPARAM lParam) -{ - if ((nID & 0xFFF0) == IDM_ABOUTBOX) - { - CAboutDlg dlgAbout; - dlgAbout.DoModal(); - } - else - { - CDialog::OnSysCommand(nID, lParam); - } -} - -void CPumpKINDlg::OnDestroy() -{ - SaveSettings(); - -NOTIFYICONDATA nid; - memset(&nid,0,sizeof(nid)); - nid.cbSize=sizeof(nid); - nid.hWnd=m_Trayer->m_hWnd; - nid.uID=IDC_TRAYICON; - nid.uFlags=0; - VERIFY(Shell_NotifyIcon(NIM_DELETE,&nid)); - - WinHelp(0L, HELP_QUIT); - CDialog::OnDestroy(); -POSITION p = m_LogTimes.GetStartPosition(); - while(p){ - CTime *t,*tt; - m_LogTimes.GetNextAssoc(p,t,tt); - ASSERT(t && tt && t==tt); - delete t; - } - // *** Abort and cleanup transfers - m_LogTimes.RemoveAll(); -} - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void CPumpKINDlg::OnPaint() -{ - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CPaintDC pDC(this); - CDC bmpDC; - bmpDC.CreateCompatibleDC(&pDC); - bmpDC.SelectObject(&m_bmpBack); - CRect rc; - GetClientRect(&rc); - for(int x=-m_bitmapBack.bmWidth*2/4;xCreate(NULL,"PumpKIN TrayIcon",WS_CHILD,CRect(0,0,0,0),this,0)){ - TRACE0("Failed to create trayer\n"); - return -1; - } - -NOTIFYICONDATA nid; - memset(&nid,0,sizeof(nid)); - nid.cbSize=sizeof(nid); - nid.hWnd=m_Trayer->m_hWnd; - nid.uID=IDC_TRAYICON; - nid.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP; - nid.uCallbackMessage=WM_TRAYICON; - nid.hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME); - // *** Load from resource - strcpy(nid.szTip,"PumpKIN"); - VERIFY(Shell_NotifyIcon(NIM_ADD,&nid)); - - return 0; -} - -void CListenSocket::OnReceive(int nErrorCode) -{ - ASSERT(m_Daddy); - if(nErrorCode){ - m_Daddy->LogLine(IDS_LOG_LISTENRECEIVEERROR); - return; - } -DWORD fionread = 0; - VERIFY(IOCtl(FIONREAD,&fionread)); // *** Do some checking on the value acquired -tftp *tftpRQ = tftp::Allocate(fionread); - ASSERT(tftpRQ); -SOCKADDR_IN sin; - if(!tftpRQ->Receive(this,fionread,&sin)){ - m_Daddy->LogLine(IDS_LOG_LISTENACCEPTERROR); - delete tftpRQ; - return; - } -#ifndef NDEBUG -CString tmp; - tmp.Format("%u - %s - %u\n",tftpRQ->Opcode(),inet_ntoa(sin.sin_addr),sin.sin_port); - TRACE0(tmp); -#endif -POSITION p = m_Daddy->m_Xfers.GetStartPosition(); - while(p){ - SOCKET key; - CXferSocket *sock; - m_Daddy->m_Xfers.GetNextAssoc(p,key,sock); - ASSERT(sock); - if(sock->m_Peer.sin_addr.s_addr==sin.sin_addr.s_addr && sock->m_Peer.sin_port==sin.sin_port){ - TRACE0("Ignoring request which we are already processing\n"); - delete tftpRQ; - return; - } - } - switch(tftpRQ->Opcode()){ - case tftp::opRRQ: - // Read Request - { - CString tmp; - tmp.Format(IDS_LOG_RRQSERVE,tftpRQ->rqFileName(),tftpRQ->rqType(),inet_ntoa(sin.sin_addr)); - m_Daddy->LogLine(tmp); - CRRQSocket *s = new CRRQSocket(m_Daddy,tftpRQ->rqFileName(),tftpRQ->rqType(),&sin); - ASSERT(s); - tftpRQ->GetOptions(&s->m_Options); - if(!s->Create()) - s->Destroy(FALSE); - } - break; - case tftp::opWRQ: - // Write Request - { - CString tmp; - tmp.Format(IDS_LOG_WRQSERVE,tftpRQ->rqFileName(),tftpRQ->rqType(),inet_ntoa(sin.sin_addr)); - m_Daddy->LogLine(tmp); - CWRQSocket *s = new CWRQSocket(m_Daddy,tftpRQ->rqFileName(),tftpRQ->rqType(),&sin); - ASSERT(s); - tftpRQ->GetOptions(&s->m_Options); - if(!s->Create(NULL,NULL)) - s->Destroy(FALSE); - } - break; - default: - m_Daddy->LogLine(IDS_LOG_LISTENOPCODE); - delete tftpRQ; - return; - } - delete tftpRQ; -} - -BOOL tftp::Receive(CAsyncSocket* socket,UINT maxLength,SOCKADDR_IN *sin) -{ - ASSERT(socket); -int saddrLen = sizeof(SOCKADDR_IN); - length = sin ? - socket->ReceiveFrom(udpBase(),maxLength,(SOCKADDR*)sin,&saddrLen) - : - socket->Receive(udpBase(),maxLength) - ; - if(!length) - return FALSE; - if(length==(tftpLength)SOCKET_ERROR) - return FALSE; - return TRUE; -} - -UINT tftp::Opcode() -{ - return REVERSEBYTES(opcode); -} - -CString tftp::rqFileName() -{ - ASSERT(length); - ASSERT(Opcode()==opRRQ || Opcode()==opWRQ); -CString rv; - if(memchr(&data.m_RQ.data,0,length-sizeof(opcode))) - rv = (LPCTSTR)data.m_RQ.data; - return rv; -} - -CString tftp::rqType() -{ - ASSERT(length); - ASSERT(Opcode()==opRRQ || Opcode()==opWRQ); -CString rv; -char *tmp = (char*)memchr(&data.m_RQ.data,0,length-sizeof(opcode)); - if(tmp++) - rv = (LPCTSTR)tmp; - return rv; -} - -UINT tftp::GetOptions(tftp::tftpOptions* ops) -{ - ASSERT(length); - ASSERT(Opcode()==opRRQ || Opcode()==opWRQ || Opcode()==opOACK); - ASSERT(ops); -tftpOptions& o = *ops; -LPSTR base = (LPSTR)&data.m_RQ.data; -UINT basePtr = 0; - if(Opcode()==opRRQ || Opcode()==opWRQ){ - base = (LPSTR)memchr(&data.m_RQ.data,0,length-sizeof(opcode)); - if(!base) - return 0; - base++; - basePtr = (base-(LPSTR)&data.m_RQ.data); - base = (LPSTR)memchr(base,0,length-basePtr); - if(!base) - return 0; - base++; - basePtr = (base-(LPSTR)&data.m_RQ.data); - } - ops->RemoveAll(); -UINT rv = 0; - while(basePtr<(length-sizeof(opcode))){ - CString onam = (LPSTR)&data.m_RQ.data[basePtr]; - basePtr+=onam.GetLength()+1; - CString oval = (LPSTR)&data.m_RQ.data[basePtr]; - basePtr+=oval.GetLength()+1; - onam.MakeLower(); - o[onam]=oval; - rv++; - } - return rv; -} - -tftp::tftp() -{ - length=0; -} - - -void CXferSocket::OnSend(int nErrorCode) -{ - if(nErrorCode){ - ASSERT(m_Daddy); - m_Daddy->LogLine(IDS_LOG_XFERSEND); - return; - } - if(!m_Queue.IsEmpty()){ - tftp *p = m_Queue.GetHead(); - ASSERT(p); - m_Queue.RemoveHead(); - if(!p->Send(this,&m_Peer)){ - ASSERT(m_Daddy); - m_Daddy->LogLine(IDS_LOG_XFERUDPSEND); - } - delete p; - } - DoSelect(); - if(m_Queue.IsEmpty()){ - switch(state){ - case stateDeny: - Destroy(FALSE); - break; - case stateFinish: - Destroy(TRUE); - break; - } - } -} - -BOOL tftp::Send(CAsyncSocket *socket,SOCKADDR_IN* saddr) -{ - ASSERT(socket); -int rv = socket->SendTo(udpBase(),length,(SOCKADDR*)saddr,sizeof(SOCKADDR_IN)); - if(rv!=length) - return FALSE; - return TRUE; -} - -void CXferSocket::DoSelect(BOOL do_select) -{ - if(m_Peer.sin_addr.s_addr!=INADDR_NONE) - AsyncSelect(FD_CLOSE|FD_READ|((m_Queue.IsEmpty()&&!do_select)?0:FD_WRITE)); -} - -void CXferSocket::OnReceive(int nErrorCode) -{ - if(nErrorCode){ - ASSERT(m_Daddy); - m_Daddy->LogLine(IDS_LOG_XFERRECEIVE); - return; - } - ASSERT(m_Daddy); -DWORD fionread = 0; - VERIFY(IOCtl(FIONREAD,&fionread)); -tftp *p = tftp::Allocate(fionread); - ASSERT(p); -SOCKADDR_IN sin; - if(!p->Receive(this,fionread,&sin)){ - m_Daddy->LogLine(IDS_LOG_XFERUDPRECEIVE); - delete p; - return; - }else - if(m_Peer.sin_addr.s_addr==INADDR_NONE){ - m_Peer.sin_addr=sin.sin_addr; - m_Peer.sin_port=sin.sin_port; - } -BOOL alive = TRUE; - if(state==stateInit){ - state=stateXfer; - m_Peer.sin_port=sin.sin_port; - UpdateList(); - } - if(sin.sin_addr.s_addr!=m_Peer.sin_addr.s_addr || sin.sin_port!=m_Peer.sin_port){ - m_Daddy->LogLine(IDS_LOG_XFERSOURCETID); - // *** Bounce it! - }else{ - alive = OnTFTP(p); - } - delete p; - if(alive){ - DoSelect(); - ResetTimeout(); - } -} - -void CXferSocket::SetPeer(SOCKADDR_IN *sin) -{ - ASSERT(sin); - memmove(&m_Peer,sin,sizeof(m_Peer)); -} - -void CXferSocket::UpdateList() -{ - ASSERT(m_Daddy); -LV_FINDINFO lvf; - memset(&lvf,0,sizeof(lvf)); - lvf.flags=LVFI_PARAM; - lvf.lParam=(LPARAM)this; -int i = m_Daddy->m_List.FindItem(&lvf); - if(i<0){ - ASSERT(IsKindOf(RUNTIME_CLASS(CRRQSocket)) || IsKindOf(RUNTIME_CLASS(CWRQSocket))); - i=m_Daddy->m_List.InsertItem(0,m_FileName,IsKindOf(RUNTIME_CLASS(CRRQSocket))?m_Daddy->m_iRRQ:m_Daddy->m_iWRQ); - ASSERT(!(i<0)); - m_Daddy->m_List.SetItemData(i,(DWORD)this); - } - m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemFile,m_FileName); - m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemType,m_Type); - m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemPeer,inet_ntoa(m_Peer.sin_addr)); -CString tmp; - tmp.Format(IDS_FMT_BYTES,GetACK()); - m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemBytes,tmp); - if(m_xferSize>=0){ - tmp.Format(IDS_FMT_BYTES,m_xferSize); - m_Daddy->m_List.SetItemText(i,CPumpKINDlg::subitemTSize,tmp); - } -} - -CXferSocket::CXferSocket() - : m_wndResolver(NULL), m_Retry(NULL), m_bRetry(FALSE), - m_blkSize(512), m_timeOut(30), m_xferSize(-1), - m__blkSize(512), m__timeOut(30) -{ - m_Daddy=NULL; - m_Peer.sin_addr.s_addr=INADDR_NONE; - m_Peer.sin_family=AF_INET; - state=stateNone; -} - -ULONG CXferSocket::GetACK() -{ - return 0; -} - -CXferSocket::CXferSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN* sin) - : m_wndResolver(NULL), m_Retry(NULL), m_bRetry(FALSE), - m_blkSize(512), m_timeOut(30), m_xferSize(-1), - m__blkSize(512), m__timeOut(30) -{ - m_Peer.sin_family=AF_INET; - state=stateNone; - ASSERT(daddy); - m_Daddy=daddy; - m_timeOut=m__timeOut=m_Daddy->m_TFTPTimeOut.GetTotalSeconds(); - if(sin){ - m_Peer.sin_addr.s_addr=sin->sin_addr.s_addr; - m_Peer.sin_port=sin->sin_port; - }else - m_Peer.sin_addr.s_addr=INADDR_NONE; - m_FileName=fileName; - m_Type=type; -} - -BOOL CRRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) -{ - if(!CAsyncSocket::Create(0,SOCK_DGRAM)) - return FALSE; - ASSERT(m_Daddy); - ASSERT(m_Peer.sin_addr.s_addr!=INADDR_NONE || hostName); - m_Daddy->m_Xfers[m_hSocket]=this; -CString lFile = localFile?localFile:m_FileName; - TurnSlashes(lFile,TRUE); - UpdateList(); - if(!localFile){ // Check only for incoming requests - if(CheckBadRelativeness(m_FileName)){ - Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); - return TRUE; - } - int atar=m_Daddy->m_aclRules.FindTarget(acl_rule::opRRQ,m_Peer.sin_addr.s_addr); - if(atar<0) - atar = m_Daddy->m_RRQMode; - switch(atar){ - case CPumpKINDlg::rrqGiveAll: - break; - case CPumpKINDlg::rrqAlwaysConfirm: - if(ConfirmRequest()) - break; - default: - TRACE1("Unexpected access target: %d\n",atar); - case CPumpKINDlg::rrqDenyAll: - Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); - return TRUE; - } - } -CString fn = localFile?ApplyRootGently(lFile):ApplyRoot(lFile); -CFileException e; - if(!m_File.Open(fn,CFile::modeRead|CFile::shareDenyWrite,&e)){ - if(localFile){ - CString tmp; - tmp.Format(IDS_LOG_FAILEDLOCALFILE,fn); - m_Daddy->LogLine(tmp); - return FALSE; - } - Deny(&e); - return TRUE; - } - m_xferSize=m_File.GetLength(); // *** HANDLE EXCEPTION - if(hostName){ - m_HostName=hostName; - - CString tmp; - tmp.Format(IDS_LOG_SENDING,m_FileName,m_HostName); - m_Daddy->LogLine(tmp); - - CString inAddr = hostName; - int at = inAddr.Find('@'); - if(at>=0) - inAddr=inAddr.Mid(at+1); - if((m_Peer.sin_addr.s_addr=inet_addr((LPCTSTR)inAddr))==INADDR_NONE){ - ASSERT(!m_wndResolver); - m_wndResolver = new CResolver(this); - ASSERT(m_wndResolver); - return m_wndResolver->Resolve(); - } - else - OnHostKnown(); - }else{ - tftp::tftpOptions o; - CString v; - if(m_Options.Lookup(tftpoBSize,v)){ - m__blkSize=atoi(v); - if(m__blkSize){ - m_blkSize=m__blkSize; - v.Format("%u",m_blkSize); - o[tftpoBSize]=v; - } - } - if(m_Options.Lookup(tftpoTSize,v)){ - v.Format("%lu",m_xferSize); - o[tftpoTSize]=v; - } - if(m_Options.Lookup(tftpoTOut,v)){ - m__timeOut=atoi(v); - if(m__timeOut){ - m_timeOut=m__timeOut; - v.Format("%u",m_timeOut); - o[tftpoTOut]=v; - } - } - // XXX: see if we can enforce our preference regarding block size here. - if(m_xferSize >= (m_blkSize<<16)) { - Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG); - return TRUE; - } - state = stateXfer; - m_ACK=0; - if(o.GetCount()){ - tftp *p = tftp::Allocate(tftp::tftpOACK::tftpSize(&o)); - ASSERT(p); - p->SetOpcode(tftp::opOACK); - p->data.m_OACK.Set(&o); - PostTFTP(p,TRUE); - }else - DoXfer(); - } - return TRUE; -} - -CRRQSocket::CRRQSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) - : CXferSocket(daddy,fileName,type,sin) -{ - m_ACK=0; - m_LastSlack=0; -} - -UINT tftp::tftpERROR::tftpSize(LPCTSTR msg) -{ - return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpERROR::tftpErrorCode)+strlen(msg)+1; -} - -tftp* tftp::Allocate(UINT tftpSize) -{ - ASSERT(tftpSize); -tftp* rv = (tftp*) new BYTE[tftpSlackSize+tftpSize]; - ASSERT(rv); - rv->length=tftpSize; - return rv; -} - -void tftp::errSet(UINT code,LPCTSTR msg) -{ - ASSERT(this); - ASSERT(length>=data.m_ERROR.tftpSize(msg)); - strcpy((char*)data.m_ERROR.data,msg); - data.m_ERROR.SetCode(code); -} - -void CXferSocket::PostTFTP(tftp* p,BOOL retryable) -{ - ASSERT(p); - m_Queue.AddTail(p); - DoSelect(); - if(!m_bRetry){ - if(retryable) - SetTry(p); - else - SetTry(); - } - ResetTimeout(); -} - -void CXferSocket::Deny(UINT errCode,UINT errID) -{ - PostError(errCode,errID); - state=stateDeny; -} - -void CRRQSocket::DoXfer() -{ -tftp *p = tftp::Allocate(tftp::tftpDATA::tftpSize(m_blkSize)); - ASSERT(p); - p->SetOpcode(tftp::opDATA); - TRY{ - m_File.Seek(m_ACK*m_blkSize,CFile::begin); - int bytes = m_File.Read(p->data.m_DATA.data,m_blkSize); - p->data.m_DATA.SetBlock(m_ACK+1); - p->length=p->length-m_blkSize+bytes; - m_LastSlack = m_blkSize-bytes; - PostTFTP(p); - if(bytesLogLine(tmp); -tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg)); -err->SetOpcode(tftp::opERROR); - err->errSet(errCode,msg); - PostTFTP(err); -} - -void CXferSocket::PostError(CFileException* e) -{ -UINT eCode; -UINT eMsgID; - switch(e->m_cause){ - case CFileException::fileNotFound: - eCode=tftp::errNotFound; - eMsgID=IDS_TFTP_ERROR_NOTFOUND; - break; - case CFileException::accessDenied: - eCode=tftp::errAccessViolation; - eMsgID=IDS_TFTP_ERROR_ACCESS; - break; - case CFileException::directoryFull: - eCode=tftp::errDiskFull; - eMsgID=IDS_TFTP_ERROR_DIRFULL; - break; - case CFileException::sharingViolation: - eCode=tftp::errAccessViolation; - eMsgID=IDS_TFTP_ERROR_SHARING; - break; - case CFileException::diskFull: - eCode=tftp::errDiskFull; - eMsgID=IDS_TFTP_ERROR_DISKFULL; - break; - default: - eCode=tftp::errUndefined; - eMsgID=IDS_TFTP_ERROR_UNDEFINED; - break; - } - PostError(eCode,eMsgID); -} - -ULONG CRRQSocket::GetACK(void) -{ - return (m_ACK*m_blkSize)-m_LastSlack; -} - -BOOL CRRQSocket::OnTFTP(tftp* p) -{ -BOOL rv = TRUE; - switch(p->Opcode()){ - case tftp::opOACK: - { - m_ACK=0; - ASSERT(state!=stateFinish); - tftp::tftpOptions o; - if(p->GetOptions(&o)){ - CString v; - if(o.Lookup(tftpoBSize,v)){ - m_blkSize=atoi(v); - if(!m_blkSize){ // *** More sanity checks - Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); - rv = TRUE; - break; - } - } - if(o.Lookup(tftpoTOut,v)){ - m_timeOut=atoi(v); - if(!m_timeOut){ // *** More sanity checks - Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); - rv = TRUE; - break; - } - } - if(o.Lookup(tftpoXResume,v)){ - m_ACK=atoi(v); - } - } - UpdateList(); - DoXfer(); - } - break; - case tftp::opACK: - m_ACK=p->data.m_ACK.Block(); - if(state==stateClosing && m_ACK==m_ACKtoClose) { - state = stateFinish; - ASSERT(m_Daddy); - CString tmp; - tmp.Format(IDS_LOG_XFERRRQFINISHED,(LPCTSTR)m_FileName); - m_Daddy->LogLine(tmp); - rv = FALSE; - DoSelect(TRUE); - }else if(state!=stateFinish){ - UpdateList(); - DoXfer(); - } - break; - case tftp::opERROR: - { - ASSERT(m_Daddy); - CString tmp; - tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); - m_Daddy->LogLine(tmp); - } - Destroy(FALSE); - rv = FALSE; - break; - default: - { - ASSERT(m_Daddy); - CString tmp; - tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); - m_Daddy->LogLine(tmp); - // *** Self destruct maybe?? - } - break; - } - return rv; -} - -BOOL CWRQSocket::OnTFTP(tftp* p) -{ - switch(p->Opcode()){ - case tftp::opOACK: - ASSERT(state!=stateFinish); - { - if(m_bResume) - m_ACK=m_File.GetLength()/m_blkSize; - else - m_ACK=0; - tftp::tftpOptions o; - if(p->GetOptions(&o)){ - CString v; - if(o.Lookup(tftpoBSize,v)){ - m_blkSize=atoi(v); - if(!m_blkSize){ // *** More sanity checks - Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); - return TRUE; - } - } - if(o.Lookup(tftpoTOut,v)){ - m_timeOut=atoi(v); - if(!m_timeOut){ // *** More sanity checks - Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); - return TRUE; - } - } - if(o.Lookup(tftpoTSize,v)){ - m_xferSize=atoi(v); - } - if(m_xferSize>=0 && m_xferSize>=(m_blkSize<<16)) { - Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG); - return TRUE; - } - } - UpdateList(); - DoXfer(); - } - break; - case tftp::opDATA: - { - UINT block = p->data.m_DATA.Block(); - TRY{ - m_File.Seek((block-1)*m_blkSize,CFile::begin); - int bytes = p->length-sizeof(p->data.m_DATA.block)-(tftpHdrSize-tftpSlackSize); - if(bytes){ - m_File.Write(p->data.m_DATA.data,bytes); - // *** Move to the other place where we can do it not that often - m_File.SetLength(m_File.GetPosition()); - } - if(bytesLogLine(tmp); - } - m_ACK=block; - m_LastSlack=m_blkSize-bytes; - UpdateList(); - DoXfer(); - }CATCH(CFileException,e){ - Deny(e); - }END_CATCH - } - break; - case tftp::opERROR: - { - ASSERT(m_Daddy); - CString tmp; - tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); - m_Daddy->LogLine(tmp); - } - Destroy(FALSE); - return FALSE; - default: - { - ASSERT(m_Daddy); - CString tmp; - tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); - m_Daddy->LogLine(tmp); - // *** Self destruct maybe?? - } - break; - } - return TRUE; -} - -void tftp::SetOpcode(WORD op) -{ - opcode = REVERSEBYTES(op); -} -void tftp::tftpDATA::SetBlock(WORD b) -{ - block=REVERSEBYTES(b); -} -WORD tftp::tftpDATA::Block() -{ - return REVERSEBYTES(block); -} -WORD tftp::tftpACK::Block() -{ - return REVERSEBYTES(block); -} -void tftp::tftpACK::SetBlock(WORD b) -{ - block = REVERSEBYTES(b); -} -WORD tftp::tftpERROR::Code() -{ - return REVERSEBYTES(code); -} -void tftp::tftpERROR::SetCode(WORD c) -{ - code = REVERSEBYTES(c); -} - - -CString tftp::errMessage() -{ -CString rv; - if(memchr(data.m_ERROR.data,0,length-(tftpHdrSize-tftpSlackSize)-sizeof(data.m_ERROR.code))) - rv = (LPCTSTR)data.m_ERROR.data; - return rv; -} - -void CXferSocket::Destroy(BOOL success) -{ - if(m_wndResolver){ - delete m_wndResolver; - m_wndResolver=NULL; - } - SetTry(); - m_Daddy->m_bnw.StartSound( - success - ? m_Daddy->m_bnwSuccess - : m_Daddy->m_bnwAbort - ); - if(m_File.m_hFile!=CFile::hFileNull){ - TRY{ - m_File.Close(); - }CATCH(CFileException,e){ - TRACE0("Error closing file\n"); - }END_CATCH - } - ASSERT(m_Daddy); - m_Daddy->KillTimer(m_hSocket); - m_Daddy->m_Xfers.RemoveKey(m_hSocket); -LV_FINDINFO lvf; - memset(&lvf,0,sizeof(lvf)); - lvf.flags=LVFI_PARAM; - lvf.lParam=(LPARAM)this; -int i = m_Daddy->m_List.FindItem(&lvf); - if(i>=0) - m_Daddy->m_List.DeleteItem(i); - delete this; -} - -void CPumpKINDlg::LogLineToScreen(LPCTSTR str) -{ - ASSERT(m_LogLength); - while(m_Log.GetCount()>m_LogLength && m_Log.GetCount()!=LB_ERR){ - CTime *t = (CTime*)m_Log.GetItemData(0); - if(((DWORD)t)!=LB_ERR){ - ASSERT(t); - m_LogTimes.RemoveKey(t); - delete t; - } - m_Log.DeleteString(0); - } -int i = m_Log.AddString(str); - ASSERT(i!=LB_ERR); -CTime *t = new CTime(CTime::GetCurrentTime()); - m_Log.SetItemData(i,(DWORD)(m_LogTimes[t]=t)); - m_Log.SetCurSel(i); -} - -void CPumpKINDlg::LogLine(UINT msgID) -{ -CString tmp; - tmp.Format(msgID); - LogLine(tmp); -} - -void CXferSocket::TurnSlashes(CString& fn,BOOL bBack) -{ -int s = fn.Find(bBack?'/':'\\'); - while(s>=0){ - fn.SetAt(s,bBack?'\\':'/'); - s = fn.Find(bBack?'/':'\\'); - } -} - -CString CXferSocket::ApplyRoot(LPCTSTR fileName) -{ - ASSERT(m_Daddy); -CString fn = fileName; -CString rv = m_Daddy->m_TFTPRoot; - if(rv.IsEmpty()) - rv = "."; - if(rv[rv.GetLength()-1]!='\\') - rv+="\\"; - while((!fn.IsEmpty()) && fn[0]=='\\') - fn=fn.Mid(1); - rv+=fn; - return rv; -} - -void CPumpKINDlg::OnOptions() -{ -CPropertySheet cps(IDS_TITLE_OPTIONS,this); -CPropsServer server; -CPropsNetwork network; -CPropsSounds sounds; -CPropsACL acl; - - server.m_RRQMode=m_RRQMode; - server.m_TFTPRoot=m_TFTPRoot; - server.m_TFTPSubdirs=m_bTFTPSubdirs; - server.m_WRQMode=m_WRQMode; - server.m_PromptTimeOut=m_PromptTimeOut; - server.m_LogFile=m_LogFile; - - network.m_ListenPort=m_ListenPort; - network.m_ListenAddress=m_ListenAddress; - network.m_SpeakPort=m_SpeakPort; - network.m_TimeOut=m_TFTPTimeOut.GetTotalSeconds(); - network.m_BlockSize=m_BlockSize; - - sounds.m_Request = m_bnwRequest; - sounds.m_Success = m_bnwSuccess; - sounds.m_Abort = m_bnwAbort; - - acl.m_rulist = m_aclRules; - - cps.AddPage(&server); - cps.AddPage(&network); - cps.AddPage(&sounds); - cps.AddPage(&acl); - if(cps.DoModal()==IDOK){ - m_RRQMode=server.m_RRQMode; - m_TFTPRoot=server.m_TFTPRoot; - m_bTFTPSubdirs=server.m_TFTPSubdirs; - m_WRQMode=server.m_WRQMode; - m_PromptTimeOut=server.m_PromptTimeOut; - m_LogFile=server.m_LogFile; - - m_ListenPort=network.m_ListenPort; - m_ListenAddress=network.m_ListenAddress; - m_SpeakPort=network.m_SpeakPort; - m_TFTPTimeOut=CTimeSpan(network.m_TimeOut); - m_BlockSize=network.m_BlockSize; - - m_bnwRequest = sounds.m_Request; - m_bnwSuccess = sounds.m_Success; - m_bnwAbort = sounds.m_Abort; - - m_aclRules = acl.m_rulist; - - m_lastlogerr.Empty(); - } -} - -BOOL CRRQSocket::ConfirmRequest() -{ -CConfirmRRQDlg cd(NULL); - cd.m_Daddy=this; - cd.m_File=m_FileName; - cd.m_Host=inet_ntoa(m_Peer.sin_addr); - if(cd.DoModal()==IDOK) - return TRUE; - return FALSE; -} - -CWRQSocket::CWRQSocket(CPumpKINDlg* daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) - : CXferSocket(daddy,fileName,type,sin) -{ - state=stateNone; - m_ACK=0; - m_LastSlack=0; - m_bResume=FALSE; -} - -BOOL CWRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) -{ - if(!CAsyncSocket::Create(0,SOCK_DGRAM)) - return FALSE; - ASSERT(m_Daddy); - ASSERT(m_Peer.sin_addr.s_addr!=INADDR_NONE || hostName); - m_Daddy->m_Xfers[m_hSocket]=this; - UpdateList(); -CString lf; - if(!localFile) { - lf = m_FileName; - TurnSlashes(lf,TRUE); - } -CString fn = localFile?ApplyRootGently(localFile):ApplyRoot(lf); - if(!localFile){ // This is an incoming request.. - if(CheckBadRelativeness(m_FileName)){ - Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); - return TRUE; - } - BOOL exists; - if(!_access((LPCTSTR)fn,0)) - m_Rename=exists=TRUE; - else - m_Rename=exists=FALSE; - int atar=m_Daddy->m_aclRules.FindTarget(acl_rule::opWRQ,m_Peer.sin_addr.s_addr); - if(atar<0) - atar=m_Daddy->m_WRQMode; - switch(atar){ - case CPumpKINDlg::wrqTakeAll: - if(exists){ - if(!RenameFile(fn)){ - Deny(tftp::errDiskFull,IDS_TFTP_ERROR_FAILEDTORENAME); - return TRUE; - } - } - break; - case CPumpKINDlg::wrqConfirmIfExists: - if(!exists) - break; - case CPumpKINDlg::wrqAlwaysConfirm: - if(exists) - m_bResume=TRUE; - if(ConfirmRequest()){ - if(m_Rename){ - RenameFile(fn); - if(SaveAs(fn)) - break; - }else - break; - } - default: - TRACE1("Unexpected access target: %d\n",atar); - case CPumpKINDlg::wrqDenyAll: - Deny(tftp::errAccessViolation,IDS_TFTP_ERROR_ACCESS); - return TRUE; - } - } -CFileException e; - if(!m_File.Open( - fn, - m_bResume - ?(CFile::modeWrite|CFile::shareDenyWrite) - :(CFile::modeCreate|CFile::modeWrite|CFile::shareDenyWrite), - &e - )){ - if(localFile){ // Outgoing request - CString tmp; - tmp.Format(IDS_LOG_FAILEDTOOPEN,fn); - m_Daddy->LogLine(tmp); - return FALSE; - }else{ - Deny(&e); - return TRUE; - } - } - if(hostName){ - m_HostName=hostName; - - CString tmp; - tmp.Format(IDS_LOG_REQUESTING,m_FileName,m_HostName); - m_Daddy->LogLine(tmp); - - CString inAddr = hostName; - int at = inAddr.Find('@'); - if(at>=0) - inAddr=inAddr.Mid(at+1); - if((m_Peer.sin_addr.s_addr=inet_addr((LPCTSTR)inAddr))==INADDR_NONE){ - ASSERT(!m_wndResolver); - m_wndResolver = new CResolver(this); - ASSERT(m_wndResolver); - return m_wndResolver->Resolve(); - }else{ - OnHostKnown(); - return TRUE; - } - } -CString v; -tftp::tftpOptions oack; - if(m_Options.Lookup(tftpoTSize,v)){ - m_xferSize=atol(v); - if(!m_xferSize){ - Deny(tftp::errOption,IDS_TFTP_ERROR_TSIZE); - return TRUE; - } - } - if(m_Options.Lookup(tftpoBSize,v)){ - m_blkSize=atoi(v); - if(!m_blkSize){ // *** Do more about sanity check - Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); - return TRUE; - } - v.Format("%u",m_blkSize); - oack[tftpoBSize]=v; - } - if(m_Options.Lookup(tftpoTOut,v)){ - m_timeOut=atoi(v); - if(!m_timeOut){ // *** Do more about sanity check - Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); - return TRUE; - } - v.Format("%u",m_timeOut); - oack[tftpoTOut]=v; - } - if(m_Options.Lookup(tftpoXResume,v) && m_bResume){ - m_ACK=m_File.GetLength()/m_blkSize; - v.Format("%u",m_ACK); - oack[tftpoXResume]=v; - }else - m_ACK=0; - // XXX: see if we can negotiate the right block size somehow - if(m_xferSize>=0 && m_xferSize>=(m_blkSize<<16)) { - Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG); - return TRUE; - } - state=stateXfer; - if(oack.GetCount()){ - tftp *p = tftp::Allocate(tftp::tftpOACK::tftpSize(&oack)); - ASSERT(p); - p->SetOpcode(tftp::opOACK); - p->data.m_OACK.Set(&oack); - PostTFTP(p,TRUE); - }else - DoXfer(); - return TRUE; -} - -BOOL CWRQSocket::ConfirmRequest() -{ -CConfirmWRQDlg cd(NULL); - cd.m_Daddy=this; - cd.m_File=m_FileName; - cd.m_Host=inet_ntoa(m_Peer.sin_addr); - switch(cd.DoModal()){ - case IDOK: - m_Rename=FALSE; - m_bResume=FALSE; - return TRUE; - case IDC_RENAME: - m_bResume=FALSE; - m_Rename=TRUE; - return TRUE; - case IDC_RESUME: - m_Rename=FALSE; - m_bResume=TRUE; - return TRUE; - case IDCANCEL: - return FALSE; - } - return FALSE; -} - -BOOL CWRQSocket::RenameFile(CString& fn) -{ -CString renamed = fn; - if(fn.IsEmpty()) - return FALSE; - if(fn[fn.GetLength()-1]==')'){ - int op = fn.ReverseFind('('); - if(op>0 && fn[op-1]==' '){ - if(fn.Mid(op+1,fn.GetLength()-op-2).SpanExcluding("0123456789").IsEmpty()) - renamed = renamed.Left(op-1); - } - } -CString testFN; - for(UINT tmp=0;tmp<32768;tmp++){ - testFN.Format("%s (%u)",(LPCTSTR)renamed,tmp); - if(!_access((LPCTSTR)testFN,0)) - continue; - fn=testFN; - return TRUE; - } - return FALSE; -} - -BOOL CWRQSocket::SaveAs(CString& fn) -{ -CFileDialog cfd(FALSE,NULL,fn,OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,NULL,m_Daddy); -CString title; - title.LoadString(IDS_RENAME_TITLE); - cfd.m_ofn.lpstrTitle=(LPCTSTR)title; - if(cfd.DoModal()!=IDOK) - return FALSE; - fn = cfd.GetPathName(); - return TRUE; -} - -void CWRQSocket::DoXfer() -{ -tftp *p = tftp::Allocate(tftp::tftpACK::tftpSize()); - ASSERT(p); - p->SetOpcode(tftp::opACK); - p->data.m_ACK.SetBlock(m_ACK); - TRACE1("WRQ-ACK-%u\n",m_ACK); - PostTFTP(p,TRUE); // *** ??? Hope this is right -} - -UINT tftp::tftpACK::tftpSize() -{ - return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpACK); -} - -ULONG CWRQSocket::GetACK() -{ - return (m_ACK*m_blkSize)-m_LastSlack; -} - -void CXferSocket::ResetTimeout() -{ - ASSERT(m_Daddy); - m_Daddy->m_Retrier->KillTimer(m_hSocket); - if(m_Retry) - m_Daddy->m_Retrier->SetTimer(m_hSocket,min(60,m_Daddy->m_RetryTimeOut.GetTotalSeconds())*1000,NULL); - if(!m_bRetry){ - m_Daddy->KillTimer(m_hSocket); - m_Daddy->SetTimer(m_hSocket,min(60,m_timeOut)*1000,NULL); - } -} - -void CXferSocket::Abort() -{ - ASSERT(m_Daddy); -CString tmp; - tmp.Format(IDS_LOG_XFERABORTED,(LPCTSTR)m_FileName); - m_Daddy->LogLine(tmp); - Destroy(FALSE); -} - -void CPumpKINDlg::OnTimer(UINT nIDEvent) -{ -CXferSocket *socket; - if(m_Xfers.Lookup(nIDEvent,socket)){ - CString tmp; - tmp.Format(IDS_LOG_TIMEDOUT,socket->m_FileName); - LogLine(tmp); - socket->Abort(); - }else{ - TRACE0("Failed to find timed out socket!\n"); - } - CDialog::OnTimer(nIDEvent); -} - -void CPumpKINDlg::OnExit() -{ - if(!m_Xfers.IsEmpty()){ - CString title,text; - title.LoadString(IDS_CONFIRMEXIT_TITLE); - text.LoadString(IDS_CONFIRMEXIT_TEXT); - if(MessageBox(text,title,MB_ICONQUESTION|MB_YESNO)!=IDYES) - return; - } - m_bExiting=TRUE; - EndDialog(IDOK); -} - -void CPumpKINDlg::OnPut() -{ -CRequestDlg crd(NULL); - crd.m_Put=TRUE; - crd.m_BSize=m_BlockSize; - if(crd.DoModal()==IDOK){ - CRRQSocket *socket = new CRRQSocket(this,crd.m_RemoteFile,crd.m_Type,NULL); - if(crd.m_BSize) - socket->m__blkSize=crd.m_BSize; - if(!socket->Create(crd.m_LocalFile,crd.m_Host)) - socket->Destroy(); - } -} - -void CPumpKINDlg::OnGet() -{ -CRequestDlg crd(NULL); - crd.m_Put=FALSE; - crd.m_BSize=m_BlockSize; - if(crd.DoModal()==IDOK){ - CWRQSocket *socket = new CWRQSocket(this,crd.m_RemoteFile,crd.m_Type,NULL); - if(crd.m_BSize) - socket->m__blkSize=crd.m_BSize; - if(!socket->Create(crd.m_LocalFile,crd.m_Host)) - socket->Destroy(); - } -} - -void CPumpKINDlg::SetupButtons() -{ - m_AbortCtl.EnableWindow(m_List.GetSelectedCount()>0); -} - -void CPumpKINDlg::OnDeleteallitemsConnections(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; - SetupButtons(); - *pResult = 0; -} - -void CPumpKINDlg::OnDeleteitemConnections(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; - SetupButtons(); - *pResult = 0; -} - -void CPumpKINDlg::OnInsertitemConnections(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; - SetupButtons(); - *pResult = 0; -} - -void CPumpKINDlg::OnItemchangedConnections(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; - SetupButtons(); - *pResult = 0; -} - -void CPumpKINDlg::OnAbort() -{ - if(!m_List.GetSelectedCount()) - return; -int items = m_List.GetItemCount(); - for(int tmp=0;tmpAbort(); - } -} - -void CXferSocket::OnFailedToResolve() -{ - TRACE0("Resolve failed\n"); - delete m_wndResolver; - m_wndResolver=NULL; - ASSERT(m_Daddy); -CString tmp; - tmp.Format(IDS_LOG_RESOLVEFAILED,m_HostName); - m_Daddy->LogLine(tmp); - Abort(); -} - -void CXferSocket::OnResolved() -{ - delete m_wndResolver; - m_wndResolver=NULL; - TRACE0("Resolved\n"); - m_Peer.sin_addr.s_addr = *(DWORD*)(((hostent*)m_ResolveBuff)->h_addr); -} - -void CRRQSocket::OnResolved() -{ - CXferSocket::OnResolved(); - OnHostKnown(); -} - -void CRRQSocket::OnHostKnown() -{ - ASSERT(m_Daddy); - m_Peer.sin_port=htons(m_Daddy->m_SpeakPort); -tftp::tftpOptions o; -CString v; - ASSERT(m_xferSize>=0); - v.Format("%lu",m_xferSize); - o[tftpoTSize] = v; - ASSERT(m__blkSize); - v.Format("%u",m__blkSize); - o[tftpoBSize] = v; - ASSERT(m__timeOut); - v.Format("%u",m__timeOut); - o[tftpoTOut] = v; - o[tftpoXResume] = "0"; -tftp *p = tftp::Allocate(tftp::tftpWRQ::tftpSize(m_FileName,m_Type,&o)); - ASSERT(p); - p->SetOpcode(tftp::opWRQ); - p->data.m_WRQ.Set(m_FileName,m_Type,&o); - PostTFTP(p,TRUE); - state=stateInit; - UpdateList(); -} - -UINT tftp::tftpRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) -{ -UINT rv = tftpHdrSize-tftpSlackSize+strlen(file)+1+strlen(type)+1; - if(ops){ - tftpOptions& o = *ops; - POSITION p = o.GetStartPosition(); - while(p){ - CString n,v; - o.GetNextAssoc(p,n,v); - rv+=n.GetLength()+1+v.GetLength()+1; - } - } - return rv; -} -UINT tftp::tftpRRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) -{ - return tftp::tftpRQ::tftpSize(file,type,ops); -} -UINT tftp::tftpWRQ::tftpSize(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) -{ - return tftp::tftpRQ::tftpSize(file,type,ops); -} -UINT tftp::tftpOACK::tftpSize(tftp::tftpOptions* ops) -{ -UINT rv = tftpHdrSize-tftpSlackSize; - if(ops){ - tftpOptions& o = *ops; - POSITION p = o.GetStartPosition(); - while(p){ - CString n,v; - o.GetNextAssoc(p,n,v); - rv+=n.GetLength()+1+v.GetLength()+1; - } - } - return rv; -} -void tftp::tftpRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) -{ - // MAY BE DANGEROUS! -UINT ptr = 0; - strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; - strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; - if(ops){ - tftpOptions& o = *ops; - POSITION p = o.GetStartPosition(); - while(p){ - CString n,v; - o.GetNextAssoc(p,n,v); - strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; - strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; - } - } -} -void tftp::tftpRRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) -{ - // MAY BE DANGEROUS! -UINT ptr = 0; - strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; - strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; - if(ops){ - tftpOptions& o = *ops; - POSITION p = o.GetStartPosition(); - while(p){ - CString n,v; - o.GetNextAssoc(p,n,v); - strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; - strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; - } - } -} -void tftp::tftpWRQ::Set(LPCTSTR file,LPCTSTR type,tftp::tftpOptions* ops) -{ - // MAY BE DANGEROUS! -UINT ptr = 0; - strcpy((LPTSTR)&data[ptr],file); ptr+=strlen(file)+1; - strcpy((LPTSTR)&data[ptr],type); ptr+=strlen(type)+1; - if(ops){ - tftpOptions& o = *ops; - POSITION p = o.GetStartPosition(); - while(p){ - CString n,v; - o.GetNextAssoc(p,n,v); - strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; - strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; - } - } -} -void tftp::tftpOACK::Set(tftpOptions* ops) -{ - ASSERT(ops); -UINT ptr = 0; -tftpOptions& o = *ops; -POSITION p = o.GetStartPosition(); - while(p){ - CString n,v; - o.GetNextAssoc(p,n,v); - strcpy((LPTSTR)&data[ptr],(LPCTSTR)n); ptr+=n.GetLength()+1; - strcpy((LPTSTR)&data[ptr],(LPCTSTR)v); ptr+=v.GetLength()+1; - } -} - -void CWRQSocket::OnResolved() -{ - CXferSocket::OnResolved(); - OnHostKnown(); -} - -void CWRQSocket::OnHostKnown() -{ - ASSERT(m_Daddy); - m_Peer.sin_port=htons(m_Daddy->m_SpeakPort); -tftp::tftpOptions o; -CString v; - o[tftpoTSize]="0"; - if(m__blkSize){ - v.Format("%u",m__blkSize); - o[tftpoBSize]=v; - } - if(m__timeOut){ - v.Format("%u",m__timeOut); - o[tftpoTOut]=v; - } -tftp *p = tftp::Allocate(tftp::tftpRRQ::tftpSize(m_FileName,m_Type,&o)); - ASSERT(p); - p->SetOpcode(tftp::opRRQ); - p->data.m_RRQ.Set(m_FileName,m_Type,&o); - PostTFTP(p,TRUE); - state=stateInit; - UpdateList(); -} - -void CPumpKINDlg::OnClose() -{ - OnTrayShowpumpkinwindow(); -} - -void CPumpKINDlg::OnTrayShowpumpkinwindow() -{ - if(IsWindowVisible()){ - m_bShown=FALSE; - ShowWindow(SW_HIDE); - }else{ - m_bShown=TRUE; - ShowWindow(SW_SHOW); - SetForegroundWindow(); - SetFocus(); - } -} - -void CPumpKINDlg::OnTrayExit() -{ - OnExit(); -} - -void CPumpKINDlg::OnTrayAboutpumpkin() -{ -CAboutDlg dlgAbout; - dlgAbout.DoModal(); -} - -void CPumpKINDlg::OnTrayFetchfile() -{ - OnGet(); -} - -void CPumpKINDlg::OnTrayHelp() -{ - OnHelp(); -} - -void CPumpKINDlg::OnTrayOptions() -{ - OnOptions(); -} - -void CPumpKINDlg::OnTraySendfile() -{ - OnPut(); -} - -void CPumpKINDlg::LoadSettings() -{ -CWinApp *app = AfxGetApp(); - ASSERT(app); - m_bListen=app->GetProfileInt("TFTPSettings","Listen",m_bListen); - m_bnwRequest=app->GetProfileString("BellsNWhistles","Request",m_bnwRequest); - m_bnwSuccess=app->GetProfileString("BellsNWhistles","Success",m_bnwSuccess); - m_bnwAbort=app->GetProfileString("BellsNWhistles","Abort",m_bnwAbort); - m_bTFTPSubdirs=app->GetProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); - m_ListenPort=app->GetProfileInt("TFTPSettings","ListenPort",m_ListenPort); - m_ListenAddress=app->GetProfileString("TFTPSettings","ListenAddress",m_ListenAddress); - m_LogLength=app->GetProfileInt("UISettings","LogLength",m_LogLength); - m_PromptTimeOut=app->GetProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); - m_RRQMode=app->GetProfileInt("TFTPSettings","RRQMode",m_RRQMode); - m_SpeakPort=app->GetProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); - m_TFTPRoot=app->GetProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); - m_LogFile=app->GetProfileString("General","LogFile",m_LogFile); - m_TFTPTimeOut=CTimeSpan(app->GetProfileInt("TFTPSettings","TFTPTimeout",m_TFTPTimeOut.GetTotalSeconds())); - m_BlockSize=app->GetProfileInt("TFTPSettings","TFTPBlockSize",m_BlockSize); - m_RetryTimeOut=CTimeSpan(app->GetProfileInt("TFTPSettings","RetryTimeout",m_RetryTimeOut.GetTotalSeconds())); - m_WRQMode=app->GetProfileInt("TFTPSettings","WRQMode",m_WRQMode); - m_bShown=app->GetProfileInt("UISettings","Visble",m_bShown); - if(m_TFTPRoot.IsEmpty()){ - DWORD dL = ::GetCurrentDirectory(0,NULL); - VERIFY(::GetCurrentDirectory(dL,m_TFTPRoot.GetBuffer(dL))); - m_TFTPRoot.ReleaseBuffer(); - } - ::SetCurrentDirectory(m_TFTPRoot); - m_aclRules.LoadProfile(app); -} - -void CPumpKINDlg::SaveSettings() -{ -CWinApp *app = AfxGetApp(); - ASSERT(app); - app->WriteProfileInt("TFTPSettings","Listen",m_bListen); - app->WriteProfileString("BellsNWhistles","Request",m_bnwRequest); - app->WriteProfileString("BellsNWhistles","Success",m_bnwSuccess); - app->WriteProfileString("BellsNWhistles","Abort",m_bnwAbort); - app->WriteProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); - app->WriteProfileInt("TFTPSettings","ListenPort",m_ListenPort); - app->WriteProfileString("TFTPSettings","ListenAddress",m_ListenAddress); - app->WriteProfileInt("UISettings","LogLength",m_LogLength); - app->WriteProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); - app->WriteProfileInt("TFTPSettings","RRQMode",m_RRQMode); - app->WriteProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); - app->WriteProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); - app->WriteProfileString("General","LogFile",m_LogFile); - app->WriteProfileInt("TFTPSettings","TFTPTimeout",m_TFTPTimeOut.GetTotalSeconds()); - app->WriteProfileInt("TFTPSettings","TFTPBlockSize",m_BlockSize); - app->WriteProfileInt("TFTPSettings","RetryTimeout",m_RetryTimeOut.GetTotalSeconds()); - app->WriteProfileInt("TFTPSettings","WRQMode",m_WRQMode); - app->WriteProfileInt("UISettings","Visble",m_bShown); - m_aclRules.SaveProfile(app); -} - -void CPumpKINDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) -{ - CDialog::OnWindowPosChanging(lpwndpos); - if(!m_bExiting){ - if(m_bShown){ - lpwndpos->flags&=~SWP_HIDEWINDOW; - lpwndpos->flags|=SWP_SHOWWINDOW; - }else{ - lpwndpos->flags&=~SWP_SHOWWINDOW; - lpwndpos->flags|=SWP_HIDEWINDOW; - if(::GetForegroundWindow()==m_hWnd && (m_Trayer && !m_Trayer->m_inMenu)) - GetDesktopWindow()->SetForegroundWindow(); - } - } -} - -CString CXferSocket::ApplyRootGently(LPCTSTR fn) -{ -CString f = fn; -CString rv = f; - if((!f.IsEmpty()) && f[0]!='\\' && f.Find(":")<0 && f.Find("\\")<0) - rv = ApplyRoot(f); - return rv; -} - -BOOL CXferSocket::CheckBadRelativeness(LPCTSTR file) -{ -CString tmp = file; - if(tmp.IsEmpty()) - return FALSE; - if(tmp.Find("..")>=0) - return TRUE; - if(tmp.Find(":")>=0) - return TRUE; - if((!m_Daddy->m_bTFTPSubdirs) && m_FileName.Find('\\')>=0) - return TRUE; - return FALSE; -} - -void CAboutDlg::OnKlevernet() -{ -CString url; - url.LoadString(IDS_KLEVERNET_URL); - ShellExecute(::GetDesktopWindow(),"open",url,NULL,NULL,SW_SHOWMAXIMIZED); -} - -BOOL CPumpKINDlg::PreTranslateMessage(MSG* pMsg) -{ - // CG: The following block was added by the ToolTips component. - { - // Let the ToolTip process this message. - m_tooltip.RelayEvent(pMsg); - - return CDialog::PreTranslateMessage(pMsg); - } -} - -void CPumpKINDlg::OnSelchangeLog() -{ -int sel = m_Log.GetCurSel(); - if(sel==LB_ERR){ - TRACE0("Error retrieving selection\n"); - }else{ - CTime *t = (CTime*)m_Log.GetItemData(sel); - ASSERT(t); - m_tooltip.UpdateTipText(t->Format(IDS_LOGTIMEFORMAT),&m_Log); - } -} - -void CPumpKINDlg::OnTrayOpenfilesfolder() -{ - ShellExecute(::GetDesktopWindow(),NULL,m_TFTPRoot,NULL,NULL,SW_SHOWDEFAULT); -} - -void CPumpKINDlg::OnDropFiles(HDROP hDropInfo) -{ -UINT files = ::DragQueryFile(hDropInfo,0xFFFFFFFF,NULL,0); - ASSERT(files); - for(UINT file=0;filem__blkSize=crd.m_BSize; - if(!socket->Create(crd.m_LocalFile,crd.m_Host)) - socket->Destroy(); - } - } - ::DragFinish(hDropInfo); -} - -void CPumpKINDlg::OnCancel() -{ - OnClose(); -} - -CPumpKINDlg::~CPumpKINDlg() -{ - delete m_Trayer; - delete m_Retrier; -} - -void CXferSocket::OnRetry() -{ - if(!m_Retry){ - TRACE("Retrying unretriable..\n"); - return; - } - TRACE0("Retrying..\n"); - m_bRetry=TRUE; - PostTFTP(tftp::Copy(m_Retry)); - m_bRetry=FALSE; -} - -tftp* tftp::Copy(tftp *src) -{ - ASSERT(src); - ASSERT(src->length); -tftp* rv = Allocate(src->length); - ASSERT(rv); - memmove(rv,src,tftpSlackSize+src->length); - return rv; -} - -void CXferSocket::SetTry(tftp *p) -{ - if(m_Retry) - delete m_Retry; - m_Retry=p?tftp::Copy(p):NULL; -} - -void CPumpKINDlg::OnHelp() -{ - AfxGetApp()->WinHelp(0,HELP_FINDER); -} - -BOOL CListenSocket::SetListen(BOOL b) { - ASSERT(m_Daddy); - if(b==m_bListen) return TRUE; - if(!b) { - Close(); m_bListen=FALSE; - return TRUE; - } - return m_bListen=Create(m_Daddy->m_ListenPort,SOCK_DGRAM, - FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE, - m_Daddy->m_ListenAddress.IsEmpty()?NULL:(LPCTSTR)m_Daddy->m_ListenAddress); -} - -void CPumpKINDlg::OnListening() -{ - if(!m_Listener.SetListen(m_ListenCtl.GetCheck()==1)) { - TRACE0("Failed to create socket\n"); - AfxMessageBox(IDS_BOX_CANTBIND,MB_OK|MB_ICONEXCLAMATION); - } - m_ListenCtl.SetCheck(m_Listener.m_bListen?1:0); - m_bListen=m_Listener.m_bListen; -} - -void CPumpKINDlg::OnTrayListen() -{ - if(!m_Listener.SetListen(!m_Listener.m_bListen)) { - TRACE0("Failed to create socket\n"); - AfxMessageBox(IDS_BOX_CANTBIND,MB_OK|MB_ICONEXCLAMATION); - } - m_ListenCtl.SetCheck(m_Listener.m_bListen?1:0); - m_bListen=m_Listener.m_bListen; -} - -void CPumpKINDlg::LogLine(LPCTSTR str) -{ - LogLineToScreen(str); - if(!m_LogFile.IsEmpty()) { - if(!Klever::LogRecord((LPCTSTR)m_LogFile,str)) { - if(m_lastlogerr!=m_LogFile) { - CString tmp; - tmp.Format(IDS_LOG_LOGERROR,m_LogFile); - LogLineToScreen(tmp); - m_lastlogerr=m_LogFile; - } - } - } -} - -void CPumpKINDlg::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) -{ - CDialog::OnGetMinMaxInfo(lpMMI); - if(m_MinSize.cx>0 && m_MinSize.cy>0){ - lpMMI->ptMinTrackSize.x = m_MinSize.cx; - lpMMI->ptMinTrackSize.y = m_MinSize.cy; - } -} - -void CPumpKINDlg::OnSize(UINT nType, int cx, int cy) -{ - CDialog::OnSize(nType, cx, cy); - if(nType==SIZE_RESTORED) - RecalcLayout(cx,cy); -} - -void CPumpKINDlg::RecalcLayout(int,int) -{ - CRect wrc; - GetClientRect(&wrc); - AdjustButton(m_GetCtl,wrc); - AdjustButton(m_PutCtl,wrc); - AdjustButton(m_AbortCtl,wrc); - AdjustButton(m_HelpCtl,wrc); - AdjustButton(m_ExitCtl,wrc); - AdjustButton(m_OptionsCtl,wrc); - CRect brc; - m_List.GetWindowRect(&brc); ScreenToClient(&brc); - m_List.SetWindowPos( - 0, - brc.left, brc.top, - wrc.right-m_rightGapList-brc.left, brc.bottom-brc.top, - SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOZORDER|SWP_NOCOPYBITS ); - m_Log.GetWindowRect(&brc); ScreenToClient(&brc); - m_Log.SetWindowPos( - 0, - brc.left, brc.top, - wrc.right-m_rightGapButtons-brc.left, wrc.bottom-m_bottomGapLog-brc.top, - SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOZORDER|SWP_NOCOPYBITS ); - m_ListenCtl.GetWindowRect(&brc); ScreenToClient(&brc); - m_ListenCtl.SetWindowPos( - 0, - wrc.right-brc.Width()-m_rightGapButtons, wrc.bottom-brc.Height()-m_bottomGapListen, - 0,0, - SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER|SWP_NOCOPYBITS ); - int i = m_Log.GetCount(); - if(i!=LB_ERR) - m_Log.SetCurSel(i-1); -} - -void CPumpKINDlg::AdjustButton(CWnd& w,CRect& wrc) -{ - CRect brc; - w.GetWindowRect(&brc); ScreenToClient(&brc); - w.SetWindowPos( - 0, - wrc.right-brc.Width()-m_rightGapButtons, brc.top, - 0, 0, - SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER|SWP_NOCOPYBITS ); -} diff --git a/PumpKINDlg.h b/PumpKINDlg.h deleted file mode 100755 index 9077292..0000000 --- a/PumpKINDlg.h +++ b/dev/null @@ -1,502 +0,0 @@ -// PumpKINDlg.h : header file -// - -//#define REVERSEBYTES(w) MAKEWORD(HIBYTE(w),LOBYTE(w)); -#define REVERSEBYTES(w) (htons((WORD)w)) -#define tftpoBSize "blksize" -#define tftpoTSize "tsize" -#define tftpoTOut "timeout" - -#define tftpoXResume "x-resume" - -struct tftp { - typedef CMapStringToString tftpOptions; - typedef WORD tftpLength; - typedef WORD tftpOpcode; - tftpLength length; - tftpOpcode opcode; - enum { - opRRQ = 1, - opWRQ = 2, - opDATA = 3, - opACK = 4, - opERROR = 5, - opOACK = 6, - - errUndefined = 0, - errNotFound = 1, - errAccessViolation = 2, - errDiskFull = 3, - errIllegalOp = 4, - errUnknownTID = 5, - errFileExists = 6, - errNoUser = 7, - errOption = 8 - }; - struct tftpUNKNOWN { - BYTE data[1]; - }; - struct tftpRQ { - BYTE data[1]; -public: - void Set(LPCTSTR file,LPCTSTR type,tftpOptions* ops=NULL); - static UINT tftpSize(LPCTSTR file,LPCTSTR type,tftpOptions* ops=NULL); - }; - struct tftpRRQ { - BYTE data[1]; -public: - void Set(LPCTSTR file,LPCTSTR type,tftpOptions* ops=NULL); - static UINT tftpSize(LPCTSTR file,LPCTSTR type,tftpOptions* ops=NULL); - }; - struct tftpWRQ { - BYTE data[1]; -public: - void Set(LPCTSTR file,LPCTSTR type,tftpOptions* ops=NULL); - static UINT tftpSize(LPCTSTR file,LPCTSTR type,tftpOptions* ops=NULL); - }; - struct tftpDATA { - WORD block; - BYTE data[1]; - public: - WORD Block(); - void SetBlock(WORD b); - static UINT tftpSize(UINT blkSize=512); - }; - struct tftpACK { - WORD block; - public: - static UINT tftpSize(); - void SetBlock(WORD b); - WORD Block(); - }; - struct tftpERROR { - typedef WORD tftpErrorCode; - tftpErrorCode code; - BYTE data[1]; - public: - void SetCode(WORD c); - WORD Code(); - static UINT tftpSize(LPCTSTR msg); - }; - struct tftpOACK { - BYTE data[1]; - public: - void Set(tftpOptions* ops); - static UINT tftpSize(tftpOptions* ops); - }; - union tftpPacket { - tftpUNKNOWN m_UNKNOWN; - tftpRQ m_RQ; - tftpRRQ m_RRQ; - tftpWRQ m_WRQ; - tftpDATA m_DATA; - tftpACK m_ACK; - tftpERROR m_ERROR; - tftpOACK m_OACK; - } data; - - void *udpBase(void) { return &opcode; } -public: - static tftp* Copy(tftp *src); - CString errMessage(); - void SetOpcode(WORD op); - void errSet(UINT code,LPCTSTR msg); - static tftp* Allocate(UINT tftpSize=0); - BOOL Send(CAsyncSocket *socket,SOCKADDR_IN* saddr); - CString rqType(); - CString rqFileName(); - UINT GetOptions(tftpOptions* ops); - tftp(); - UINT Opcode(); - BOOL Receive(CAsyncSocket* socket,UINT maxLength,SOCKADDR_IN *sin=NULL); -}; -#define tftpHdrSize (sizeof(tftp)-sizeof(tftp::tftpPacket)) -#define tftpSlackSize sizeof(tftp::tftpLength) - -struct acl_rule { - enum { - opRRQ=tftp::opRRQ, opWRQ=tftp::opWRQ - }; - int op; - DWORD addr, mask; - enum { - rrqGrant=0, rrqPrompt, rrqDeny, - rrqRules, - rrqNone=-1 - }; - enum { - wrqGrant=0, wrqPromptIfExists, wrqPrompt, wrqDeny, - wrqRules, - wrqNone=-1 - }; - int target; - - acl_rule() - : op(-1), addr(0), mask(0), target(-1) { } - acl_rule(int o,DWORD a,DWORD m,int t) - : op(o), addr(a), mask(m), target(t) { } - acl_rule(const acl_rule& s) - : op(s.op), addr(s.addr), mask(s.mask), target(s.target) { } - - BOOL IsValid() { - if(op==opRRQ) { - if(target=rrqRules) - return FALSE; - }else if(op==opWRQ) { - if(target=wrqRules) - return FALSE; - }else - return FALSE; - return TRUE; - } - - BOOL IsMatch(int o,DWORD a) { - if(o!=op) return FALSE; - if( (a&mask) != (addr&mask)) return FALSE; - return TRUE; - } - - CString str_addr() { - return inet_ntoa(*(struct in_addr*)&addr); - } - CString str_mask() { - return inet_ntoa(*(struct in_addr*)&mask); - } - CString str_target() { - if(op==opRRQ) { - switch(target) { - case rrqNone: return "fallback"; - case rrqGrant: return "grant"; - case rrqPrompt: return "prompt"; - case rrqDeny: return "deny"; - default: return "?"; - } - }else if(op==opWRQ) { - switch(target) { - case wrqNone: return "fallback"; - case wrqGrant: return "grant"; - case wrqPromptIfExists: return "prompt if exists"; - case wrqPrompt: return "prompt"; - case wrqDeny: return "deny"; - default: return "?"; - } - }else - return "?"; - } - - void SaveProfile(CWinApp* app,int i) { - CString n; n.Format("%d",i); - app->WriteProfileInt("ACL","op_"+n,op); - app->WriteProfileString("ACL","addr_"+n,str_addr()); - app->WriteProfileString("ACL","mask_"+n,str_mask()); - app->WriteProfileInt("ACL","target_"+n,target); - } - - void LoadProfile(CWinApp* app,int i) { - CString n; n.Format("%d",i); - op=app->GetProfileInt("ACL","op_"+n,-1); - addr=inet_addr(app->GetProfileString("ACL","addr_"+n)); - mask=inet_addr(app->GetProfileString("ACL","mask_"+n)); - target=app->GetProfileInt("ACL","target_"+n,-1); - } - -}; - -class acl_rules_t : public CArray { -public: - - acl_rules_t& operator=(const acl_rules_t& s) { - // Copy(s); XXX: unsuprisingly, there's a bug in MFC Copy, *pDst++=*pSrc (no ++ for Src) - RemoveAll(); - int ns = s.GetSize(); - SetSize(ns); - for(int i=0;iWriteProfileInt("ACL","rules",s); - } - void LoadProfile(CWinApp* app) { - RemoveAll(); - int s=app->GetProfileInt("ACL","rules",0); - for(int i=0;i CTFTPList; -class CResolver; -class CXferSocket : public CAsyncSocket { -public: - UINT m__timeOut; - UINT m__blkSize; - tftp::tftpOptions m_Options; - LONG m_xferSize; - UINT m_timeOut; - UINT m_blkSize; - BOOL m_bRetry; - void SetTry(tftp *p=NULL); - tftp* m_Retry; - void OnRetry(); - BOOL CheckBadRelativeness(LPCTSTR file); - CString ApplyRootGently(LPCTSTR fn); - CString m_HostName; - virtual void OnResolved(); - virtual void OnFailedToResolve(); - CResolver *m_wndResolver; - BYTE m_ResolveBuff[MAXGETHOSTSTRUCT]; - virtual void Abort(); - void ResetTimeout(); - enum { - stateNone, stateDeny, stateInit, stateOACK, stateXfer, stateFinish, stateClosing - }; - int state; - void Deny(UINT errCode,UINT errID); - void Deny(CFileException* e); - CString ApplyRoot(LPCTSTR fileName); - void TurnSlashes(CString& fn,BOOL bBack=TRUE); - virtual void Destroy(BOOL success=TRUE); - void PostError(CFileException* e); - void PostError(UINT errCode,UINT errID); - void PostTFTP(tftp* p,BOOL retryable=FALSE); - CXferSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN* sin); - CFile m_File; - virtual ULONG GetACK(); - CString m_Type; - CString m_FileName; - CXferSocket(); - void UpdateList(); - void SetPeer(SOCKADDR_IN *sin); - virtual BOOL OnTFTP(tftp* p) = 0; - virtual void OnReceive(int nErrorCode); - void DoSelect(BOOL do_select=FALSE); - SOCKADDR_IN m_Peer; - virtual void OnSend(int nErrorCode); - CPumpKINDlg* m_Daddy; - CTFTPList m_Queue; - - DECLARE_DYNAMIC(CXferSocket) -}; -class CWRQSocket : public CXferSocket { -public: - BOOL m_bResume; - void OnHostKnown(); - virtual void OnResolved(); - UINT m_LastSlack; - ULONG GetACK(); - void DoXfer(); - UINT m_ACK; - BOOL SaveAs(CString& fn); - BOOL RenameFile(CString& fn); - BOOL m_Rename; - BOOL ConfirmRequest(); - BOOL Create(LPCTSTR localFile=NULL,LPCTSTR hostName=NULL); - CWRQSocket(CPumpKINDlg* daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin); - BOOL OnTFTP(tftp* p); - - DECLARE_DYNAMIC(CWRQSocket) -}; -class CRRQSocket : public CXferSocket { -public: - UINT m_ACKtoClose; - void OnHostKnown(); - virtual void OnResolved(); - BOOL ConfirmRequest(); - WORD m_LastSlack; - UINT m_ACK; - BOOL OnTFTP(tftp* p); - ULONG GetACK(void); - void DoXfer(); - CRRQSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin); - BOOL Create(LPCTSTR localFile=NULL,LPCTSTR hostName=NULL); - - DECLARE_DYNAMIC(CRRQSocket) -}; - -typedef CMap CTIDMap; -typedef CMap CTimeMap; - -///////////////////////////////////////////////////////////////////////////// -// CPumpKINDlg dialog - -class CTrayer; -class CRetrier; -class CPumpKINDlg : public CDialog -{ -// Construction -public: - void AdjustButton(CWnd& w,CRect& wrc); - void RecalcLayout(int,int); - CSize m_MinSize; - UINT m_bottomGapLog; - UINT m_bottomGapListen; - UINT m_rightGapList; - UINT m_rightGapButtons; - CString m_lastlogerr; - void LogLine(LPCTSTR str); - CString m_LogFile; - BOOL m_bListen; - acl_rules_t m_aclRules; - CString m_bnwRequest; - CString m_bnwSuccess; - CString m_bnwAbort; - CBellsNWhistles m_bnw; - CTrayer *m_Trayer; - CTimeSpan m_RetryTimeOut; - virtual ~CPumpKINDlg(); - CRetrier* m_Retrier; - virtual BOOL PreTranslateMessage(MSG* pMsg); - BOOL m_bShown; - BOOL m_bExiting; - void SaveSettings(); - void LoadSettings(); - void SetupButtons(); - BITMAP m_bitmapBack; - CBitmap m_bmpBack; - UINT m_PromptTimeOut; - UINT m_SpeakPort; - void LogLine(UINT msgID); - CTimeMap m_LogTimes; - void LogLineToFile(LPCTSTR str); - void LogLineToScreen(LPCTSTR str); - int m_LogLength; - enum { - subitemFile=0, subitemType, subitemPeer, subitemBytes, subitemTSize - }; - int m_iWRQ; - int m_iRRQ; - CImageList m_Images; - CTIDMap m_Xfers; - CTimeSpan m_TFTPTimeOut; - enum { - rrqGiveAll=acl_rule::rrqGrant, - rrqAlwaysConfirm=acl_rule::rrqPrompt, - rrqDenyAll=acl_rule::rrqDeny, - rrqFallback=acl_rule::rrqNone, - rrqGrant=rrqGiveAll, rrqDeny=rrqDenyAll, rrqPrompt=rrqAlwaysConfirm - }; - enum { - wrqTakeAll=acl_rule::wrqGrant, - wrqConfirmIfExists=acl_rule::wrqPromptIfExists, - wrqAlwaysConfirm=acl_rule::wrqPrompt, - wrqDenyAll=acl_rule::wrqDeny, - wrqFallback=acl_rule::wrqNone, - wrqGrant=wrqTakeAll,wrqDeny=wrqDenyAll, wrqPrompt=wrqAlwaysConfirm - }; - UINT m_RRQMode; - UINT m_WRQMode; - BOOL m_bTFTPSubdirs; - CString m_TFTPRoot; - UINT m_ListenPort; - CString m_ListenAddress; - UINT m_BlockSize; - CListenSocket m_Listener; - CPumpKINDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPumpKINDlg) - enum { IDD = IDD_PUMPKIN_DIALOG }; - CButton m_HelpCtl; - CButton m_PutCtl; - CButton m_GetCtl; - CButton m_ExitCtl; - CButton m_ListenCtl; - CButton m_AbortCtl; - CButton m_OptionsCtl; - CListBox m_Log; - CListCtrl m_List; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPumpKINDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - CToolTipCtrl m_tooltip; - HICON m_hIcon; - - // Generated message map functions - //{{AFX_MSG(CPumpKINDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnSysCommand(UINT nID, LPARAM lParam); - afx_msg void OnDestroy(); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg void OnOptions(); - afx_msg void OnTimer(UINT nIDEvent); - afx_msg void OnExit(); - afx_msg void OnPut(); - afx_msg void OnGet(); - afx_msg void OnDeleteallitemsConnections(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnDeleteitemConnections(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnInsertitemConnections(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnItemchangedConnections(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnAbort(); - afx_msg void OnClose(); - afx_msg void OnTrayShowpumpkinwindow(); - afx_msg void OnTrayListen(); - afx_msg void OnTrayExit(); - afx_msg void OnTrayAboutpumpkin(); - afx_msg void OnTrayFetchfile(); - afx_msg void OnTrayHelp(); - afx_msg void OnTrayOptions(); - afx_msg void OnTraySendfile(); - afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); - afx_msg void OnSelchangeLog(); - afx_msg void OnTrayOpenfilesfolder(); - afx_msg void OnDropFiles(HDROP hDropInfo); - virtual void OnCancel(); - afx_msg void OnHelp(); - afx_msg void OnListening(); - afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); - afx_msg void OnSize(UINT nType, int cx, int cy); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; diff --git a/README.RELEASE b/README.RELEASE deleted file mode 100644 index fbdfd9c..0000000 --- a/README.RELEASE +++ b/dev/null @@ -1,33 +0,0 @@ - -Before compiling canned install executable the following files should be placed -in the build tree: - -redist/mfc42.dl_ - -Release checklist: - (These are tags stored in KTAGS file. please, keep in sync. Use vim to - jump to these tags. I haven't tried it on windows, though). - -|help-news| - Release notes in help file - -Version number in the following places: - -|about-version| - About box -|vsinfo-numeric-version| - VERSIONINFO numerical File&Prod V -|vsinfo-string-version| - VERSIONINFO string File&Prod V -|install-version| - Version used in install -|install-vsinfo-numeric-version| - install's VERSIONINFO block -|install-vsinfo-string-version| - install's VERSIONINFO block - -If the year flips check these: - -|about-date| - About box -|help-license-date| - license in help file -|license-date| - license in COPYING file -|vsinfo-date| - Copyright in VERSIONINFO block -|install-vsinfo-date| - Copyright in install's VERSIONINFO - block - - -This is for vim (don't remove): - vim:set tags=KTAGS isk=!-~,^*,^\|,^\" ft=help: diff --git a/RequestDlg.cpp b/RequestDlg.cpp deleted file mode 100644 index 94a8a98..0000000 --- a/RequestDlg.cpp +++ b/dev/null @@ -1,299 +0,0 @@ -// RequestDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "RequestDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CRequestDlg dialog - - -CRequestDlg::CRequestDlg(CWnd* pParent /*=NULL*/) - : CDialog(CRequestDlg::IDD, pParent) -{ - m_Put=TRUE; - m_Drop=FALSE; - //{{AFX_DATA_INIT(CRequestDlg) - m_Host = m_MRUHost; - m_LocalFile = _T(""); - m_RemoteFile = _T(""); - m_Type = _T("octet"); - m_strBSize = _T(""); - //}}AFX_DATA_INIT -} - - -void CRequestDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - if(!pDX->m_bSaveAndValidate) - m_strBSize.Format("%u",m_BSize); - //{{AFX_DATA_MAP(CRequestDlg) - DDX_Control(pDX, IDC_REMOTEFILE, m_RemoteFileCtl); - DDX_Control(pDX, IDC_LOCALFILE, m_LocalFileCtl); - DDX_Control(pDX, IDC_REFRESH, m_RefreshCtl); - DDX_Control(pDX, IDOK, m_OKCtl); - DDX_Control(pDX, IDC_TALKS, m_TalksCtl); - DDX_Control(pDX, IDC_BROWSE, m_BrowseCtl); - DDX_CBString(pDX, IDC_TALKS, m_Host); - DDX_Text(pDX, IDC_LOCALFILE, m_LocalFile); - DDX_Text(pDX, IDC_REMOTEFILE, m_RemoteFile); - DDX_CBString(pDX, IDC_TYPE, m_Type); - DDX_CBString(pDX, IDC_BSIZE, m_strBSize); - //}}AFX_DATA_MAP - if(pDX->m_bSaveAndValidate) - m_BSize=atoi(m_strBSize); -} - -CString CRequestDlg::m_MRUHost; - -BEGIN_MESSAGE_MAP(CRequestDlg, CDialog) - //{{AFX_MSG_MAP(CRequestDlg) - ON_BN_CLICKED(IDC_REFRESH, OnRefresh) - ON_BN_CLICKED(IDC_BROWSE, OnBrowse) - ON_EN_CHANGE(IDC_LOCALFILE, OnChangeLocalfile) - ON_EN_CHANGE(IDC_REMOTEFILE, OnChangeRemotefile) - ON_CBN_EDITCHANGE(IDC_TALKS, OnEditchangeTalks) - ON_CBN_SELCHANGE(IDC_TALKS, OnSelchangeTalks) - ON_WM_CTLCOLOR() - ON_WM_DROPFILES() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CRequestDlg message handlers - -BOOL CRequestDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - m_RefreshCtl.SendMessage(WM_SETFONT,(WPARAM)::GetStockObject(ANSI_FIXED_FONT),0); - m_BrowseCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_BROWSE)); - -CString title; - title.LoadString(m_Put?IDS_TITLE_PUTREQUEST:IDS_TITLE_GETREQUEST); - SetWindowText(title); - UpdateOK(); - SyncNames(); - BringWindowToTop(); - SetForegroundWindow(); - OnRefresh(); - if(!m_MRUHost.IsEmpty()) - m_TalksCtl.SetWindowText(m_MRUHost); - else{ - if(m_TalksCtl.GetCount()==1){ - CString tmp; - m_TalksCtl.GetLBText(0,tmp); - m_TalksCtl.SetWindowText(tmp); - } - } - - // CG: The following block was added by the ToolTips component. - { - // Create the ToolTip control. - m_tooltip.Create(this); - m_tooltip.Activate(TRUE); - - m_tooltip.AddTool(&m_BrowseCtl,IDC_BROWSE); - m_tooltip.AddTool(&m_RefreshCtl,IDC_REFRESH); - } - - if(m_Put) - DragAcceptFiles(); - - if(m_Drop || !m_Put){ - m_RemoteFileCtl.SetFocus(); - return FALSE; - } - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CRequestDlg::OnRefresh() -{ - m_TalksCtl.ResetContent(); -CWnd *wnd = CWnd::FindWindow(NULL,NULL); -CString wtalkHead,wtalkAt; - wtalkHead.LoadString(IDS_WTALKHEADING);wtalkAt.LoadString(IDS_WTALKAT); -CString otalxHead,otalxAt; - otalxHead.LoadString(IDS_OTALXHEADING);otalxAt.LoadString(IDS_OTALXAT); - while(wnd){ - CString text; - wnd->GetWindowText(text); - int tw = text.Find(wtalkHead); - if(tw==0){ - text=text.Mid(wtalkHead.GetLength()); - int at = text.Find(wtalkAt); - if(at>=0){ - if(text.GetLength()>(at+wtalkAt.GetLength())){ - text=text.Left(at)+'@'+text.Mid(at+wtalkAt.GetLength()); - text.TrimLeft(); - text.TrimRight(); - VERIFY(m_TalksCtl.AddString(text)>=0); - } - } - }else{ - tw = text.Find(otalxHead); - if(tw==0){ - text=text.Mid(otalxHead.GetLength()); - int at = text.Find(otalxAt); - if(at>=0){ - if(text.GetLength()>(at+otalxAt.GetLength())){ - text=text.Left(at)+'@'+text.Mid(at+otalxAt.GetLength()); - text.TrimLeft(); - text.TrimRight(); - VERIFY(m_TalksCtl.AddString(text)>=0); - } - } - } - } - wnd = wnd->GetNextWindow(); - } - UpdateOK(); -} - -void CRequestDlg::OnBrowse() -{ - UpdateData(TRUE); -CFileDialog cfd(m_Put,NULL,m_LocalFile.IsEmpty()?NULL:m_LocalFile,OFN_EXPLORER|OFN_HIDEREADONLY|OFN_PATHMUSTEXIST|(m_Put?OFN_FILEMUSTEXIST:OFN_OVERWRITEPROMPT),NULL,this); -CString title; - title.LoadString(IDS_TITLE_BROWSEFILE); - cfd.m_ofn.lpstrTitle=(LPCTSTR)title; - if(cfd.DoModal()==IDOK){ - m_LocalFile=cfd.GetPathName(); - UpdateData(FALSE); - SyncNames(); - UpdateOK(); - } -} - -void CRequestDlg::SyncNames() -{ - if(m_Put){ - CString tmp; - m_LocalFileCtl.GetWindowText(tmp); - int s=tmp.ReverseFind('\\'); - if(s>=0) - tmp=tmp.Mid(s+1); - else{ - s = tmp.ReverseFind('/'); - if(s>=0) - tmp=tmp.Mid(s+1); - } - if(!tmp.IsEmpty()) - m_RemoteFileCtl.SetWindowText(tmp); - }else{ - CString tmp; - m_RemoteFileCtl.GetWindowText(tmp); - int s=tmp.ReverseFind('\\'); - if(s>=0) - tmp=tmp.Mid(s+1); - else{ - s = tmp.ReverseFind('/'); - if(s>=0) - tmp=tmp.Mid(s+1); - } - if(!tmp.IsEmpty()) - m_LocalFileCtl.SetWindowText(tmp); - } -} - -void CRequestDlg::OnChangeLocalfile() -{ - if(m_Put) - SyncNames(); - UpdateOK(); -} - -void CRequestDlg::OnChangeRemotefile() -{ - if(!m_Put) - SyncNames(); - UpdateOK(); -} - -void CRequestDlg::UpdateOK() -{ -CString t; - m_LocalFileCtl.GetWindowText(t); - if(t.IsEmpty()) - goto dAble; - m_RemoteFileCtl.GetWindowText(t); - if(t.IsEmpty()) - goto dAble; - m_TalksCtl.GetWindowText(t); - if(t.IsEmpty()) - goto dAble; - m_OKCtl.EnableWindow(TRUE); - return; -dAble: - m_OKCtl.EnableWindow(FALSE); -} - -void CRequestDlg::OnEditchangeTalks() -{ - UpdateOK(); -} - -void CRequestDlg::OnSelchangeTalks() -{ - UpdateOK(); -} - -HBRUSH CRequestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) -{ - HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); - UpdateOK(); - return hbr; -} - -BOOL CRequestDlg::PreTranslateMessage(MSG* pMsg) -{ - // CG: The following block was added by the ToolTips component. - { - // Let the ToolTip process this message. - if(::IsWindow(m_tooltip.m_hWnd)) - m_tooltip.RelayEvent(pMsg); - - return CDialog::PreTranslateMessage(pMsg); - } -} - -int CRequestDlg::DoModal() -{ -int rv = CDialog::DoModal(); - if(rv==IDOK) - m_MRUHost=m_Host; - return rv; -} - -void CRequestDlg::OnDropFiles(HDROP hDropInfo) -{ -UINT files = ::DragQueryFile(hDropInfo,0xFFFFFFFF,NULL,0); - if(files!=1){ - CString title,text; - title.LoadString(IDS_DROPFILES_TITLE); - text.LoadString(IDS_NOMULTIPLEDROP_TEXT); - if(MessageBox(text,title,MB_ICONSTOP|MB_OKCANCEL)!=IDOK){ - ::DragFinish(hDropInfo); - return; - } - } - ASSERT(files); -CString theFile; -UINT fileNameLength = ::DragQueryFile(hDropInfo,0,NULL,0); - ASSERT(fileNameLength); - VERIFY(::DragQueryFile(hDropInfo,0,theFile.GetBuffer(fileNameLength+5),fileNameLength+4)<=fileNameLength); - theFile.ReleaseBuffer(); - m_LocalFileCtl.SetWindowText(theFile); - SyncNames(); - ::DragFinish(hDropInfo); -} diff --git a/RequestDlg.h b/RequestDlg.h deleted file mode 100644 index fcd2d20..0000000 --- a/RequestDlg.h +++ b/dev/null @@ -1,63 +0,0 @@ -// RequestDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CRequestDlg dialog - -class CRequestDlg : public CDialog -{ -// Construction -public: - UINT m_BSize; - static CString m_MRUHost; - BOOL m_Drop; - virtual BOOL PreTranslateMessage(MSG* pMsg); - void UpdateOK(); - void SyncNames(); - BOOL m_Put; - CRequestDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CRequestDlg) - enum { IDD = IDD_REQUEST }; - CEdit m_RemoteFileCtl; - CEdit m_LocalFileCtl; - CButton m_RefreshCtl; - CButton m_OKCtl; - CComboBox m_TalksCtl; - CButton m_BrowseCtl; - CString m_Host; - CString m_LocalFile; - CString m_RemoteFile; - CString m_Type; - CString m_strBSize; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CRequestDlg) - public: - virtual int DoModal(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - CToolTipCtrl m_tooltip; - - // Generated message map functions - //{{AFX_MSG(CRequestDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnRefresh(); - afx_msg void OnBrowse(); - afx_msg void OnChangeLocalfile(); - afx_msg void OnChangeRemotefile(); - afx_msg void OnEditchangeTalks(); - afx_msg void OnSelchangeTalks(); - afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); - afx_msg void OnDropFiles(HDROP hDropInfo); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; diff --git a/Resolver.cpp b/Resolver.cpp deleted file mode 100644 index 0ec66d3..0000000 --- a/Resolver.cpp +++ b/dev/null @@ -1,71 +0,0 @@ -// Resolver.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "Resolver.h" -#include "PumpKINDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CResolver - -CResolver::CResolver() -{ - ASSERT(NULL); -} - -CResolver::~CResolver() -{ -} - - -BEGIN_MESSAGE_MAP(CResolver, CWnd) - //{{AFX_MSG_MAP(CResolver) - ON_WM_CREATE() - ON_MESSAGE(WM_RESOLVED, OnResolved) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CResolver message handlers - -CResolver::CResolver(CXferSocket *socket) - : socket(socket) -{ -} - -int CResolver::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - ASSERT(socket); -CString hostName = socket->m_HostName; -int at = hostName.Find('@'); - if(at>=0) - hostName=hostName.Mid(at+1); - m_hAsync=WSAAsyncGetHostByName(m_hWnd,WM_RESOLVED,(LPCTSTR)hostName,(char*)socket->m_ResolveBuff,sizeof(socket->m_ResolveBuff)); - ASSERT(m_hAsync); - return 0; -} - -LRESULT CResolver::OnResolved(WPARAM wP,LPARAM lP) -{ - if(WSAGETASYNCERROR(lP)) - socket->OnFailedToResolve(); - else - socket->OnResolved(); - return 0; -} - -BOOL CResolver::Resolve() -{ - return Create(NULL,"PumpKIN-Resolver",WS_CHILD,CRect(0,0,0,0),socket->m_Daddy,0); -} diff --git a/Resolver.h b/Resolver.h deleted file mode 100644 index a97b23e..0000000 --- a/Resolver.h +++ b/dev/null @@ -1,42 +0,0 @@ -// Resolver.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CResolver window - -class CXferSocket; -class CResolver : public CWnd -{ -// Construction -public: - BOOL Resolve(); - HANDLE m_hAsync; - CResolver(CXferSocket *socket); - CXferSocket* socket; - CResolver(); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CResolver) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CResolver(); - - // Generated message map functions -protected: - //{{AFX_MSG(CResolver) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg LRESULT OnResolved(WPARAM wP,LPARAM lP); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// diff --git a/Retrier.cpp b/Retrier.cpp deleted file mode 100644 index 15b9fc3..0000000 --- a/Retrier.cpp +++ b/dev/null @@ -1,46 +0,0 @@ -// Retrier.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "Retrier.h" - -#include "PumpKINDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CRetrier - -CRetrier::CRetrier(CPumpKINDlg *daddy) - : m_Daddy(daddy) -{ -} - -CRetrier::~CRetrier() -{ -} - - -BEGIN_MESSAGE_MAP(CRetrier, CWnd) - //{{AFX_MSG_MAP(CRetrier) - ON_WM_TIMER() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CRetrier message handlers - -void CRetrier::OnTimer(UINT nIDEvent) -{ - ASSERT(m_Daddy); -CXferSocket *socket; - if(m_Daddy->m_Xfers.Lookup(nIDEvent,socket)) - socket->OnRetry(); - CWnd::OnTimer(nIDEvent); -} diff --git a/Retrier.h b/Retrier.h deleted file mode 100644 index 1a50ce2..0000000 --- a/Retrier.h +++ b/dev/null @@ -1,38 +0,0 @@ -// Retrier.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CRetrier window - -class CPumpKINDlg; -class CRetrier : public CWnd -{ -// Construction -public: - CPumpKINDlg* m_Daddy; - CRetrier(CPumpKINDlg *daddy); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CRetrier) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CRetrier(); - - // Generated message map functions -protected: - //{{AFX_MSG(CRetrier) - afx_msg void OnTimer(UINT nIDEvent); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// diff --git a/Trayer.cpp b/Trayer.cpp deleted file mode 100644 index 1e1ab3c..0000000 --- a/Trayer.cpp +++ b/dev/null @@ -1,125 +0,0 @@ -// Trayer.cpp : implementation file -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "Trayer.h" - -#include "PumpKINDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CTrayer - -CTrayer::CTrayer() -{ - m_inMenu=0; -} - -CTrayer::~CTrayer() -{ -} - - -BEGIN_MESSAGE_MAP(CTrayer, CWnd) - //{{AFX_MSG_MAP(CTrayer) - ON_MESSAGE(WM_TRAYICON, OnTray) - ON_COMMAND(ID_TRAY_ABOUTPUMPKIN, OnTrayAboutpumpkin) - ON_COMMAND(ID_TRAY_EXIT, OnTrayExit) - ON_COMMAND(ID_TRAY_FETCHFILE, OnTrayFetchfile) - ON_COMMAND(ID_TRAY_HELP, OnTrayHelp) - ON_COMMAND(ID_TRAY_OPENFILESFOLDER, OnTrayOpenfilesfolder) - ON_COMMAND(ID_TRAY_OPTIONS, OnTrayOptions) - ON_COMMAND(ID_TRAY_SENDFILE, OnTraySendfile) - ON_COMMAND(ID_TRAY_SHOWPUMPKINWINDOW, OnTrayShowpumpkinwindow) - ON_COMMAND(ID_TRAY_LISTEN, OnTrayListen) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CTrayer message handlers - -CTrayer::CTrayer(CPumpKINDlg* daddy) - : m_Daddy(daddy) -{ - m_inMenu=0; -} - -LRESULT CTrayer::OnTray(WPARAM wP,LPARAM lP) -{ - ASSERT(wP==IDC_TRAYICON); - switch(lP){ - case WM_RBUTTONDOWN: - { - CMenu menu; - VERIFY(menu.LoadMenu(IDM_POPUPS)); - CMenu *popUp = menu.GetSubMenu(0); - ASSERT(popUp); - CPoint pt; - VERIFY(::GetCursorPos(&pt)); - m_inMenu++; - SetForegroundWindow(); - popUp->CheckMenuItem(ID_TRAY_SHOWPUMPKINWINDOW,MF_BYCOMMAND|(IsWindowVisible()?MF_CHECKED:MF_UNCHECKED)); - popUp->CheckMenuItem(ID_TRAY_LISTEN,MF_BYCOMMAND|(m_Daddy->m_Listener.m_bListen?MF_CHECKED:MF_UNCHECKED)); - popUp->TrackPopupMenu(TPM_RIGHTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,pt.x,pt.y,this); - m_inMenu--; - SendMessage(WM_NULL); - } - break; - case WM_LBUTTONDOWN: - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_SHOWPUMPKINWINDOW); - break; - } - return 0; -} - -void CTrayer::OnTrayAboutpumpkin() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_ABOUTPUMPKIN); -} - -void CTrayer::OnTrayExit() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_EXIT); -} - -void CTrayer::OnTrayFetchfile() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_FETCHFILE); -} - -void CTrayer::OnTrayHelp() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_HELP); -} - -void CTrayer::OnTrayOpenfilesfolder() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_OPENFILESFOLDER); -} - -void CTrayer::OnTrayOptions() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_OPTIONS); -} - -void CTrayer::OnTraySendfile() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_SENDFILE); -} - -void CTrayer::OnTrayShowpumpkinwindow() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_SHOWPUMPKINWINDOW); -} - -void CTrayer::OnTrayListen() -{ - m_Daddy->SendMessage(WM_COMMAND,ID_TRAY_LISTEN); -} diff --git a/Trayer.h b/Trayer.h deleted file mode 100644 index c5a9465..0000000 --- a/Trayer.h +++ b/dev/null @@ -1,49 +0,0 @@ -// Trayer.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CTrayer window - -class CPumpKINDlg; -class CTrayer : public CWnd -{ -// Construction -public: - int m_inMenu; - CPumpKINDlg* m_Daddy; - CTrayer(CPumpKINDlg* daddy); - CTrayer(); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CTrayer) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CTrayer(); - - // Generated message map functions -protected: - //{{AFX_MSG(CTrayer) - afx_msg LRESULT OnTray(WPARAM,LPARAM); - afx_msg void OnTrayAboutpumpkin(); - afx_msg void OnTrayExit(); - afx_msg void OnTrayFetchfile(); - afx_msg void OnTrayHelp(); - afx_msg void OnTrayOpenfilesfolder(); - afx_msg void OnTrayOptions(); - afx_msg void OnTraySendfile(); - afx_msg void OnTrayShowpumpkinwindow(); - afx_msg void OnTrayListen(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// diff --git a/biportal/main.c b/biportal/main.c new file mode 100644 index 0000000..57085d7 --- a/dev/null +++ b/biportal/main.c @@ -0,0 +1,46 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main (int argc, const char * argv[]) { + if(geteuid()) return fprintf(stderr, "unprivileged\n"), printf("%d",EPERM), 1; + if(argc==1) { + struct stat st; + if(stat(*argv, &st)) return fprintf(stderr, "failed to self-stat\n"), printf("%d",errno), 2; + if(st.st_uid!=0 && chown(*argv, 0, 0)) return fprintf(stderr, "failed to self-chown\n"), printf("%d",errno), 3; + if((!(st.st_mode&S_ISUID)) && chmod(*argv, S_ISUID|0555)) return fprintf(stderr, "failed to self-chmod\n"), printf("%d",errno), 4; + return printf("0"),0; + } + if(argc==2 && !strcmp(argv[1],"-k")) { + pid_t p = fork(); + if(p<0) return fprintf(stderr, "failed to fork\n"), printf("%d",errno), 5; + if(!p) { + if(setuid(0)) return fprintf(stderr,"failed to setuid\n"), printf("%d",errno),8; + execl("/bin/launchctl","/bin/launchctl", "remove", "com.apple.tftpd", NULL); + exit(errno); + } + int r, wp; + while((wp=waitpid(p,&r,0))<0 && errno==EINTR); + if(p!=wp) return fprintf(stderr,"failed to wait for launchctl"), 6; + if(!WIFEXITED(r)) return fprintf(stderr,"launchctl failed"), 7; + return fprintf(stderr,"launchctl terminated with %d",WEXITSTATUS(r)), r; + } + if(argc!=4) return fprintf(stderr, "Usage: %s s h p\n",*argv), 10; + struct sockaddr_in sin; memset(&sin,0,sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = inet_addr(argv[2]); + sin.sin_port = htons(strtol(argv[3],NULL,0)); + int rc; + printf("%d", + rc=(bind( (int)strtol(argv[1],NULL,0), (struct sockaddr*)&sin,sizeof(sin) )<0) + ? errno : 0); + return rc; +} + + diff --git a/dmg-DS_Store b/dmg-DS_Store new file mode 100644 index 0000000..c0a6b33 --- a/dev/null +++ b/dmg-DS_Store Binary files differ diff --git a/dmg-background.png b/dmg-background.png new file mode 100644 index 0000000..165b0f0 --- a/dev/null +++ b/dmg-background.png Binary files differ diff --git a/help/pumpkin.bmp b/help/pumpkin.bmp deleted file mode 100644 index 9c09c21..0000000 --- a/help/pumpkin.bmp +++ b/dev/null Binary files differ diff --git a/help/pumpkin.cnt b/help/pumpkin.cnt deleted file mode 100644 index dfe42e5..0000000 --- a/help/pumpkin.cnt +++ b/dev/null @@ -1,15 +0,0 @@ -:Base PumpKIN.hlp>Standard -:Title PumpKIN -1 PumpKIN -2 About PumpKIN=About -2 What's New=News -2 Using PumpKIN=Using -1 PumpKIN Dialogs -2 Confirm Read Request Dialog=ConfirmRRQ -2 Confirm Write Request Dialog=ConfirmWRQ -2 Request Dialog=Request -1 PumpKIN Options -2 Server Options=ServerOptions -2 Network Options=NetworkOptions -2 Sounds Options=SoundsOptions -2 Access Lists=ACL diff --git a/help/pumpkin.hpj b/help/pumpkin.hpj deleted file mode 100644 index d4a2efe..0000000 --- a/help/pumpkin.hpj +++ b/dev/null @@ -1,19 +0,0 @@ -; This file is maintained by HCW. Do not modify this file directly. - -[OPTIONS] -COMPRESS=12 Hall Zeck -LCID=0x409 0x0 0x0 ; English (United States) -REPORT=Yes -CONTENTS=Using -TITLE=PumpKIN -CNT=pumpkin.cnt -HLP=PUMPKIN.HLP - -[FILES] -pumpkin.rtf - -[MAP] -#include pumpkin.hm - -[WINDOWS] -Standard="",(2,6,732,884),20740,(r14876671),(r12632256),f2 diff --git a/help/pumpkin.rtf b/help/pumpkin.rtf deleted file mode 100644 index 39fc02a..0000000 --- a/help/pumpkin.rtf +++ b/dev/null @@ -1,148 +0,0 @@ -{\rtf1\ansi -@{\footnote -THIS FILE WAS AUTOMATICALLY GENERATED FROM XML DOCUMENT. -DO NOT MODIFY THIS FILE DIRECTLY. EDIT XML DOCUMENT INSTEAD -} -{\fonttbl{\f0\froman Times New Roman;}{\f1\fswiss Arial;}{\f3\froman Symbol;}}{\colortbl; - \red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0; - \red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255; - \red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128; - \red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;} - -\pard\plain\keepn -#{\footnote About} -${\footnote About PumpKIN} -K{\footnote about} -{ \f1\fs18\b\sb120 About {\b PumpKIN}} -\par\sa120\sb120\qj \f1\fs18\sb120 {\b PumpKIN} is a program designed to send and receive files over the net while having {\uldb {\b T42}}{\v %!ExecFile("http://kin.klever.net/T42/")} or {\b\cf6 Wintalk} session running using {\i TFTP} ({\uldb {\b RFC1350}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1350.txt")}) protocol. It includes full-functional {\i TFTP} server/client so it may be useful for maintaining {\uldb CISCO}{\v %!ExecFile("http://www.cisco.com/")} routers and other network equipment. -\par\sa120\sb120\qj \f1\fs18\sb120 -\par\sa120\sb120\qj \f1\fs18\sb120 {\b {\i Enjoy!}} -{ -\par\pard\plain\sb360\sa120 \f1\fs16 Copyright (c) 1997-2011 {\uldb\cf0 Klever Group (http://www.klever.net/)}{\v %!ExecFile("http://www.klever.net/")} -\par\qj\sb120\sa120Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -\par The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -\par \sa360 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -} -\page - -\pard\plain -#{\footnote News} -${\footnote What's New} -\par\pard\plain\f1\fs24\qc\cf2\b 2.7.2.1 - Apr 27th, 2011 -\par\pard\plain\fi0\li0\f1\fs18 \bullet Fixed a minor bug that lead to misdiagnosis of the packet from unexpected source -\par\pard\plain\f1\fs24\qc\cf2\b 2.7.2 - October 18th, 2006 -\par\pard\plain\fi0\li0\f1\fs18 \bullet Added rejecting of too large file requests with explicit error message about the block size -\par\pard\plain\fi0\li0\f1\fs18 \bullet A bit more elaborate logging -\par\pard\plain\fi0\li0\f1\fs18 \bullet Not closing receive socket until the last ACK receved now -\par\pard\plain\f1\fs24\qc\cf2\b 2.7.1 - March 13th, 2006 -\par\pard\plain\fi0\li0\f1\fs18 \bullet Bugfix release -\par\pard\plain\f1\fs24\qc\cf2\b 2.7 - February 28th, 2006 -\par\pard\plain\fi0\li0\f1\fs18 \bullet Access lists based on request IP address and TFTP opcode for automating access policy -\par\pard\plain\fi0\li0\f1\fs18 \bullet Possibility to start/stop TFTP server, while keeping client functionality intact -\par\pard\plain\fi0\li0\f1\fs18 \bullet Logging to file -\par\pard\plain\fi0\li0\f1\fs18 \bullet Resizable main window -\par\pard\plain\f1\fs24\qc\cf2\b 2.6 - August 6th, 2005 -\par\pard\plain\fi0\li0\f1\fs18 \bullet more robust solution to the backslash/slash dilemma -\par\pard\plain\fi0\li0\f1\fs18 \bullet A bit more elaborate error reporting -\par\pard\plain\fi0\li0\f1\fs18 \bullet Fixed uninstall procedure so that it works on XP -\par\pard\plain\f1\fs24\qc\cf2\b 2.5 - July 11th, 2004 -\par\pard\plain\fi0\li0\f1\fs18 \bullet Change of {\uldb license}{\v About} and opening the source. -\par\pard\plain\fi0\li0\f1\fs18 \bullet Minor cosmetic changes -\par\pard\plain\f1\fs24\qc\cf2\b 2.0 - June 13th, 1998 -\par\pard\plain\fi0\li0\f1\fs18 \bullet Sounds customization. Now you can customize {\b PumpKIN} bells and whistles or turn them off completely. -\par\pard\plain\fi0\li0\f1\fs18 \bullet Previous version of {\b PumpKIN} had a bug causing it to misbehave when you're requesting file from remote {\i tftp} server using {\b IP Address} (as opposed to {\b hostname}). -\par\pard\plain\fi0\li0\f1\fs18 \bullet Typo causing {\b PumpKIN} to log outgoing request in reverse (i.e. {\i Requesting 'hostname' from 'filename'}) fixed. -\par\pard\plain\fi0\li0\f1\fs18 \bullet Something else that you may not notice and I can not remember. -\par\pard\plain\f1\fs24\qc\cf2\b 1.5 - February 12th, 1998 -\par\pard\plain\fi0\li0\f1\fs18 \bullet Transfer resumes. No checking on file contents is done, so it's up to you to decide whether you want to start transmission from the beginning or resume unfinished transfer. -\par\pard\plain\fi0\li0\f1\fs18 \bullet Support for {\b block size}, {\b trasnfer size} and {\b transfer timeout} options as described in {\uldb {\b RFC1782}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1782.txt")}, {\uldb {\b RFC1783}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1783.txt")} and {\uldb {\b RFC1784}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1784.txt")}. I'm not sure if there are any other {\i TFTP} implementations supporting this, but at least it makes sense if you use {\b PumpKIN} on both ends. -\par\pard\plain\fi0\li0\f1\fs18 \bullet New Install program -\page - -\pard\plain\keepn -#{\footnote Using} -${\footnote Using PumpKIN} -{ \f1\fs18\b\sb120 Using {\b PumpKIN}} -\par\sa120\sb120\qj \f1\fs18\sb120 This is a simple program for file exchange between two parties. It allows you to send files over the network to your party while having a {\uldb {\b T42}}{\v %!ExecFile("http://kin.klever.net/T42/")} or {\b\cf6 Wintalk} conversation. It uses open sessions to determine IP address of your party. Also you may use it as a {\i TFTP} client/server by itself. To get/put files from/to {\i TFTP} server you need to enter host name/IP address manually in the {\uldb Request Dialog}{\v Request}. -\par\sa120\sb120\qj \f1\fs18\sb120 To Abort transfer(s) currently in progress - select transfer(s) you want to terminate in the list and click {\b Abort xfer} button. -\par\sa120\sb120\qj \f1\fs18\sb120 You may want to hide {\b PumpKIN} window and leave it as a tray icon only. Just click the \{bmct pumpkin.bmp\} icon in the tray or simply close the window. -\par\sa120\sb120\qj \f1\fs18\sb120 Use {\uldb Options}{\v Options} button to set {\b PumpKIN} options. -\par\sa120\sb120\qj \f1\fs18\sb120 You can start and stop {\b PumpKIN}'s {\i TFTP} server by checking and unchecking the {\b Server is running} checkbox in the lower right corner of main {\b PumpKIN} window. -\page - -\pard\plain\keepn -#{\footnote ConfirmRRQ} -${\footnote Confirm Read Request Dialog} -{ \f1\fs18\b\sb120 Confirm Read Request Dialog} -\par\sa120\sb120\qj \f1\fs18\sb120 When the file is requested from your {\i TFTP} server you may choose to {\b Grant Access} to this file or to {\b Deny Access}. If you hesitate to answer for {\uldb {\b Confirmation timeout}}{\v ConfirmationTimeout} ({\i default - 30 seconds}) {\b PumpKIN} defaults to denial of all requests. -\page - -\pard\plain\keepn -#{\footnote ConfirmWRQ} -${\footnote Confirm Write Request Dialog} -{ \f1\fs18\b\sb120 Confirm Write Request Dialog} -\par\sa120\sb120\qj \f1\fs18\sb120 Whenever your party sends you a file you have always a choice to accept it or not. You can also save the file under a different name by choosing the {\b Rename} option. If you already have file with such name you may chose to {\b resume} transfer. No checking on file contents is done. This option may or may not work depending on remote implementation of protocol. It does work if you use {\b PumpKIN} on both ends. If you are still unsure for {\uldb {\b Confirmation timeout}}{\v ConfirmationTimeOut} ({\i default - 30 seconds}) {\b PumpKIN} will make safe decision for you (deny). -\page - -\pard\plain\keepn -#{\footnote Request} -${\footnote Request Dialog} -{ \f1\fs18\b\sb120 Request Dialog} -\par\sa120\sb120\qj \f1\fs18\sb120 Request dialog is aimed to let you form read or write request. You may set the following options:\pard -\par \fi0\li0 \bullet {\b Local File} - You can change the name of the file you're sending (or destination in case you're receiving) right here. You may also use {\b Browse} button to select the file. -\par \fi0\li0 \bullet {\b Remote File} Specifies the name of file on the remote host you're requesting (in case of read request) or the name of file you want your file to appear as (in case of write request). -\par \fi0\li0 \bullet {\b Remote Host} is your party's host or {\i TFTP} server you're requesting file from/sending file to. To refresh the list of your talk windows use {\b REFRESH} button. -\par \fi0\li0 \bullet {\b Type} is the type of transfer as defined in {\uldb {\b RFC1350}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1350.txt")}. Doesn't mean much, really. Defined types are '{\i octet}' or '{\i netascii}'. Default is '{\i octet}'. -\par \fi0\li0 \bullet {\b Block Size} - Use this block size if remote is {\uldb {\b RFC1783}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1783.txt")}-compliant. If remote doesn't support this option {\b PumpKIN} will fallback to 512 bytes per block.\pard -\page - -\pard\plain\keepn -#{\footnote Options} -${\footnote Options} -{ \f1\fs18\b\sb120 Options} -\par\sa120\sb120\qj \f1\fs18\sb120 {\b PumpKIN} options property sheet consists of two tabs. For more information see {\uldb {\b Network}}{\v NetworkOptions} and {\b Server} options. -\page - -\pard\plain\keepn -#{\footnote NetworkOptions} -${\footnote Network Options} -{ \f1\fs18\b\sb120 Network Options}\pard -\par \fi0\li0 \bullet {\b UDP Ports}\pard -\par \fi0\li0 \bullet {\b Listen for incoming connections on port} - specifies the port we're listening to. The default as defined in {\uldb {\b RFC1350}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1350.txt")} is 69. -\par \fi0\li0 \bullet {\b ip address} - ip address to listen to. -\par \fi0\li0 \bullet {\b Send outgoing requests to port} - specifies the port we're going to send all requests to.\pard -\par \fi0\li0 \bullet {\b Default Connection timeout} - if there's no activity for specified time, transfer is considered to be dead and terminated. {\b PumpKIN} tries to propagate this value to remote as described in {\uldb {\b RFC1782}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1782.txt")} and {\uldb {\b RFC1784}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1784.txt")} if possible. -\par \fi0\li0 \bullet {\b Default Block Size} - {\b PumpKIN} tries to negotiate block size with remote using this value unless specified explicitly in request. If remote doesn't support {\uldb {\b RFC1782}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1782.txt")} and {\uldb {\b RFC1783}}{\v %!ExecFile("http://www.rfc-editor.org/rfc/rfc1783.txt")}{\b PumpKIN} falls back to 512 bytes per block.\pard -\page - -\pard\plain\keepn -#{\footnote ServerOptions} -${\footnote Server Options} -{ \f1\fs18\b\sb120 Server Options}\pard -\par \fi0\li0 \bullet {\b TFTP Filesystem root} - Specifies the location of files you're transmitting or where to start looking for them from. Defaults to the directory you start {\b PumpKIN} for the first time from. -\par \fi0\li0 \bullet {\b Allow access to subdirectories} - specifies whether you want allow access to the whole subtree of {\b TFTP Root} or only to the directory itself. -\par \fi0\li0 \bullet {\b Read Request Behavior} - You may choose to automatically agree to give all files requested, to be prompted to confirm these operations, or to deny all requests as if you're not even here. -\par \fi0\li0 \bullet {\b Write Request Behavior} - You may chose to {\b take all files} ({\i not recommended}), to {\b prompt only if file exists already}, {\b Always prompt} or {\b Deny all requests}. -\par \fi0\li0 \bullet {#{\footnote ConfirmationTimeOut}}{\b Confirmation timeout} - this is the time {\b PumpKIN} will wait for you to accept or deny request before it will give up and take default action which is always deny. -\par \fi0\li0 \bullet {\b Log file} - If you want to enable logging to file, set the destination file here.\pard -\page - -\pard\plain\keepn -#{\footnote SoundsOptions} -${\footnote Sounds Options} -{ \f1\fs18\b\sb120 Sounds} -\par\sa120\sb120\qj \f1\fs18\sb120 You can customize {\b PumpKIN} sounds notifications here. There are three customizable sounds defined - {\b Incoming request}, which notifies you about incoming request prompt if you're set to be prompted whenever incoming request occurs. {\b xfer Aborted} - which happens to sound every time transfer is interrupted for whatever reason - time out, explicit kill, denied access, etc. {\b xfer Finished} means that your file was successfully transmitted. -\par\sa120\sb120\qj \f1\fs18\sb120 You can select any {\b .wav} file or one of the predefined sounds from the dropdown list. -\page - -\pard\plain\keepn -#{\footnote ACL} -${\footnote Access Lists} -{ \f1\fs18\b\sb120 Access Lists} -\par\sa120\sb120\qj \f1\fs18\sb120 You can slightly automate your access policies by setting up read/write request behavior for different incoming requests. -\par\sa120\sb120\qj \f1\fs18\sb120 The rule consists of {\b request type}, source network ({\b ip} and {\b netmask}) and {\b action} to take (see also {\uldb Server Options}{\v ServerOptions}). -\par\sa120\sb120\qj \f1\fs18\sb120 When {\b PumpKIN} receives request it goes through the list of rules and bases its decision on the first matching rule. To rearrange order of rules, select the rule you wish to move and use up and down arrows buttons on the right. To remove rule, use the cross button. -\par\sa120\sb120\qj \f1\fs18\sb120 To add a new rule fill in the information about {\b request type}, source {\b address} and {\b netmask} and desired action. Then click on the 'Add new rule' button. -\par\sa120\sb120\qj \f1\fs18\sb120 If you wish to amend the rule, select it in the rules list, change parameters below and click the 'Replace rule' button. -\page -} \ No newline at end of file diff --git a/help/pumpkin.xml b/help/pumpkin.xml deleted file mode 100644 index 486ac82..0000000 --- a/help/pumpkin.xml +++ b/dev/null @@ -1,120 +0,0 @@ - - - - About PumpKIN -

PumpKIN is a program designed to send and receive files over the net while having T42 or Wintalk session running using TFTP () protocol. It includes full-functional TFTP server/client so it may be useful for maintaining CISCO routers and other network equipment.

-

-

Enjoy!

- - -
- - - Added configuration option to bind to specific ip address - Fixed a minor bug that lead to misdiagnosis of the packet from unexpected source - - - Added rejecting of too large file requests with explicit error message about the block size - A bit more elaborate logging - Not closing receive socket until the last ACK receved now - - - Bugfix release - - - Access lists based on request IP address and TFTP opcode for automating access policy - Possibility to start/stop TFTP server, while keeping client functionality intact - Logging to file - Resizable main window - - - more robust solution to the backslash/slash dilemma - A bit more elaborate error reporting - Fixed uninstall procedure so that it works on XP - - - Change of license and opening the source. - Minor cosmetic changes - - - Sounds customization. Now you can customize PumpKIN bells and whistles or turn them off completely. - Previous version of PumpKIN had a bug causing it to misbehave when you're requesting file from remote tftp server using IP Address (as opposed to hostname). - Typo causing PumpKIN to log outgoing request in reverse (i.e. Requesting 'hostname' from 'filename') fixed. - Something else that you may not notice and I can not remember. - - - Transfer resumes. No checking on file contents is done, so it's up to you to decide whether you want to start transmission from the beginning or resume unfinished transfer. - Support for block size, trasnfer size and transfer timeout options as described in , and . I'm not sure if there are any other TFTP implementations supporting this, but at least it makes sense if you use PumpKIN on both ends. - New Install program - - - - Using PumpKIN -

This is a simple program for file exchange between two parties. It allows you to send files over the network to your party while having a T42 or Wintalk conversation. It uses open sessions to determine IP address of your party. Also you may use it as a TFTP client/server by itself. To get/put files from/to TFTP server you need to enter host name/IP address manually in the Request Dialog.

-

To Abort transfer(s) currently in progress - select transfer(s) you want to terminate in the list and click Abort xfer button.

-

You may want to hide PumpKIN window and leave it as a tray icon only. Just click the icon in the tray or simply close the window.

-

Use Options button to set PumpKIN options.

-

You can start and stop PumpKIN's TFTP server by checking and unchecking the Server is running checkbox in the lower right corner of main PumpKIN window.

-
- - Confirm Read Request Dialog -

When the file is requested from your TFTP server you may choose to Grant Access to this file or to Deny Access. If you hesitate to answer for Confirmation timeout (default - 30 seconds) PumpKIN defaults to denial of all requests.

-
- - Confirm Write Request Dialog -

Whenever your party sends you a file you have always a choice to accept it or not. You can also save the file under a different name by choosing the Rename option. If you already have file with such name you may chose to resume transfer. No checking on file contents is done. This option may or may not work depending on remote implementation of protocol. It does work if you use PumpKIN on both ends. If you are still unsure for Confirmation timeout (default - 30 seconds) PumpKIN will make safe decision for you (deny).

-
- - Request Dialog -

Request dialog is aimed to let you form read or write request. You may set the following options:

-
    -
  • Local File - You can change the name of the file you're sending (or destination in case you're receiving) right here. You may also use Browse button to select the file.
  • -
  • Remote File Specifies the name of file on the remote host you're requesting (in case of read request) or the name of file you want your file to appear as (in case of write request).
  • -
  • Remote Host is your party's host or TFTP server you're requesting file from/sending file to. To refresh the list of your talk windows use REFRESH button.
  • -
  • Type is the type of transfer as defined in . Doesn't mean much, really. Defined types are 'octet' or 'netascii'. Default is 'octet'.
  • -
  • Block Size - Use this block size if remote is -compliant. If remote doesn't support this option PumpKIN will fallback to 512 bytes per block.
  • -
-
- - Options -

PumpKIN options property sheet consists of two tabs. For more information see Network and Server options.

-
- - Network Options -
    -
  • UDP Ports -
      -
    • Listen for incoming connections on port - specifies the port we're listening to. The default as defined in is 69.
    • -
    • ip address - ip address to listen to.
    • -
    • Send outgoing requests to port - specifies the port we're going to send all requests to.
    • -
    -
  • -
  • Default Connection timeout - if there's no activity for specified time, transfer is considered to be dead and terminated. PumpKIN tries to propagate this value to remote as described in and if possible.
  • -
  • Default Block Size - PumpKIN tries to negotiate block size with remote using this value unless specified explicitly in request. If remote doesn't support and PumpKIN falls back to 512 bytes per block.
  • -
-
- - Server Options - - - - Sounds -

You can customize PumpKIN sounds notifications here. There are three customizable sounds defined - Incoming request, which notifies you about incoming request prompt if you're set to be prompted whenever incoming request occurs. xfer Aborted - which happens to sound every time transfer is interrupted for whatever reason - time out, explicit kill, denied access, etc. xfer Finished means that your file was successfully transmitted.

-

You can select any .wav file or one of the predefined sounds from the dropdown list.

-
- - Access Lists -

You can slightly automate your access policies by setting up read/write request behavior for different incoming requests.

-

The rule consists of request type, source network (ip and netmask) and action to take (see also Server Options).

-

When PumpKIN receives request it goes through the list of rules and bases its decision on the first matching rule. To rearrange order of rules, select the rule you wish to move and use up and down arrows buttons on the right. To remove rule, use the cross button.

-

To add a new rule fill in the information about request type, source address and netmask and desired action. Then click on the 'Add new rule' button.

-

If you wish to amend the rule, select it in the rules list, change parameters below and click the 'Replace rule' button.

- -
diff --git a/install/Install.clw b/install/Install.clw deleted file mode 100644 index 6775b4c..0000000 --- a/install/Install.clw +++ b/dev/null @@ -1,35 +0,0 @@ -; CLW file contains information for the MFC ClassWizard - -[General Info] -Version=1 -LastClass= -LastTemplate=CDialog -NewFileInclude1=#include "stdafx.h" -NewFileInclude2=#include "install.h" -LastPage=0 - -ClassCount=0 - -ResourceCount=2 -Resource1=IDD_INSTALLING (FALSE) -Resource2=IDD_PATH - -[DLG:IDD_INSTALLING (FALSE)] -Type=1 -Class=? -ControlCount=4 -Control1=IDCANCEL,button,1342295808 -Control2=IDC_DISKS,SysAnimate32,1342242822 -Control3=IDC_STATE,static,1342308736 -Control4=IDC_PROGRESS,msctls_progress32,1342177280 - -[DLG:IDD_PATH] -Type=1 -Class=? -ControlCount=5 -Control1=IDC_PROMPT,static,1342308352 -Control2=IDC_PATH,edit,1350631552 -Control3=IDC_BROWSE,button,1342242816 -Control4=IDOK,button,1342242817 -Control5=IDCANCEL,button,1342242816 - diff --git a/install/custom.rch b/install/custom.rch deleted file mode 100644 index d37b074..0000000 --- a/install/custom.rch +++ b/dev/null @@ -1,10 +0,0 @@ -#ifdef STATI_K -PumpKIN.ex_ rcdata discardable "../releast/pumpkin.ex_" -#else -PumpKIN.ex_ rcdata discardable "../release/pumpkin.ex_" -#endif -PumpKIN.cn_ rcdata discardable "../release/pumpkin.cn_" -PumpKIN.hl_ rcdata discardable "../release/pumpkin.hl_" -#ifdef K_ANNED -mfc42.dl_ rcdata discardable "../redist/mfc42.dl_" -#endif diff --git a/install/install.cpp b/install/install.cpp deleted file mode 100644 index ea27a2c..0000000 --- a/install/install.cpp +++ b/dev/null @@ -1,74 +0,0 @@ -#include "resource.h" -#include "../shared-code/install.h" - -#define VERSION "2.7.3" -#define KINAME "PumpKIN " VERSION -#define SKINAME "PumpKIN" - -BOOL Install(void) -{ -STRING dPath = strFETCH_REG_KEY(HKEY_LOCAL_MACHINE,"Software\\Klever Group",SKINAME "Path"); -STRING kPath = strFETCH_REG_KEY(HKEY_LOCAL_MACHINE,"Software\\Klever Group","KINPath"); -LPCSTR qPath = ((LPCSTR)dPath)?(LPCSTR)dPath:(((LPCSTR)kPath)?(LPSTR)kPath:"C:\\Program Files\\Klever\\Nothings"); -STRING path = REQUESTPATH(" " KINAME,"\nEnter destination path:",qPath); - if(!path) - return NULL; - -#ifdef K_ANNED -STRING sysDir(_MAX_PATH); - GetSystemDirectory(sysDir,_MAX_PATH); - INSTALLFILE("mfc42.dl_",sysDir,"mfc42.dll"); -#endif - - MAKE_PATH(path); -STRING shortPath = GET_SHORT_PATH(path); - if(!shortPath){ - MessageBox(NULL,"Failed to install " KINAME " in specified directory",NULL,MB_ICONERROR|MB_OK); - return FALSE; - } - - if(!( - INSTALLFILE(SKINAME ".ex_",path,SKINAME ".exe") && - INSTALLFILE(SKINAME ".hl_",path,SKINAME ".hlp") && - INSTALLFILE(SKINAME ".cn_",path,SKINAME ".cnt") - )){ - MessageBox(NULL,"Failed to install " KINAME " in specified directory",NULL,MB_ICONERROR|MB_OK); - return FALSE; - } - ADDMENU("Klever Group",SKINAME,path, SKINAME ".exe"); - - strSET_REG_KEY(HKEY_LOCAL_MACHINE,"Software\\Klever Group",SKINAME "Path",path); - strSET_REG_KEY(HKEY_LOCAL_MACHINE,"Software\\Klever Group","KINPath",path); - -FILE* inf=CREATE_INF_FILE(path,SKINAME ".INF"); - if(!inf){ - MessageBox(NULL,"Failed to install " KINAME,NULL,MB_ICONERROR|MB_OK); - return FALSE; - } - INF_FILE_HEADER(inf); - INF_FILE_SECTION(inf,"Uninstall"); - fprintf(inf,"AddReg=kFiles\nDelReg=kReg\nUpdateInis=kMenu\n"); - INF_FILE_SECTION(inf,"kFiles"); - INF_REMOVE_ROOT(inf,SKINAME "Files",shortPath); - INF_REMOVE_FILE(inf,SKINAME "Files",SKINAME ".exe"); - INF_REMOVE_HELP_FILE(inf,SKINAME "Files",SKINAME); - INF_REMOVE_FILE(inf,SKINAME "Files",SKINAME ".inf"); - INF_FILE_SECTION(inf,"kReg"); - INF_UNINSTALL_REG(inf,SKINAME); - INF_FILE_SECTION(inf,"kMenu"); - INF_MENU_GROUP(inf,1,"Klever Group"); - INF_MENU_ITEM(inf,1,SKINAME); - fclose(inf); - - REG_UNINSTALL_COMMAND(SKINAME,"Klever " KINAME,shortPath,SKINAME ".INF","Uninstall"); - REG_UNINSTALL_ICON(SKINAME,path,SKINAME ".exe",0); - REG_UNINSTALL_COMMENT(SKINAME,"Klever PumpKIN"); - REG_UNINSTALL_VERSION(SKINAME,VERSION); - REG_UNINSTALL_LOCATION(SKINAME,path); - REG_UNINSTALL_PUBLISHER(SKINAME,"Klever Group"); - REG_UNINSTALL_URLS(SKINAME,"http://www.klever.net/","http://kin.klever.net/pumpkin/"); - - MessageBox(NULL,KINAME " installed successfully, you may now run it from 'Programs/Klever Group' menu or remove it using Control Panel Add/Remove Programs applet."," Rejoice!",MB_ICONINFORMATION|MB_OK); - - return TRUE; -} diff --git a/install/install.rc b/install/install.rc deleted file mode 100644 index 2dce211..0000000 --- a/install/install.rc +++ b/dev/null @@ -1,182 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -#if defined(APSTUDIO_INVOKED) || defined(FALSE) -#if defined(APSTUDIO_INVOKED) -IDD_INSTALLING$(FALSE) DIALOGEX 0, 0, 200, 74 -#else -IDD_INSTALLING DIALOGEX 0, 0, 200, 74 -#endif -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - PUSHBUTTON "Cancel",IDCANCEL,143,53,50,14,BS_CENTER | BS_VCENTER | - BS_NOTIFY | BS_FLAT,WS_EX_DLGMODALFRAME - CONTROL "Animate1",IDC_DISKS,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,161,7,32,32 - LTEXT "",IDC_STATE,7,7,150,32,SS_NOPREFIX | SS_NOTIFY - CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,7,45, - 186,7,WS_EX_DLGMODALFRAME -END -#endif - -IDD_PATH DIALOGEX 0, 0, 255, 73 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION -EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - LTEXT "",IDC_PROMPT,7,7,241,30 - EDITTEXT IDC_PATH,7,37,195,12,ES_AUTOHSCROLL - PUSHBUTTON "B&rowse..",IDC_BROWSE,208,37,40,12 - DEFPUSHBUTTON "OK",IDOK,69,52,50,14 - PUSHBUTTON "Cancel",IDCANCEL,135,52,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - "IDD_INSTALLING$(FALSE)", DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 193 - TOPMARGIN, 7 - BOTTOMMARGIN, 67 - HORZGUIDE, 39 - END - - IDD_PATH, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 248 - VERTGUIDE, 202 - VERTGUIDE, 208 - TOPMARGIN, 7 - BOTTOMMARGIN, 66 - HORZGUIDE, 37 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""custom.rch""\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON ICON DISCARDABLE "../shared-data/install-icon.ico" - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,7,3,0 - PRODUCTVERSION 2,7,3,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Klever Group (http://www.klever.net/)\0" - VALUE "FileDescription", "INSTALL: PumpKIN, tftp client/daemon\0" - VALUE "FileVersion", "2, 7, 3, 0\0" - VALUE "InternalName", "INSTALL\0" - VALUE "LegalCopyright", "Copyright © 1997-2011 Klever Group (http://www.klever.net/)\0" - VALUE "LegalTrademarks", "Klever Group (http://www.klever.net/)\0" - VALUE "OriginalFilename", "INSTALL.EXE\0" - VALUE "ProductName", "PumpKIN\0" - VALUE "ProductVersion", "2, 7, 3, 0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#include "custom.rch" -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/install/resource.h b/install/resource.h deleted file mode 100644 index ebf7991..0000000 --- a/install/resource.h +++ b/dev/null @@ -1,24 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Install.rc -// -#define IDD_INSTALLING 101 -#define IDD_PATH 102 -#define IDI_ICON 105 -#define IDC_DISKS 1000 -#define IDC_STATE 1001 -#define IDC_PROGRESS 1002 -#define IDC_PROMPT 1003 -#define IDC_PATH 1004 -#define IDC_BROWSE 1005 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 107 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1006 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/makehelp.bat b/makehelp.bat deleted file mode 100644 index 4132ec8..0000000 --- a/makehelp.bat +++ b/dev/null @@ -1,32 +0,0 @@ -@echo off -REM -- First make map file from Microsoft Visual C++ generated resource.h -echo // MAKEHELP.BAT generated Help Map file. Used by PUMPKIN.HPJ. >"help\pumpkin.hm" -echo. >>"help\pumpkin.hm" -echo // Commands (ID_* and IDM_*) >>"help\pumpkin.hm" -makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >>"help\pumpkin.hm" -echo. >>"help\pumpkin.hm" -echo // Prompts (IDP_*) >>"help\pumpkin.hm" -makehm IDP_,HIDP_,0x30000 resource.h >>"help\pumpkin.hm" -echo. >>"help\pumpkin.hm" -echo // Resources (IDR_*) >>"help\pumpkin.hm" -makehm IDR_,HIDR_,0x20000 resource.h >>"help\pumpkin.hm" -echo. >>"help\pumpkin.hm" -echo // Dialogs (IDD_*) >>"help\pumpkin.hm" -makehm IDD_,HIDD_,0x20000 resource.h >>"help\pumpkin.hm" -echo. >>"help\pumpkin.hm" -echo // Frame Controls (IDW_*) >>"help\pumpkin.hm" -makehm IDW_,HIDW_,0x50000 resource.h >>"help\pumpkin.hm" -REM -- Make help for Project PUMPKIN - -echo Building RTF file -xsltproc -o help/pumpkin.rtf shared-code/kinhelp.xsl help/pumpkin.xml -echo Building Win32 Help files -start /wait hcrtf -x "help\pumpkin.hpj" -echo. -if exist Debug\nul copy "help\pumpkin.hlp" Debug -if exist Debug\nul copy "help\pumpkin.cnt" Debug -if exist Release\nul copy "help\pumpkin.hlp" Release -if exist Release\nul copy "help\pumpkin.cnt" Release -if exist Releast\nul copy "help\pumpkin.hlp" Releast -if exist Releast\nul copy "help\pumpkin.cnt" Releast -echo. diff --git a/pumpkin.clw b/pumpkin.clw deleted file mode 100644 index 7fa927b..0000000 --- a/pumpkin.clw +++ b/dev/null @@ -1,329 +0,0 @@ -; CLW file contains information for the MFC ClassWizard - -[General Info] -Version=1 -LastClass=CPropsNetwork -LastTemplate=CComboBox -NewFileInclude1=#include "stdafx.h" -NewFileInclude2=#include "PumpKIN.h" - -ClassCount=14 -Class1=CPumpKINApp -Class2=CPumpKINDlg -Class3=CAboutDlg - -ResourceCount=10 -Resource1=IDD_REQUEST -Resource2=IDD_PUMPKIN_DIALOG -Resource3=IDD_CONFIRM_RRQ -Resource4=IDD_PROPS_SERVER -Class4=CPropsServer -Class5=CPropsNetwork -Resource5=IDD_CONFIRM_WRQ -Resource6=IDD_PROPS_ACL -Class6=CConfirmRRQDlg -Class7=CConfirmWRQDlg -Resource7=IDD_ABOUTBOX -Class8=CRequestDlg -Class9=CResolver -Class10=CRetrier -Class11=CTrayer -Resource8=IDD_PROPS_SOUNDS -Class12=CPropsSounds -Resource9=IDM_POPUPS -Class13=CPropsACL -Class14=CACLTargetCombo -Resource10=IDD_PROPS_NETWORK - -[CLS:CPumpKINApp] -Type=0 -HeaderFile=PumpKIN.h -ImplementationFile=PumpKIN.cpp -Filter=N - -[CLS:CPumpKINDlg] -Type=0 -HeaderFile=PumpKINDlg.h -ImplementationFile=PumpKINDlg.cpp -Filter=W -BaseClass=CDialog -VirtualFilter=dWC -LastObject=CPumpKINDlg - -[CLS:CAboutDlg] -Type=0 -HeaderFile=PumpKINDlg.h -ImplementationFile=PumpKINDlg.cpp -Filter=D -BaseClass=CDialog -VirtualFilter=dWC -LastObject=CAboutDlg - -[DLG:IDD_ABOUTBOX] -Type=1 -Class=CAboutDlg -ControlCount=5 -Control1=IDC_STATIC,static,1342177283 -Control2=IDC_STATIC,static,1342308480 -Control3=IDC_STATIC,static,1342308352 -Control4=IDOK,button,1342373889 -Control5=IDC_KLEVERNET,button,1342242816 - -[DLG:IDD_PUMPKIN_DIALOG] -Type=1 -Class=CPumpKINDlg -ControlCount=10 -Control1=IDC_CONNECTIONS,SysListView32,1350631681 -Control2=IDC_GET,button,1342259200 -Control3=IDC_PUT,button,1342259200 -Control4=IDC_ABORT,button,1342259200 -Control5=IDC_OPTIONS,button,1342259200 -Control6=IDC_EXIT,button,1342259200 -Control7=ID_HELP,button,1342259200 -Control8=IDC_LOG,listbox,1353728385 -Control9=IDCANCEL,button,1073741824 -Control10=IDC_LISTENING,button,1342275619 - -[DLG:IDD_PROPS_SERVER] -Type=1 -Class=CPropsServer -ControlCount=18 -Control1=IDC_STATIC,button,1342177287 -Control2=IDC_TFTPROOT,edit,1350631552 -Control3=IDC_BROWSE,button,1342242880 -Control4=IDC_TFTPSUBDIRS,button,1342242819 -Control5=IDC_STATIC,button,1342177287 -Control6=IDC_RRQ_GIVEALL,button,1342324745 -Control7=IDC_RRQ_ALWAYSCONFIRM,button,1342193673 -Control8=IDC_RRQ_DENYALL,button,1342193673 -Control9=IDC_STATIC,button,1342308359 -Control10=IDC_WRQ_TAKEALL,button,1342308361 -Control11=IDC_WRQ_PROMPTEXISTING,button,1342177289 -Control12=IDC_WRQ_ALWAYSCONFIRM,button,1342177289 -Control13=IDC_WRQ_DENYALL,button,1342177289 -Control14=IDC_STATIC,static,1342308609 -Control15=IDC_PROMPTTIMEOUT,msctls_trackbar32,1342242823 -Control16=IDC_STATIC,button,1342177287 -Control17=IDC_LOGFILE,edit,1350631552 -Control18=IDC_LOGFILE_BROWSE,button,1342242880 - -[DLG:IDD_PROPS_NETWORK] -Type=1 -Class=CPropsNetwork -ControlCount=17 -Control1=IDC_STATIC,button,1342177287 -Control2=IDC_STATIC,static,1342308354 -Control3=IDC_LISTENPORT,edit,1350631552 -Control4=IDC_LISTENSPIN,msctls_updown32,1342177463 -Control5=IDC_STATIC,static,1342308354 -Control6=IDC_SPEAKPORT,edit,1350631552 -Control7=IDC_SPEAKSPIN,msctls_updown32,1342177463 -Control8=IDC_STATIC,static,1342308352 -Control9=IDC_TIMEOUT,edit,1350639744 -Control10=IDC_TIMESPIN,msctls_updown32,1342177463 -Control11=IDC_STATIC,static,1342308352 -Control12=IDC_STATIC,static,1342308352 -Control13=IDC_STATIC,static,1342308352 -Control14=IDC_BLOCKSIZE,edit,1350639744 -Control15=IDC_BSIZESPIN,msctls_updown32,1342177463 -Control16=IDC_STATIC,static,1342308354 -Control17=IDC_LISTENADDRESS,edit,1350631552 - -[CLS:CPropsServer] -Type=0 -HeaderFile=PropsServer.h -ImplementationFile=PropsServer.cpp -BaseClass=CPropertyPage -Filter=D -VirtualFilter=idWC -LastObject=CPropsServer - -[CLS:CPropsNetwork] -Type=0 -HeaderFile=PropsNetwork.h -ImplementationFile=PropsNetwork.cpp -BaseClass=CPropertyPage -Filter=D -VirtualFilter=idWC -LastObject=IDC_LISTENADDRESS - -[DLG:IDD_CONFIRM_RRQ] -Type=1 -Class=CConfirmRRQDlg -ControlCount=9 -Control1=IDOK,button,1342242817 -Control2=IDCANCEL,button,1342242816 -Control3=IDC_STATIC,static,1342308352 -Control4=IDC_HOST,static,1350701313 -Control5=IDC_STATIC,static,1342308353 -Control6=IDC_FILE,static,1350701313 -Control7=IDC_STATIC,static,1342177296 -Control8=IDC_STATIC,static,1342177283 -Control9=IDC_STATIC,static,1342177283 - -[DLG:IDD_CONFIRM_WRQ] -Type=1 -Class=CConfirmWRQDlg -ControlCount=11 -Control1=IDOK,button,1342242817 -Control2=IDC_RENAME,button,1342242816 -Control3=IDCANCEL,button,1342242816 -Control4=IDC_STATIC,static,1342308352 -Control5=IDC_HOST,static,1350701313 -Control6=IDC_STATIC,static,1342308353 -Control7=IDC_FILE,static,1350701313 -Control8=IDC_STATIC,static,1342177296 -Control9=IDC_STATIC,static,1342177283 -Control10=IDC_STATIC,static,1342177283 -Control11=IDC_RESUME,button,1342242816 - -[CLS:CConfirmRRQDlg] -Type=0 -HeaderFile=ConfirmRRQDlg.h -ImplementationFile=ConfirmRRQDlg.cpp -BaseClass=CDialog -Filter=D -VirtualFilter=dWC -LastObject=CConfirmRRQDlg - -[CLS:CConfirmWRQDlg] -Type=0 -HeaderFile=ConfirmWRQDlg.h -ImplementationFile=ConfirmWRQDlg.cpp -BaseClass=CDialog -Filter=D -VirtualFilter=dWC -LastObject=IDC_RESUME - -[DLG:IDD_REQUEST] -Type=1 -Class=CRequestDlg -ControlCount=15 -Control1=IDC_STATIC,static,1342308608 -Control2=IDC_LOCALFILE,edit,1350631552 -Control3=IDC_BROWSE,button,1342242880 -Control4=IDC_STATIC,static,1342308608 -Control5=IDC_REMOTEFILE,edit,1350631552 -Control6=IDC_STATIC,static,1342308608 -Control7=IDC_TALKS,combobox,1344341313 -Control8=IDC_REFRESH,button,1342271232 -Control9=IDC_STATIC,static,1342308352 -Control10=IDC_TYPE,combobox,1344356418 -Control11=IDC_STATIC,static,1342308352 -Control12=IDC_BSIZE,combobox,1344339970 -Control13=IDOK,button,1342242817 -Control14=IDCANCEL,button,1342242816 -Control15=IDC_STATIC,static,1342177297 - -[CLS:CRequestDlg] -Type=0 -HeaderFile=RequestDlg.h -ImplementationFile=RequestDlg.cpp -BaseClass=CDialog -Filter=W -VirtualFilter=dWC -LastObject=CRequestDlg - -[CLS:CResolver] -Type=0 -HeaderFile=Resolver.h -ImplementationFile=Resolver.cpp -BaseClass=CWnd -Filter=W -LastObject=CResolver -VirtualFilter=WC - -[MNU:IDM_POPUPS] -Type=1 -Class=CPumpKINDlg -Command1=ID_TRAY_SENDFILE -Command2=ID_TRAY_FETCHFILE -Command3=ID_TRAY_OPTIONS -Command4=ID_TRAY_LISTEN -Command5=ID_TRAY_SHOWPUMPKINWINDOW -Command6=ID_TRAY_OPENFILESFOLDER -Command7=ID_TRAY_HELP -Command8=ID_TRAY_ABOUTPUMPKIN -Command9=ID_TRAY_EXIT -CommandCount=9 - -[CLS:CRetrier] -Type=0 -HeaderFile=Retrier.h -ImplementationFile=Retrier.cpp -BaseClass=CWnd -Filter=W -LastObject=CRetrier -VirtualFilter=WC - -[CLS:CTrayer] -Type=0 -HeaderFile=Trayer.h -ImplementationFile=Trayer.cpp -BaseClass=CWnd -Filter=W -LastObject=CTrayer -VirtualFilter=WC - -[DLG:IDD_PROPS_SOUNDS] -Type=1 -Class=CPropsSounds -ControlCount=12 -Control1=IDC_STATIC,static,1342308352 -Control2=IDC_RING,combobox,1344340290 -Control3=IDC_RING_BROWSE,button,1342242880 -Control4=IDC_RING_PLAY,button,1342242880 -Control5=IDC_STATIC,static,1342308352 -Control6=IDC_FINISHED,combobox,1344340290 -Control7=IDC_FINISHED_BROWSE,button,1342242880 -Control8=IDC_FINISHED_PLAY,button,1342242880 -Control9=IDC_STATIC,static,1342308352 -Control10=IDC_ABORTED,combobox,1344340290 -Control11=IDC_ABORTED_BROWSE,button,1342242880 -Control12=IDC_ABORTED_PLAY,button,1342242880 - -[CLS:CPropsSounds] -Type=0 -HeaderFile=PropsSounds.h -ImplementationFile=PropsSounds.cpp -BaseClass=CPropertyPage -Filter=D -LastObject=CPropsSounds -VirtualFilter=idWC - -[DLG:IDD_PROPS_ACL] -Type=1 -Class=CPropsACL -ControlCount=14 -Control1=IDC_ACL_LIST,SysListView32,1350631425 -Control2=IDC_ACL_UP,button,1342246720 -Control3=IDC_ACL_DOWN,button,1342246720 -Control4=IDC_ACL_REMOVE,button,1342246720 -Control5=IDC_STATIC,static,1342308352 -Control6=IDC_ACL_XFER,combobox,1344339971 -Control7=IDC_STATIC,static,1342308352 -Control8=IDC_ACL_ADDR,edit,1350631552 -Control9=IDC_STATIC,static,1342308352 -Control10=IDC_ACL_NETMASK,edit,1350631552 -Control11=IDC_STATIC,static,1342308352 -Control12=IDC_ACL_RULE,combobox,1344339971 -Control13=IDC_ACL_ADD,button,1342242816 -Control14=IDC_ACL_REPLACE,button,1342242816 - -[CLS:CPropsACL] -Type=0 -HeaderFile=PropsACL.h -ImplementationFile=PropsACL.cpp -BaseClass=CPropertyPage -Filter=D -LastObject=CPropsACL -VirtualFilter=idWC - -[CLS:CACLTargetCombo] -Type=0 -HeaderFile=ACLTargetCombo.h -ImplementationFile=ACLTargetCombo.cpp -BaseClass=CComboBox -Filter=W -LastObject=CACLTargetCombo - diff --git a/pumpkin.cpp b/pumpkin.cpp deleted file mode 100644 index c086fb3..0000000 --- a/pumpkin.cpp +++ b/dev/null @@ -1,69 +0,0 @@ -// PumpKIN.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "PumpKIN.h" -#include "PumpKINDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPumpKINApp - -BEGIN_MESSAGE_MAP(CPumpKINApp, CWinApp) - //{{AFX_MSG_MAP(CPumpKINApp) - //}}AFX_MSG - ON_COMMAND(ID_HELP, CWinApp::OnHelp) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPumpKINApp construction - -CPumpKINApp::CPumpKINApp() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CPumpKINApp object - -CPumpKINApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CPumpKINApp initialization - -BOOL CPumpKINApp::InitInstance() -{ - if (!AfxSocketInit()) - { - AfxMessageBox(IDP_SOCKETS_INIT_FAILED); - return FALSE; - } - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - -#ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL -#else - Enable3dControlsStatic(); // Call this when linking to MFC statically -#endif - - SetRegistryKey(IDS_REGISTRYKEY); - m_HelpFile = m_pszHelpFilePath; - m_HelpFile+=">Standard"; - m_pszHelpFilePath=(LPCTSTR)m_HelpFile; - - CPumpKINDlg dlg; - m_pMainWnd = &dlg; - int nResponse = dlg.DoModal(); - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} diff --git a/pumpkin.h b/pumpkin.h deleted file mode 100644 index 71c720e..0000000 --- a/pumpkin.h +++ b/dev/null @@ -1,36 +0,0 @@ -// PumpKIN.h : main header file for the PUMPKIN application -// - -#ifndef __AFXWIN_H__ - #error include 'stdafx.h' before including this file for PCH -#endif - -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CPumpKINApp: -// See PumpKIN.cpp for the implementation of this class -// - -class CPumpKINApp : public CWinApp -{ -public: - CString m_HelpFile; - CPumpKINApp(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPumpKINApp) - public: - virtual BOOL InitInstance(); - //}}AFX_VIRTUAL - -// Implementation - - //{{AFX_MSG(CPumpKINApp) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - - -///////////////////////////////////////////////////////////////////////////// diff --git a/pumpkin.icns b/pumpkin.icns new file mode 100644 index 0000000..91a9dfd --- a/dev/null +++ b/pumpkin.icns Binary files differ diff --git a/pumpkin.mak b/pumpkin.mak deleted file mode 100644 index bf9e895..0000000 --- a/pumpkin.mak +++ b/dev/null @@ -1,1583 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -!IF "$(CFG)" == "" -CFG=Install - Win32 Debug -!MESSAGE No configuration specified. Defaulting to Install - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "PumpKIN - Win32 Release" && "$(CFG)" !=\ - "PumpKIN - Win32 Debug" && "$(CFG)" != "PumpKIN - Win32 Static" && "$(CFG)" !=\ - "Install - Win32 Debug" && "$(CFG)" != "Install - Win32 Pure" && "$(CFG)" !=\ - "Install - Win32 Static" && "$(CFG)" != "Install - Win32 Canned" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE on this makefile -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pumpkin.mak" CFG="Install - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "PumpKIN - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "PumpKIN - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE "PumpKIN - Win32 Static" (based on "Win32 (x86) Application") -!MESSAGE "Install - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE "Install - Win32 Pure" (based on "Win32 (x86) Application") -!MESSAGE "Install - Win32 Static" (based on "Win32 (x86) Application") -!MESSAGE "Install - Win32 Canned" (based on "Win32 (x86) Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF -################################################################################ -# Begin Project -# PROP Target_Last_Scanned "PumpKIN - Win32 Debug" -CPP=cl.exe -RSC=rc.exe -MTL=mktyplib.exe - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\Release -TargetName=pumpkin -# End Custom Macros - -ALL : "$(OUTDIR)\pumpkin.exe" "$(OUTDIR)\pumpkin.ex_" "$(OUTDIR)\pumpkin.hlp"\ - "$(OUTDIR)\pumpkin.cnt" "$(OUTDIR)\pumpkin.hl_" "$(OUTDIR)\pumpkin.cn_" - -CLEAN : - -@erase "$(INTDIR)\ACLTargetCombo.obj" - -@erase "$(INTDIR)\ConfirmRRQDlg.obj" - -@erase "$(INTDIR)\ConfirmWRQDlg.obj" - -@erase "$(INTDIR)\PropsACL.obj" - -@erase "$(INTDIR)\PropsNetwork.obj" - -@erase "$(INTDIR)\PropsServer.obj" - -@erase "$(INTDIR)\PropsSounds.obj" - -@erase "$(INTDIR)\pumpkin.cn_" - -@erase "$(INTDIR)\pumpkin.cnt" - -@erase "$(INTDIR)\pumpkin.hl_" - -@erase "$(INTDIR)\pumpkin.hlp" - -@erase "$(INTDIR)\PumpKIN.obj" - -@erase "$(INTDIR)\pumpkin.pch" - -@erase "$(INTDIR)\pumpkin.res" - -@erase "$(INTDIR)\PumpKINDlg.obj" - -@erase "$(INTDIR)\RequestDlg.obj" - -@erase "$(INTDIR)\Resolver.obj" - -@erase "$(INTDIR)\Retrier.obj" - -@erase "$(INTDIR)\StdAfx.obj" - -@erase "$(INTDIR)\Trayer.obj" - -@erase "$(OUTDIR)\pumpkin.ex_" - -@erase "$(OUTDIR)\pumpkin.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c -# ADD CPP /nologo /Zp1 /MD /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c -CPP_PROJ=/nologo /Zp1 /MD /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ - "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)/pumpkin.pch" /Yu"stdafx.h" /Fo"$(INTDIR)/"\ - /c -CPP_OBJS=.\Release/ -CPP_SBRS=.\. -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/pumpkin.res" /d "NDEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/pumpkin.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 -LINK32_FLAGS=/nologo /subsystem:windows /incremental:no\ - /pdb:"$(OUTDIR)/pumpkin.pdb" /machine:I386 /out:"$(OUTDIR)/pumpkin.exe" -LINK32_OBJS= \ - "$(INTDIR)\ACLTargetCombo.obj" \ - "$(INTDIR)\ConfirmRRQDlg.obj" \ - "$(INTDIR)\ConfirmWRQDlg.obj" \ - "$(INTDIR)\PropsACL.obj" \ - "$(INTDIR)\PropsNetwork.obj" \ - "$(INTDIR)\PropsServer.obj" \ - "$(INTDIR)\PropsSounds.obj" \ - "$(INTDIR)\PumpKIN.obj" \ - "$(INTDIR)\pumpkin.res" \ - "$(INTDIR)\PumpKINDlg.obj" \ - "$(INTDIR)\RequestDlg.obj" \ - "$(INTDIR)\Resolver.obj" \ - "$(INTDIR)\Retrier.obj" \ - "$(INTDIR)\StdAfx.obj" \ - "$(INTDIR)\Trayer.obj" - -"$(OUTDIR)\pumpkin.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -# Begin Custom Build -OutDir=.\Release -TargetName=pumpkin -InputPath=.\Release\pumpkin.exe -SOURCE=$(InputPath) - -"$(OutDir)\$(TargetName).ex_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - compress $(OutDir)\$(TargetName).exe $(OutDir)\$(TargetName).ex_ - -# End Custom Build - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\Debug -TargetName=pumpkin -# End Custom Macros - -ALL : "$(OUTDIR)\pumpkin.exe" "$(OUTDIR)\pumpkin.bsc" "$(OUTDIR)\pumpkin.ex_"\ - "$(OUTDIR)\pumpkin.hlp" "$(OUTDIR)\pumpkin.cnt" "$(OUTDIR)\pumpkin.hl_"\ - "$(OUTDIR)\pumpkin.cn_" - -CLEAN : - -@erase "$(INTDIR)\ACLTargetCombo.obj" - -@erase "$(INTDIR)\ACLTargetCombo.sbr" - -@erase "$(INTDIR)\ConfirmRRQDlg.obj" - -@erase "$(INTDIR)\ConfirmRRQDlg.sbr" - -@erase "$(INTDIR)\ConfirmWRQDlg.obj" - -@erase "$(INTDIR)\ConfirmWRQDlg.sbr" - -@erase "$(INTDIR)\PropsACL.obj" - -@erase "$(INTDIR)\PropsACL.sbr" - -@erase "$(INTDIR)\PropsNetwork.obj" - -@erase "$(INTDIR)\PropsNetwork.sbr" - -@erase "$(INTDIR)\PropsServer.obj" - -@erase "$(INTDIR)\PropsServer.sbr" - -@erase "$(INTDIR)\PropsSounds.obj" - -@erase "$(INTDIR)\PropsSounds.sbr" - -@erase "$(INTDIR)\pumpkin.cn_" - -@erase "$(INTDIR)\pumpkin.cnt" - -@erase "$(INTDIR)\pumpkin.hl_" - -@erase "$(INTDIR)\pumpkin.hlp" - -@erase "$(INTDIR)\PumpKIN.obj" - -@erase "$(INTDIR)\pumpkin.pch" - -@erase "$(INTDIR)\pumpkin.res" - -@erase "$(INTDIR)\PumpKIN.sbr" - -@erase "$(INTDIR)\PumpKINDlg.obj" - -@erase "$(INTDIR)\PumpKINDlg.sbr" - -@erase "$(INTDIR)\RequestDlg.obj" - -@erase "$(INTDIR)\RequestDlg.sbr" - -@erase "$(INTDIR)\Resolver.obj" - -@erase "$(INTDIR)\Resolver.sbr" - -@erase "$(INTDIR)\Retrier.obj" - -@erase "$(INTDIR)\Retrier.sbr" - -@erase "$(INTDIR)\StdAfx.obj" - -@erase "$(INTDIR)\StdAfx.sbr" - -@erase "$(INTDIR)\Trayer.obj" - -@erase "$(INTDIR)\Trayer.sbr" - -@erase "$(INTDIR)\vc40.idb" - -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\pumpkin.bsc" - -@erase "$(OUTDIR)\pumpkin.ex_" - -@erase "$(OUTDIR)\pumpkin.exe" - -@erase "$(OUTDIR)\pumpkin.ilk" - -@erase "$(OUTDIR)\pumpkin.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c -# ADD CPP /nologo /Zp1 /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /c -CPP_PROJ=/nologo /Zp1 /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D\ - "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/pumpkin.pch"\ - /Yu"stdafx.h" /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\Debug/ -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /win32 -MTL_PROJ=/nologo /D "_DEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/pumpkin.res" /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/pumpkin.bsc" -BSC32_SBRS= \ - "$(INTDIR)\ACLTargetCombo.sbr" \ - "$(INTDIR)\ConfirmRRQDlg.sbr" \ - "$(INTDIR)\ConfirmWRQDlg.sbr" \ - "$(INTDIR)\PropsACL.sbr" \ - "$(INTDIR)\PropsNetwork.sbr" \ - "$(INTDIR)\PropsServer.sbr" \ - "$(INTDIR)\PropsSounds.sbr" \ - "$(INTDIR)\PumpKIN.sbr" \ - "$(INTDIR)\PumpKINDlg.sbr" \ - "$(INTDIR)\RequestDlg.sbr" \ - "$(INTDIR)\Resolver.sbr" \ - "$(INTDIR)\Retrier.sbr" \ - "$(INTDIR)\StdAfx.sbr" \ - "$(INTDIR)\Trayer.sbr" - -"$(OUTDIR)\pumpkin.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 -LINK32_FLAGS=/nologo /subsystem:windows /incremental:yes\ - /pdb:"$(OUTDIR)/pumpkin.pdb" /debug /machine:I386 /out:"$(OUTDIR)/pumpkin.exe" -LINK32_OBJS= \ - "$(INTDIR)\ACLTargetCombo.obj" \ - "$(INTDIR)\ConfirmRRQDlg.obj" \ - "$(INTDIR)\ConfirmWRQDlg.obj" \ - "$(INTDIR)\PropsACL.obj" \ - "$(INTDIR)\PropsNetwork.obj" \ - "$(INTDIR)\PropsServer.obj" \ - "$(INTDIR)\PropsSounds.obj" \ - "$(INTDIR)\PumpKIN.obj" \ - "$(INTDIR)\pumpkin.res" \ - "$(INTDIR)\PumpKINDlg.obj" \ - "$(INTDIR)\RequestDlg.obj" \ - "$(INTDIR)\Resolver.obj" \ - "$(INTDIR)\Retrier.obj" \ - "$(INTDIR)\StdAfx.obj" \ - "$(INTDIR)\Trayer.obj" - -"$(OUTDIR)\pumpkin.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -# Begin Custom Build -OutDir=.\Debug -TargetName=pumpkin -InputPath=.\Debug\pumpkin.exe -SOURCE=$(InputPath) - -"$(OutDir)\$(TargetName).ex_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - compress $(OutDir)\$(TargetName).exe $(OutDir)\$(TargetName).ex_ - -# End Custom Build - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "PumpKIN_" -# PROP BASE Intermediate_Dir "PumpKIN_" -# PROP BASE Target_Dir "" -# PROP Use_MFC 5 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Releast" -# PROP Intermediate_Dir "Releast" -# PROP Target_Dir "" -OUTDIR=.\Releast -INTDIR=.\Releast -# Begin Custom Macros -OutDir=.\Releast -TargetName=pumpkin -# End Custom Macros - -ALL : "$(OUTDIR)\pumpkin.exe" "$(OUTDIR)\pumpkin.ex_" "$(OUTDIR)\pumpkin.hlp"\ - "$(OUTDIR)\pumpkin.cnt" "$(OUTDIR)\pumpkin.hl_" "$(OUTDIR)\pumpkin.cn_" - -CLEAN : - -@erase "$(INTDIR)\ACLTargetCombo.obj" - -@erase "$(INTDIR)\ConfirmRRQDlg.obj" - -@erase "$(INTDIR)\ConfirmWRQDlg.obj" - -@erase "$(INTDIR)\PropsACL.obj" - -@erase "$(INTDIR)\PropsNetwork.obj" - -@erase "$(INTDIR)\PropsServer.obj" - -@erase "$(INTDIR)\PropsSounds.obj" - -@erase "$(INTDIR)\pumpkin.cn_" - -@erase "$(INTDIR)\pumpkin.cnt" - -@erase "$(INTDIR)\pumpkin.hl_" - -@erase "$(INTDIR)\pumpkin.hlp" - -@erase "$(INTDIR)\PumpKIN.obj" - -@erase "$(INTDIR)\pumpkin.pch" - -@erase "$(INTDIR)\pumpkin.res" - -@erase "$(INTDIR)\PumpKINDlg.obj" - -@erase "$(INTDIR)\RequestDlg.obj" - -@erase "$(INTDIR)\Resolver.obj" - -@erase "$(INTDIR)\Retrier.obj" - -@erase "$(INTDIR)\StdAfx.obj" - -@erase "$(INTDIR)\Trayer.obj" - -@erase "$(OUTDIR)\pumpkin.ex_" - -@erase "$(OUTDIR)\pumpkin.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /Zp1 /MD /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c -# ADD CPP /nologo /Zp1 /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /c -CPP_PROJ=/nologo /Zp1 /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ - "_MBCS" /Fp"$(INTDIR)/pumpkin.pch" /Yu"stdafx.h" /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Releast/ -CPP_SBRS=.\. -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/pumpkin.res" /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/pumpkin.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 -LINK32_FLAGS=/nologo /subsystem:windows /incremental:no\ - /pdb:"$(OUTDIR)/pumpkin.pdb" /machine:I386 /out:"$(OUTDIR)/pumpkin.exe" -LINK32_OBJS= \ - "$(INTDIR)\ACLTargetCombo.obj" \ - "$(INTDIR)\ConfirmRRQDlg.obj" \ - "$(INTDIR)\ConfirmWRQDlg.obj" \ - "$(INTDIR)\PropsACL.obj" \ - "$(INTDIR)\PropsNetwork.obj" \ - "$(INTDIR)\PropsServer.obj" \ - "$(INTDIR)\PropsSounds.obj" \ - "$(INTDIR)\PumpKIN.obj" \ - "$(INTDIR)\pumpkin.res" \ - "$(INTDIR)\PumpKINDlg.obj" \ - "$(INTDIR)\RequestDlg.obj" \ - "$(INTDIR)\Resolver.obj" \ - "$(INTDIR)\Retrier.obj" \ - "$(INTDIR)\StdAfx.obj" \ - "$(INTDIR)\Trayer.obj" - -"$(OUTDIR)\pumpkin.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -# Begin Custom Build -OutDir=.\Releast -TargetName=pumpkin -InputPath=.\Releast\pumpkin.exe -SOURCE=$(InputPath) - -"$(OutDir)\$(TargetName).ex_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - compress $(OutDir)\$(TargetName).exe $(OutDir)\$(TargetName).ex_ - -# End Custom Build - -!ELSEIF "$(CFG)" == "Install - Win32 Debug" - -# PROP BASE Use_MFC 2 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Install\Debug" -# PROP BASE Intermediate_Dir "Install\Debug" -# PROP BASE Target_Dir "Install" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Install\Debug" -# PROP Intermediate_Dir "Install\Debug" -# PROP Target_Dir "Install" -OUTDIR=.\Install\Debug -INTDIR=.\Install\Debug - -ALL : "$(OUTDIR)\Install.exe" - -CLEAN : - -@erase "$(INTDIR)\install.obj" - -@erase "$(INTDIR)\Install.res" - -@erase "$(INTDIR)\vc40.idb" - -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\Install.exe" - -@erase "$(OUTDIR)\Install.ilk" - -@erase "$(OUTDIR)\Install.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /YX /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /c -CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\ - /D "_MBCS" /Fp"$(INTDIR)/Install.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c -CPP_OBJS=.\Install\Debug/ -CPP_SBRS=.\. -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /win32 -MTL_PROJ=/nologo /D "_DEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "_DEBUG" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Install.res" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/Install.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib version.lib /nologo /subsystem:windows /debug /machine:I386 -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib version.lib /nologo /subsystem:windows /incremental:yes\ - /pdb:"$(OUTDIR)/Install.pdb" /debug /machine:I386 /out:"$(OUTDIR)/Install.exe" -LINK32_OBJS= \ - "$(INTDIR)\install.obj" \ - "$(INTDIR)\Install.res" - -"$(OUTDIR)\Install.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "Install - Win32 Pure" - -# PROP BASE Use_MFC 2 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Install\Pure" -# PROP BASE Intermediate_Dir "Install\Pure" -# PROP BASE Target_Dir "Install" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Install\Pure" -# PROP Intermediate_Dir "Install\Pure" -# PROP Target_Dir "Install" -OUTDIR=.\Install\Pure -INTDIR=.\Install\Pure - -ALL : "$(OUTDIR)\Install.exe" "$(OUTDIR)\Install.bsc" - -CLEAN : - -@erase "$(INTDIR)\install.obj" - -@erase "$(INTDIR)\Install.res" - -@erase "$(INTDIR)\install.sbr" - -@erase "$(OUTDIR)\Install.bsc" - -@erase "$(OUTDIR)\Install.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /YX /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /c -CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ - "_MBCS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/Install.pch" /YX /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Install\Pure/ -CPP_SBRS=.\Install\Pure/ -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Install.res" /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/Install.bsc" -BSC32_SBRS= \ - "$(INTDIR)\install.sbr" - -"$(OUTDIR)\Install.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib version.lib /nologo /subsystem:windows /machine:I386 -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib version.lib /nologo /subsystem:windows /incremental:no\ - /pdb:"$(OUTDIR)/Install.pdb" /machine:I386 /out:"$(OUTDIR)/Install.exe" -LINK32_OBJS= \ - "$(INTDIR)\install.obj" \ - "$(INTDIR)\Install.res" - -"$(OUTDIR)\Install.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "Install - Win32 Static" - -# PROP BASE Use_MFC 2 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Install\Static" -# PROP BASE Intermediate_Dir "Install\Static" -# PROP BASE Target_Dir "Install" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Install\Static" -# PROP Intermediate_Dir "Install\Static" -# PROP Target_Dir "Install" -OUTDIR=.\Install\Static -INTDIR=.\Install\Static - -ALL : "$(OUTDIR)\Install.exe" - -CLEAN : - -@erase "$(INTDIR)\install.obj" - -@erase "$(INTDIR)\Install.res" - -@erase "$(OUTDIR)\Install.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /YX /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "STATI_K" /YX /c -CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ - "_MBCS" /D "STATI_K" /Fp"$(INTDIR)/Install.pch" /YX /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Install\Static/ -CPP_SBRS=.\. -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" /d "STATI_K" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Install.res" /d "NDEBUG" /d "STATI_K" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/Install.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib version.lib /nologo /subsystem:windows /machine:I386 -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib version.lib /nologo /subsystem:windows /incremental:no\ - /pdb:"$(OUTDIR)/Install.pdb" /machine:I386 /out:"$(OUTDIR)/Install.exe" -LINK32_OBJS= \ - "$(INTDIR)\install.obj" \ - "$(INTDIR)\Install.res" - -"$(OUTDIR)\Install.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "Install - Win32 Canned" - -# PROP BASE Use_MFC 2 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Install\Canned" -# PROP BASE Intermediate_Dir "Install\Canned" -# PROP BASE Target_Dir "Install" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Install\Canned" -# PROP Intermediate_Dir "Install\Canned" -# PROP Target_Dir "Install" -OUTDIR=.\Install\Canned -INTDIR=.\Install\Canned - -ALL : "$(OUTDIR)\Install.exe" - -CLEAN : - -@erase "$(INTDIR)\install.obj" - -@erase "$(INTDIR)\Install.res" - -@erase "$(OUTDIR)\Install.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /YX /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "K_ANNED" /YX /c -CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ - "_MBCS" /D "K_ANNED" /Fp"$(INTDIR)/Install.pch" /YX /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Install\Canned/ -CPP_SBRS=.\. -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" /d "K_ANNED" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Install.res" /d "NDEBUG" /d "K_ANNED" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/Install.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib version.lib /nologo /subsystem:windows /machine:I386 -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib version.lib /nologo /subsystem:windows /incremental:no\ - /pdb:"$(OUTDIR)/Install.pdb" /machine:I386 /out:"$(OUTDIR)/Install.exe" -LINK32_OBJS= \ - "$(INTDIR)\install.obj" \ - "$(INTDIR)\Install.res" - -"$(OUTDIR)\Install.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -################################################################################ -# Begin Target - -# Name "PumpKIN - Win32 Release" -# Name "PumpKIN - Win32 Debug" -# Name "PumpKIN - Win32 Static" - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - -!ENDIF - -################################################################################ -# Begin Source File - -SOURCE=.\PumpKIN.cpp -DEP_CPP_PUMPK=\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\PumpKIN.obj" : $(SOURCE) $(DEP_CPP_PUMPK) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\PumpKIN.obj" : $(SOURCE) $(DEP_CPP_PUMPK) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\PumpKIN.sbr" : $(SOURCE) $(DEP_CPP_PUMPK) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\PumpKIN.obj" : $(SOURCE) $(DEP_CPP_PUMPK) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\PumpKINDlg.cpp - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - -DEP_CPP_PUMPKI=\ - ".\ACLTargetCombo.h"\ - ".\ConfirmRRQDlg.h"\ - ".\ConfirmWRQDlg.h"\ - ".\PropsACL.h"\ - ".\PropsNetwork.h"\ - ".\PropsServer.h"\ - ".\PropsSounds.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\RequestDlg.h"\ - ".\Resolver.h"\ - ".\Retrier.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - ".\Trayer.h"\ - - -"$(INTDIR)\PumpKINDlg.obj" : $(SOURCE) $(DEP_CPP_PUMPKI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - -DEP_CPP_PUMPKI=\ - ".\ACLTargetCombo.h"\ - ".\ConfirmRRQDlg.h"\ - ".\ConfirmWRQDlg.h"\ - ".\PropsACL.h"\ - ".\PropsNetwork.h"\ - ".\PropsServer.h"\ - ".\PropsSounds.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\RequestDlg.h"\ - ".\Resolver.h"\ - ".\Retrier.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - ".\Trayer.h"\ - -NODEP_CPP_PUMPKI=\ - ".\DoSelect"\ - - -"$(INTDIR)\PumpKINDlg.obj" : $(SOURCE) $(DEP_CPP_PUMPKI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\PumpKINDlg.sbr" : $(SOURCE) $(DEP_CPP_PUMPKI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - -DEP_CPP_PUMPKI=\ - ".\ACLTargetCombo.h"\ - ".\ConfirmRRQDlg.h"\ - ".\ConfirmWRQDlg.h"\ - ".\PropsACL.h"\ - ".\PropsNetwork.h"\ - ".\PropsServer.h"\ - ".\PropsSounds.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\RequestDlg.h"\ - ".\Resolver.h"\ - ".\Retrier.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - ".\Trayer.h"\ - - -"$(INTDIR)\PumpKINDlg.obj" : $(SOURCE) $(DEP_CPP_PUMPKI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\StdAfx.cpp -DEP_CPP_STDAF=\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - -# ADD CPP /Yc"stdafx.h" - -BuildCmds= \ - $(CPP) /nologo /Zp1 /MD /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ - "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)/pumpkin.pch" /Yc"stdafx.h" /Fo"$(INTDIR)/"\ - /c $(SOURCE) \ - - -"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" - $(BuildCmds) - -"$(INTDIR)\pumpkin.pch" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" - $(BuildCmds) - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - -# ADD CPP /Yc"stdafx.h" - -BuildCmds= \ - $(CPP) /nologo /Zp1 /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D\ - "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/pumpkin.pch"\ - /Yc"stdafx.h" /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ - - -"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" - $(BuildCmds) - -"$(INTDIR)\StdAfx.sbr" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" - $(BuildCmds) - -"$(INTDIR)\pumpkin.pch" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" - $(BuildCmds) - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - -# ADD BASE CPP /Yc"stdafx.h" -# ADD CPP /Yc"stdafx.h" - -BuildCmds= \ - $(CPP) /nologo /Zp1 /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ - "_MBCS" /Fp"$(INTDIR)/pumpkin.pch" /Yc"stdafx.h" /Fo"$(INTDIR)/" /c $(SOURCE) \ - - -"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" - $(BuildCmds) - -"$(INTDIR)\pumpkin.pch" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" - $(BuildCmds) - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\pumpkin.rc -DEP_RSC_PUMPKIN=\ - ".\res\down.ico"\ - ".\res\failed.wav"\ - ".\res\finished.wav"\ - ".\res\PumpKIN.ico"\ - ".\res\pumpkin.rc2"\ - ".\res\remove.ico"\ - ".\res\ring.wav"\ - ".\res\rrq.ico"\ - ".\res\up.ico"\ - ".\res\wrq.ico"\ - ".\shared-data\browse-icon.ico"\ - ".\shared-data\klever-background.bmp"\ - ".\shared-data\play-icon.ico"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\pumpkin.res" : $(SOURCE) $(DEP_RSC_PUMPKIN) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\pumpkin.res" : $(SOURCE) $(DEP_RSC_PUMPKIN) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\pumpkin.res" : $(SOURCE) $(DEP_RSC_PUMPKIN) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\help\pumpkin.hpj - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - -# Begin Custom Build - Making help files... -OutDir=.\Release -ProjDir=. -TargetName=pumpkin -InputPath=.\help\pumpkin.hpj - -BuildCmds= \ - "$(ProjDir)\makehelp.bat" \ - compress $(OutDir)\$(TargetName).hlp $(OutDir)\$(TargetName).hl_ \ - compress $(OutDir)\$(TargetName).cnt $(OutDir)\$(TargetName).cn_ \ - - -"$(OutDir)\$(TargetName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).cnt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).hl_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).cn_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - -# Begin Custom Build - Making help files... -OutDir=.\Debug -ProjDir=. -TargetName=pumpkin -InputPath=.\help\pumpkin.hpj - -BuildCmds= \ - "$(ProjDir)\makehelp.bat" \ - compress $(OutDir)\$(TargetName).hlp $(OutDir)\$(TargetName).hl_ \ - compress $(OutDir)\$(TargetName).cnt $(OutDir)\$(TargetName).cn_ \ - - -"$(OutDir)\$(TargetName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).cnt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).hl_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).cn_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - -# Begin Custom Build - Making help files... -OutDir=.\Releast -ProjDir=. -TargetName=pumpkin -InputPath=.\help\pumpkin.hpj - -BuildCmds= \ - "$(ProjDir)\makehelp.bat" \ - compress $(OutDir)\$(TargetName).hlp $(OutDir)\$(TargetName).hl_ \ - compress $(OutDir)\$(TargetName).cnt $(OutDir)\$(TargetName).cn_ \ - - -"$(OutDir)\$(TargetName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).cnt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).hl_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\$(TargetName).cn_" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\PropsServer.cpp -DEP_CPP_PROPS=\ - ".\PropsServer.h"\ - ".\pumpkin.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\PropsServer.obj" : $(SOURCE) $(DEP_CPP_PROPS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\PropsServer.obj" : $(SOURCE) $(DEP_CPP_PROPS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\PropsServer.sbr" : $(SOURCE) $(DEP_CPP_PROPS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\PropsServer.obj" : $(SOURCE) $(DEP_CPP_PROPS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\PropsNetwork.cpp -DEP_CPP_PROPSN=\ - ".\PropsNetwork.h"\ - ".\pumpkin.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\PropsNetwork.obj" : $(SOURCE) $(DEP_CPP_PROPSN) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\PropsNetwork.obj" : $(SOURCE) $(DEP_CPP_PROPSN) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\PropsNetwork.sbr" : $(SOURCE) $(DEP_CPP_PROPSN) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\PropsNetwork.obj" : $(SOURCE) $(DEP_CPP_PROPSN) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\ConfirmRRQDlg.cpp -DEP_CPP_CONFI=\ - ".\ConfirmRRQDlg.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\ConfirmRRQDlg.obj" : $(SOURCE) $(DEP_CPP_CONFI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\ConfirmRRQDlg.obj" : $(SOURCE) $(DEP_CPP_CONFI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\ConfirmRRQDlg.sbr" : $(SOURCE) $(DEP_CPP_CONFI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\ConfirmRRQDlg.obj" : $(SOURCE) $(DEP_CPP_CONFI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\ConfirmWRQDlg.cpp -DEP_CPP_CONFIR=\ - ".\ConfirmWRQDlg.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\ConfirmWRQDlg.obj" : $(SOURCE) $(DEP_CPP_CONFIR) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\ConfirmWRQDlg.obj" : $(SOURCE) $(DEP_CPP_CONFIR) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\ConfirmWRQDlg.sbr" : $(SOURCE) $(DEP_CPP_CONFIR) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\ConfirmWRQDlg.obj" : $(SOURCE) $(DEP_CPP_CONFIR) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\RequestDlg.cpp -DEP_CPP_REQUE=\ - ".\pumpkin.h"\ - ".\RequestDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\RequestDlg.obj" : $(SOURCE) $(DEP_CPP_REQUE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\RequestDlg.obj" : $(SOURCE) $(DEP_CPP_REQUE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\RequestDlg.sbr" : $(SOURCE) $(DEP_CPP_REQUE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\RequestDlg.obj" : $(SOURCE) $(DEP_CPP_REQUE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\Resolver.cpp -DEP_CPP_RESOL=\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\Resolver.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\Resolver.obj" : $(SOURCE) $(DEP_CPP_RESOL) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\Resolver.obj" : $(SOURCE) $(DEP_CPP_RESOL) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\Resolver.sbr" : $(SOURCE) $(DEP_CPP_RESOL) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\Resolver.obj" : $(SOURCE) $(DEP_CPP_RESOL) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\Retrier.cpp -DEP_CPP_RETRI=\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\Retrier.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\Retrier.obj" : $(SOURCE) $(DEP_CPP_RETRI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\Retrier.obj" : $(SOURCE) $(DEP_CPP_RETRI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\Retrier.sbr" : $(SOURCE) $(DEP_CPP_RETRI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\Retrier.obj" : $(SOURCE) $(DEP_CPP_RETRI) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\Trayer.cpp -DEP_CPP_TRAYE=\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - ".\Trayer.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\Trayer.obj" : $(SOURCE) $(DEP_CPP_TRAYE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\Trayer.obj" : $(SOURCE) $(DEP_CPP_TRAYE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\Trayer.sbr" : $(SOURCE) $(DEP_CPP_TRAYE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\Trayer.obj" : $(SOURCE) $(DEP_CPP_TRAYE) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\help\pumpkin.cnt - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\PropsSounds.cpp -DEP_CPP_PROPSS=\ - ".\PropsSounds.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\PropsSounds.obj" : $(SOURCE) $(DEP_CPP_PROPSS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\PropsSounds.obj" : $(SOURCE) $(DEP_CPP_PROPSS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\PropsSounds.sbr" : $(SOURCE) $(DEP_CPP_PROPSS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\PropsSounds.obj" : $(SOURCE) $(DEP_CPP_PROPSS) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\PropsACL.cpp -DEP_CPP_PROPSA=\ - ".\ACLTargetCombo.h"\ - ".\PropsACL.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\PropsACL.obj" : $(SOURCE) $(DEP_CPP_PROPSA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\PropsACL.obj" : $(SOURCE) $(DEP_CPP_PROPSA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\PropsACL.sbr" : $(SOURCE) $(DEP_CPP_PROPSA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\PropsACL.obj" : $(SOURCE) $(DEP_CPP_PROPSA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\ACLTargetCombo.cpp -DEP_CPP_ACLTA=\ - ".\ACLTargetCombo.h"\ - ".\pumpkin.h"\ - ".\PumpKINDlg.h"\ - ".\shared-code\BellsNWhistles.h"\ - ".\shared-code\kHelpers.h"\ - ".\stdafx.h"\ - - -!IF "$(CFG)" == "PumpKIN - Win32 Release" - - -"$(INTDIR)\ACLTargetCombo.obj" : $(SOURCE) $(DEP_CPP_ACLTA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Debug" - - -"$(INTDIR)\ACLTargetCombo.obj" : $(SOURCE) $(DEP_CPP_ACLTA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - -"$(INTDIR)\ACLTargetCombo.sbr" : $(SOURCE) $(DEP_CPP_ACLTA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ELSEIF "$(CFG)" == "PumpKIN - Win32 Static" - - -"$(INTDIR)\ACLTargetCombo.obj" : $(SOURCE) $(DEP_CPP_ACLTA) "$(INTDIR)"\ - "$(INTDIR)\pumpkin.pch" - - -!ENDIF - -# End Source File -# End Target -################################################################################ -# Begin Target - -# Name "Install - Win32 Debug" -# Name "Install - Win32 Pure" -# Name "Install - Win32 Static" -# Name "Install - Win32 Canned" - -!IF "$(CFG)" == "Install - Win32 Debug" - -!ELSEIF "$(CFG)" == "Install - Win32 Pure" - -!ELSEIF "$(CFG)" == "Install - Win32 Static" - -!ELSEIF "$(CFG)" == "Install - Win32 Canned" - -!ENDIF - -################################################################################ -# Begin Source File - -SOURCE=.\Install\Install.rc -DEP_RSC_INSTA=\ - ".\Install\Custom.rch"\ - ".\shared-data\install-icon.ico"\ - - -!IF "$(CFG)" == "Install - Win32 Debug" - - -"$(INTDIR)\Install.res" : $(SOURCE) $(DEP_RSC_INSTA) "$(INTDIR)" - $(RSC) /l 0x409 /fo"$(INTDIR)/Install.res" /i "Install" /d "_DEBUG"\ - $(SOURCE) - - -!ELSEIF "$(CFG)" == "Install - Win32 Pure" - - -"$(INTDIR)\Install.res" : $(SOURCE) $(DEP_RSC_INSTA) "$(INTDIR)" - $(RSC) /l 0x409 /fo"$(INTDIR)/Install.res" /i "Install" /d "NDEBUG"\ - $(SOURCE) - - -!ELSEIF "$(CFG)" == "Install - Win32 Static" - - -"$(INTDIR)\Install.res" : $(SOURCE) $(DEP_RSC_INSTA) "$(INTDIR)" - $(RSC) /l 0x409 /fo"$(INTDIR)/Install.res" /i "Install" /d "NDEBUG" /d\ - "STATI_K" $(SOURCE) - - -!ELSEIF "$(CFG)" == "Install - Win32 Canned" - - -"$(INTDIR)\Install.res" : $(SOURCE) $(DEP_RSC_INSTA) "$(INTDIR)" - $(RSC) /l 0x409 /fo"$(INTDIR)/Install.res" /i "Install" /d "NDEBUG" /d\ - "K_ANNED" $(SOURCE) - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\Install\install.cpp -DEP_CPP_INSTAL=\ - ".\shared-code\install.h"\ - - -!IF "$(CFG)" == "Install - Win32 Debug" - - -"$(INTDIR)\install.obj" : $(SOURCE) $(DEP_CPP_INSTAL) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "Install - Win32 Pure" - - -BuildCmds= \ - $(CPP) $(CPP_PROJ) $(SOURCE) \ - - -"$(INTDIR)\install.obj" : $(SOURCE) $(DEP_CPP_INSTAL) "$(INTDIR)" - $(BuildCmds) - -"$(INTDIR)\install.sbr" : $(SOURCE) $(DEP_CPP_INSTAL) "$(INTDIR)" - $(BuildCmds) - -!ELSEIF "$(CFG)" == "Install - Win32 Static" - - -"$(INTDIR)\install.obj" : $(SOURCE) $(DEP_CPP_INSTAL) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "Install - Win32 Canned" - - -"$(INTDIR)\install.obj" : $(SOURCE) $(DEP_CPP_INSTAL) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -# End Source File -# End Target -# End Project -################################################################################ -################################################################################ -# Section PumpKIN : {4FD78B34-1FD7-11D0-A9FB-444553540000} -# 2:11:CPumpKINDlg:1 -# 2:11:CRequestDlg:1 -# End Section -################################################################################ diff --git a/pumpkin.rc b/pumpkin.rc deleted file mode 100755 index 6f01fdf..0000000 --- a/pumpkin.rc +++ b/dev/null @@ -1,689 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""res\\PumpKIN.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_RRQ ICON DISCARDABLE "res\\wrq.ico" -IDI_WRQ ICON DISCARDABLE "res\\rrq.ico" -IDI_BROWSE ICON DISCARDABLE "shared-data/browse-icon.ico" -IDR_MAINFRAME ICON DISCARDABLE "res\\pumpkin.ico" -IDI_PLAY ICON DISCARDABLE "shared-data/play-icon.ico" -IDI_UP ICON DISCARDABLE "res\\up.ico" -IDI_DOWN ICON DISCARDABLE "res\\down.ico" -IDI_REMOVE ICON DISCARDABLE "res\\remove.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 74 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About PumpKIN" -FONT 8, "MS Sans Serif" -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,7,17,18,20 - LTEXT "PumpKIN, Version 2.7.3",IDC_STATIC,40,15,119,8, - SS_NOPREFIX - LTEXT "Copyright © 1997-2011 Klever Group",IDC_STATIC,40,30, - 170,8 - DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP - PUSHBUTTON "http://www.klever.net/",IDC_KLEVERNET,124,53,86,14 -END - -IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 193 -STYLE DS_3DLOOK | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW -CAPTION " PumpKIN" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "List1",IDC_CONNECTIONS,"SysListView32",LVS_REPORT | - LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,7,7,295,108, - WS_EX_DLGMODALFRAME - PUSHBUTTON "&Get File",IDC_GET,305,7,50,17,BS_NOTIFY, - WS_EX_CLIENTEDGE - PUSHBUTTON "&Put File",IDC_PUT,305,25,50,17,BS_NOTIFY, - WS_EX_CLIENTEDGE - PUSHBUTTON "&Abort xfer",IDC_ABORT,305,43,50,17,BS_NOTIFY, - WS_EX_CLIENTEDGE - PUSHBUTTON "&Options",IDC_OPTIONS,305,61,50,17,BS_NOTIFY, - WS_EX_CLIENTEDGE - PUSHBUTTON "E&xit",IDC_EXIT,305,79,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE - PUSHBUTTON "&Help",ID_HELP,305,97,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE - LISTBOX IDC_LOG,7,115,348,64,LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_VSCROLL | - WS_HSCROLL,WS_EX_DLGMODALFRAME - PUSHBUTTON "..",IDCANCEL,0,183,6,7,NOT WS_VISIBLE | NOT WS_TABSTOP - CONTROL "&Server is running",IDC_LISTENING,"Button", - BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_FLAT | WS_TABSTOP,286, - 181,69,11,WS_EX_TRANSPARENT | WS_EX_STATICEDGE -END - -IDD_PROPS_SERVER DIALOG DISCARDABLE 0, 0, 300, 201 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Server" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "TFTP filesystem &root (download path)",IDC_STATIC,7,7, - 286,38 - EDITTEXT IDC_TFTPROOT,13,16,256,13,ES_AUTOHSCROLL - PUSHBUTTON "&B",IDC_BROWSE,274,16,13,13,BS_ICON - CONTROL "Allow access to &subdirectories",IDC_TFTPSUBDIRS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,31,111,10 - GROUPBOX "Read Request Behavior",IDC_STATIC,7,48,243,56 - CONTROL "Give &all files",IDC_RRQ_GIVEALL,"Button", - BS_AUTORADIOBUTTON | BS_NOTIFY | WS_GROUP,13,63,53,10 - CONTROL "&Prompt before giving file",IDC_RRQ_ALWAYSCONFIRM, - "Button",BS_AUTORADIOBUTTON | BS_NOTIFY,43,75,91,10 - CONTROL "&Deny all requests",IDC_RRQ_DENYALL,"Button", - BS_AUTORADIOBUTTON | BS_NOTIFY,73,87,70,10 - GROUPBOX "Write Request Behavior",IDC_STATIC,7,106,243,56, - WS_GROUP - CONTROL "Take a&ll files",IDC_WRQ_TAKEALL,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,13,116,55,10 - CONTROL "Prompt if file &exists",IDC_WRQ_PROMPTEXISTING,"Button", - BS_AUTORADIOBUTTON,43,126,73,10 - CONTROL "Always pro&mpt before accepting file", - IDC_WRQ_ALWAYSCONFIRM,"Button",BS_AUTORADIOBUTTON,73,136, - 139,10 - CONTROL "D&eny all requests",IDC_WRQ_DENYALL,"Button", - BS_AUTORADIOBUTTON,103,146,70,10 - CTEXT "Confirmation &timeout",IDC_STATIC,253,52,40,19, - SS_NOTIFY - CONTROL "Slider1",IDC_PROMPTTIMEOUT,"msctls_trackbar32", - TBS_AUTOTICKS | TBS_VERT | TBS_TOP | WS_TABSTOP,272,72, - 21,90 - GROUPBOX "Log file (leave empty to disable logging to file)", - IDC_STATIC,7,165,286,29 - EDITTEXT IDC_LOGFILE,13,175,256,13,ES_AUTOHSCROLL - PUSHBUTTON "",IDC_LOGFILE_BROWSE,274,175,13,13,BS_ICON -END - -IDD_PROPS_NETWORK DIALOG DISCARDABLE 0, 0, 300, 201 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Network" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "UDP Ports",IDC_STATIC,7,7,286,55 - RTEXT "Listen for &incoming requests on port:",IDC_STATIC,13, - 18,135,8 - EDITTEXT IDC_LISTENPORT,154,16,61,13,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_LISTENSPIN,"msctls_updown32",UDS_WRAP | - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS | UDS_NOTHOUSANDS,204,16,11,13 - RTEXT "Send &outging requests to port:",IDC_STATIC,13,46,135,8 - EDITTEXT IDC_SPEAKPORT,154,44,61,13,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SPEAKSPIN,"msctls_updown32",UDS_WRAP | - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS | UDS_NOTHOUSANDS,204,43,11,13 - LTEXT "Default connection timeout:",IDC_STATIC,7,66,88,8 - EDITTEXT IDC_TIMEOUT,110,64,40,13,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Spin3",IDC_TIMESPIN,"msctls_updown32",UDS_WRAP | - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS | UDS_NOTHOUSANDS,140,64,11,13 - LTEXT "Default block size:",IDC_STATIC,7,80,59,8 - LTEXT "seconds",IDC_STATIC,154,66,28,8 - LTEXT "bytes",IDC_STATIC,154,80,18,8 - EDITTEXT IDC_BLOCKSIZE,110,78,40,13,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Spin3",IDC_BSIZESPIN,"msctls_updown32",UDS_WRAP | - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS | UDS_NOTHOUSANDS,140,78,11,13 - RTEXT "ip address:",IDC_STATIC,13,32,135,8 - EDITTEXT IDC_LISTENADDRESS,154,28,61,14,ES_AUTOHSCROLL -END - -IDD_CONFIRM_RRQ DIALOGEX 0, 0, 181, 79 -STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | - WS_CAPTION -EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE -CAPTION " PumpKIN - Confirm Read Request" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "&Grant Access",IDOK,27,58,54,14 - PUSHBUTTON "&Deny Access",IDCANCEL,97,58,54,14 - LTEXT "The host",IDC_STATIC,77,7,29,8 - CTEXT "255.255.255.255",IDC_HOST,57,15,68,14,SS_NOTIFY | - SS_SUNKEN | WS_BORDER,WS_EX_DLGMODALFRAME | - WS_EX_CLIENTEDGE - CTEXT "is requesting the file",IDC_STATIC,23,29,135,8 - CTEXT "",IDC_FILE,23,37,135,14,SS_NOTIFY | SS_SUNKEN | - WS_BORDER,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,54,167,1 - ICON IDR_MAINFRAME,IDC_STATIC,7,7,18,20 - ICON IDR_MAINFRAME,IDC_STATIC,153,7,18,20 -END - -IDD_CONFIRM_WRQ DIALOGEX 0, 0, 201, 95 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_CAPTION -EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE -CAPTION " PumpKIN - Confirm Write Request" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "&Accept",IDOK,7,58,59,14 - PUSHBUTTON "&Rename",IDC_RENAME,71,58,59,14 - PUSHBUTTON "&Deny Access",IDCANCEL,135,58,59,14 - LTEXT "The host",IDC_STATIC,87,7,29,8 - CTEXT "255.255.255.255",IDC_HOST,67,15,68,14,SS_NOTIFY | - SS_SUNKEN | WS_BORDER,WS_EX_DLGMODALFRAME | - WS_EX_CLIENTEDGE - CTEXT "is attempting to send you a file",IDC_STATIC,33,29,135, - 8 - CTEXT "",IDC_FILE,33,37,135,14,SS_NOTIFY | SS_SUNKEN | - WS_BORDER,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,54,187,1 - ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 - ICON IDR_MAINFRAME,IDC_STATIC,173,7,21,20 - PUSHBUTTON "Res&ume",IDC_RESUME,71,74,59,14 -END - -IDD_REQUEST DIALOGEX 0, 0, 191, 161 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_CAPTION | - WS_SYSMENU -EXSTYLE WS_EX_CLIENTEDGE -CAPTION "Request" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - LTEXT "&Local file:",IDC_STATIC,7,7,31,8,SS_NOTIFY - EDITTEXT IDC_LOCALFILE,7,16,157,14,ES_AUTOHSCROLL, - WS_EX_CLIENTEDGE | WS_EX_STATICEDGE - PUSHBUTTON "...",IDC_BROWSE,165,16,19,14,BS_ICON,WS_EX_STATICEDGE - LTEXT "&Remote file:",IDC_STATIC,7,34,38,8,SS_NOTIFY - EDITTEXT IDC_REMOTEFILE,7,44,177,14,ES_AUTOHSCROLL, - WS_EX_CLIENTEDGE | WS_EX_STATICEDGE - LTEXT "Remote &host:",IDC_STATIC,7,61,43,8,SS_NOTIFY - COMBOBOX IDC_TALKS,7,72,157,66,CBS_SIMPLE | CBS_AUTOHSCROLL | - CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | - WS_TABSTOP,WS_EX_CLIENTEDGE | WS_EX_STATICEDGE - PUSHBUTTON "R\nE\n&F\nR\nE\nS\nH",IDC_REFRESH,165,72,19,66, - BS_CENTER | BS_VCENTER | BS_MULTILINE | BS_NOTIFY, - WS_EX_CLIENTEDGE - LTEXT "&Type:",IDC_STATIC,58,34,19,8 - COMBOBOX IDC_TYPE,80,31,43,41,CBS_DROPDOWN | CBS_AUTOHSCROLL | - CBS_LOWERCASE | WS_VSCROLL | WS_TABSTOP - LTEXT "&Block:",IDC_STATIC,127,34,21,8 - COMBOBOX IDC_BSIZE,149,31,35,53,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,35,140,50,14 - PUSHBUTTON "Cancel",IDCANCEL,101,140,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDVERT,52,32,1,11 -END - -IDD_PROPS_SOUNDS DIALOG DISCARDABLE 0, 0, 300, 201 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Sounds" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "&Incoming request:",IDC_STATIC,7,9,57,8 - COMBOBOX IDC_RING,70,7,188,100,CBS_DROPDOWN | CBS_AUTOHSCROLL | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "browse",IDC_RING_BROWSE,263,7,13,13,BS_ICON - PUSHBUTTON "play",IDC_RING_PLAY,280,7,13,13,BS_ICON - LTEXT "xfer &finished:",IDC_STATIC,7,25,57,8 - COMBOBOX IDC_FINISHED,70,22,188,100,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "browse",IDC_FINISHED_BROWSE,263,22,13,13,BS_ICON - PUSHBUTTON "play",IDC_FINISHED_PLAY,280,22,13,13,BS_ICON - LTEXT "xfer &aborted:",IDC_STATIC,7,40,57,8 - COMBOBOX IDC_ABORTED,70,37,188,100,CBS_DROPDOWN | CBS_AUTOHSCROLL | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "browse",IDC_ABORTED_BROWSE,263,37,13,13,BS_ICON - PUSHBUTTON "play",IDC_ABORTED_PLAY,280,37,13,13,BS_ICON -END - -IDD_PROPS_ACL DIALOG DISCARDABLE 0, 0, 300, 201 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Access Lists" -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "List1",IDC_ACL_LIST,"SysListView32",LVS_REPORT | - WS_BORDER | WS_TABSTOP,7,7,258,110 - PUSHBUTTON "&Up",IDC_ACL_UP,273,7,20,30,BS_ICON | BS_CENTER | - BS_VCENTER - PUSHBUTTON "&Down",IDC_ACL_DOWN,273,87,20,30,BS_ICON | BS_CENTER | - BS_VCENTER - PUSHBUTTON "&Remove",IDC_ACL_REMOVE,273,47,20,30,BS_ICON | - BS_CENTER | BS_VCENTER - LTEXT "If",IDC_STATIC,13,128,8,8 - COMBOBOX IDC_ACL_XFER,21,125,48,67,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - LTEXT "request comes from the address in the network", - IDC_STATIC,71,128,122,8 - EDITTEXT IDC_ACL_ADDR,47,143,80,12,ES_AUTOHSCROLL - LTEXT "with netmask",IDC_STATIC,129,145,41,8 - EDITTEXT IDC_ACL_NETMASK,173,143,80,12,ES_AUTOHSCROLL - LTEXT "then",IDC_STATIC,124,160,15,8 - COMBOBOX IDC_ACL_RULE,143,158,123,117,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Add new rule",IDC_ACL_ADD,7,178,130,16 - PUSHBUTTON "&Replace rule",IDC_ACL_REPLACE,152,178,130,16 -END - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,7,3,0 - PRODUCTVERSION 2,7,3,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Klever Group (http://www.klever.net/)\0" - VALUE "FileDescription", "PumpKIN, tftp client/daemon\0" - VALUE "FileVersion", "2, 7, 3, 0\0" - VALUE "InternalName", "PUMPKIN\0" - VALUE "LegalCopyright", "Copyright © 1997-2011 Klever Group (http://www.klever.net)\0" - VALUE "LegalTrademarks", "Klever Group (http://www.klever.net/)\0" - VALUE "OriginalFilename", "PUMPKIN.EXE\0" - VALUE "ProductName", "PumpKIN\0" - VALUE "ProductVersion", "2, 7, 3, 0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_ABOUTBOX, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 210 - TOPMARGIN, 7 - BOTTOMMARGIN, 67 - END - - IDD_PUMPKIN_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 355 - TOPMARGIN, 7 - BOTTOMMARGIN, 186 - HORZGUIDE, 115 - END - - IDD_PROPS_SERVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 293 - TOPMARGIN, 7 - BOTTOMMARGIN, 194 - END - - IDD_PROPS_NETWORK, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 293 - TOPMARGIN, 7 - BOTTOMMARGIN, 194 - END - - IDD_CONFIRM_RRQ, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 174 - TOPMARGIN, 7 - BOTTOMMARGIN, 72 - END - - IDD_CONFIRM_WRQ, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 194 - TOPMARGIN, 7 - BOTTOMMARGIN, 88 - END - - IDD_REQUEST, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 184 - TOPMARGIN, 7 - BOTTOMMARGIN, 154 - END - - IDD_PROPS_SOUNDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 293 - TOPMARGIN, 7 - BOTTOMMARGIN, 194 - END - - IDD_PROPS_ACL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 293 - TOPMARGIN, 7 - BOTTOMMARGIN, 194 - HORZGUIDE, 117 - HORZGUIDE, 125 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_BACKGROUND BITMAP DISCARDABLE "shared-data/klever-background.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// WAVE -// - -IDR_WAVE_RING WAVE DISCARDABLE "res\\ring.wav" -IDR_WAVE_FINISHED WAVE DISCARDABLE "res\\finished.wav" -IDR_WAVE_ABORTED WAVE DISCARDABLE "res\\failed.wav" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -IDD_REQUEST DLGINIT -BEGIN - IDC_TYPE, 0x403, 6, 0 -0x636f, 0x6574, 0x0074, - IDC_TYPE, 0x403, 9, 0 -0x656e, 0x6174, 0x6373, 0x6969, "\000" - IDC_BSIZE, 0x403, 4, 0 -0x3135, 0x0032, - IDC_BSIZE, 0x403, 5, 0 -0x3031, 0x3432, "\000" - IDC_BSIZE, 0x403, 5, 0 -0x3032, 0x3834, "\000" - IDC_BSIZE, 0x403, 5, 0 -0x3034, 0x3639, "\000" - IDC_BSIZE, 0x403, 5, 0 -0x3138, 0x3239, "\000" - 0 -END - -IDD_PROPS_ACL DLGINIT -BEGIN - IDC_ACL_XFER, 0x403, 5, 0 -0x6572, 0x6461, "\000" - IDC_ACL_XFER, 0x403, 6, 0 -0x7277, 0x7469, 0x0065, - IDC_ACL_RULE, 0x403, 12, 0 -0x6361, 0x6563, 0x7470, 0x6620, 0x6c69, 0x0065, - IDC_ACL_RULE, 0x403, 33, 0 -0x6361, 0x6563, 0x7470, 0x6120, 0x646e, 0x7220, 0x6e65, 0x6d61, 0x2065, -0x6669, 0x6620, 0x6c69, 0x2065, 0x7865, 0x7369, 0x7374, "\000" - IDC_ACL_RULE, 0x403, 12, 0 -0x6572, 0x656a, 0x7463, 0x6620, 0x6c69, 0x0065, - IDC_ACL_RULE, 0x403, 31, 0 -0x6166, 0x6c6c, 0x6162, 0x6b63, 0x7420, 0x206f, 0x6874, 0x2065, 0x6c67, -0x626f, 0x6c61, 0x7320, 0x7465, 0x6974, 0x676e, "\000" - 0 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDM_POPUPS MENU DISCARDABLE -BEGIN - POPUP "&Tray" - BEGIN - MENUITEM "&Send File", ID_TRAY_SENDFILE - MENUITEM "F&etch file", ID_TRAY_FETCHFILE - MENUITEM "&Options", ID_TRAY_OPTIONS - MENUITEM "&Listen to requests", ID_TRAY_LISTEN - MENUITEM "Show &PumpKIN Window", ID_TRAY_SHOWPUMPKINWINDOW - MENUITEM "Open &Files Folder", ID_TRAY_OPENFILESFOLDER - MENUITEM SEPARATOR - MENUITEM "&Help Topics", ID_TRAY_HELP - MENUITEM "&About PumpKIN", ID_TRAY_ABOUTPUMPKIN - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_TRAY_EXIT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ABOUTBOX "&About PumpKIN..." - IDS_FMT_BYTES "%lu" - IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." - IDS_TFTP_ERROR_ACCESS "Access violation" - IDS_TFTP_ERROR_NOTFOUND "File not found" - IDS_TFTP_ERROR_DIRFULL "Directory is full" - IDS_TFTP_ERROR_SHARING "Sharing violation" - IDS_TFTP_ERROR_DISKFULL "Disk full" - IDS_TFTP_ERROR_UNDEFINED "Undefined error" - IDS_LOG_START "PumpKIN started" - IDS_LOG_LISTENRECEIVEERROR "Error listening for incoming connections" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_LOG_LISTENACCEPTERROR "Error accepting incoming connection" - IDS_LOG_RRQSERVE "'%s' of type '%s' is requested from %s" - IDS_LOG_LISTENOPCODE "Invalid opcode in initial connection request" - IDS_LOG_XFERUDPSEND "UDP packet send failed" - IDS_LOG_XFERRECEIVE "Error on xfer socket" - IDS_LOG_XFERSEND "Error on xfer socket" - IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed" - IDS_LOG_XFERSOURCETID "Packet from unexpected source" - IDS_LOG_SENTTFTPERROR ">> %u: %s" - IDS_LOG_GOTTFTPERROR "TFTP:%u: %s" - IDS_LOG_XFEROPCODE "Invalid opcode (%u) during transfer received" - IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed" - IDS_TITLE_OPTIONS "Options" - IDS_LOG_WRQSERVE "Writing of '%s' of type '%s' is requested by %s" - IDS_TFTP_ERROR_FAILEDTORENAME "Too many clones of the file" - IDS_RENAME_TITLE "Save As" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_LOG_TIMEDOUT "Transmission of '%s' is timed out" - IDS_CONFIRMEXIT_TITLE "Exit" - IDS_CONFIRMEXIT_TEXT "File transmission is currently in progress. Are you sure you want to exit?" - IDS_LOG_XFERWRQFINISHED "Transfer of '%s' has successfully completed" - IDS_LOG_XFERABORTED "Transfer of '%s' was aborted" - IDS_TITLE_PUTREQUEST "Send file" - IDS_TITLE_GETREQUEST "Fetch file" - IDS_WTALKHEADING "Talk with " - IDS_TITLE_BROWSEFILE "Browse" - IDS_LOG_RESOLVEFAILED "Failed to resolve host address for '%s'" - IDS_LOG_FAILEDLOCALFILE "Failed to open local file '%s'" - IDS_LOG_FAILEDTOOPEN "Failed to open '%s'" - IDS_OTALXHEADING "Open Talks: talking to " - IDS_REGISTRYKEY "Klever Group" - IDS_KLEVERNET_URL "http://www.klever.net/" - IDS_LOGTIMEFORMAT "%H:%M:%S %B %d" -END - -STRINGTABLE DISCARDABLE -BEGIN - ID_TRAY_HELP "Read the help on PumpKIN" - ID_TRAY_ABOUTPUMPKIN "Learn about PumpKIN and it's creator" - ID_TRAY_EXIT "Close PumpKIN" - ID_TRAY_SENDFILE "Send file over the network to your tete-a-tete" - ID_TRAY_FETCHFILE "Fetch file from remote computer" - ID_TRAY_OPTIONS "Set PumpKIN options" - ID_TRAY_SHOWPUMPKINWINDOW "Show main window" - ID_TRAY_OPENFILESFOLDER "Explore TFTP root folder" - ID_TRAY_LISTEN "Listen for incoming requests" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDC_CONNECTIONS "Active transfers" - IDC_LOG "PumpKIN Activity Log" - IDC_GET "Fetch file from remote server" - IDC_PUT "Send file over the net" - IDC_ABORT "Abort transfer currently in progress" - IDC_EXIT "Close PumpKIN" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDC_OPTIONS "Set PumpKIN options" - IDC_REFRESH "Refresh talks list" - IDC_BROWSE "Browse" -END - -STRINGTABLE DISCARDABLE -BEGIN - ID_HELP "Read help on PumpKIN" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DROPFILES_TITLE "Drop Files" - IDS_NOMULTIPLEDROP_TEXT "You can't drop more than one file here. Only the first one will be accepted" - IDS_LOG_REQUESTING "Requesting '%s' from '%s'" - IDS_LOG_SENDING "Sending '%s' to '%s'" - IDS_WTALKAT "@" - IDS_OTALXAT " at " - IDS_TFTP_ERROR_TSIZE "Invalid transfer size" - IDS_TFTP_ERROR_BSIZE "Invalid block size" - IDS_TFTP_ERROR_TOUT "Invalid timeout" - IDS_SELECT_TFTPROOT "Select TFTP filesystem root.." - IDS_FILTER_WAV "Sound Files (*.wav)|*.wav||" - IDS_TITLE_WAV "Select sound.." - IDS_BOX_CANTBIND "Failed to create listening socket. The port may be in use by another application." - IDS_NO_XFER_OP "No request type specified." - IDS_INVALID_IP "Invalid IP address." - IDS_INVALID_NETMASK "Invalid netmask." -END - -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "PUMPKIN" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INVALID_RULE "Invalid access rule." - IDS_LOG_LOGERROR "Error logging to '%s'" - IDS_TFTP_ERROR_TOOBIG "File is too big, try increasing block size" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "res\PumpKIN.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/pumpkin.xcodeproj/project.pbxproj b/pumpkin.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d2cffd7 --- a/dev/null +++ b/pumpkin.xcodeproj/project.pbxproj @@ -0,0 +1,519 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 68081EA9160E6D2B009D14E1 /* put.icns in Resources */ = {isa = PBXBuildFile; fileRef = 68081EA8160E6D2B009D14E1 /* put.icns */; }; + 68081EAB160F856A009D14E1 /* get.icns in Resources */ = {isa = PBXBuildFile; fileRef = 68081EAA160F856A009D14E1 /* get.icns */; }; + 68081EAD160F8BE8009D14E1 /* abort.icns in Resources */ = {isa = PBXBuildFile; fileRef = 68081EAC160F8BE8009D14E1 /* abort.icns */; }; + 6808EC7A166158AF00F479A9 /* IPTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6808EC79166158AE00F479A9 /* IPTransformer.m */; }; + 6808EC7E1661860D00F479A9 /* biportal in CopyFiles */ = {isa = PBXBuildFile; fileRef = 68DAEE2A14118D370007A630 /* biportal */; }; + 680E89A51482B03A008C9134 /* pumpkin-defaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 680E89A41482B03A008C9134 /* pumpkin-defaults.plist */; }; + 680E89A91482EF73008C9134 /* NumberTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 680E89A81482EF73008C9134 /* NumberTransformer.m */; }; + 682A27901419688B005AB8FB /* XFer.m in Sources */ = {isa = PBXBuildFile; fileRef = 682A278F1419688B005AB8FB /* XFer.m */; }; + 682A2792141BD97B005AB8FB /* TFTPPacket.m in Sources */ = {isa = PBXBuildFile; fileRef = 682A2791141BD97B005AB8FB /* TFTPPacket.m */; }; + 683B812B15EA9FB5002A9253 /* pumpkin.icns in Resources */ = {isa = PBXBuildFile; fileRef = 683B812A15EA9FB5002A9253 /* pumpkin.icns */; }; + 68428F7A166BAFB500AF8D8C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68428F79166BAFB500AF8D8C /* Cocoa.framework */; }; + 68428F7C166BAFC600AF8D8C /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68428F7B166BAFC600AF8D8C /* Security.framework */; }; + 68458CB7141579E100F1E4FF /* DaemonListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 68458CB6141579E100F1E4FF /* DaemonListener.m */; }; + 68458CBE14157A4100F1E4FF /* SendXFer.m in Sources */ = {isa = PBXBuildFile; fileRef = 68458CBD14157A4100F1E4FF /* SendXFer.m */; }; + 685CCB0F14D4AC7700F5B76B /* XFersViewDatasource.m in Sources */ = {isa = PBXBuildFile; fileRef = 685CCB0E14D4AC7700F5B76B /* XFersViewDatasource.m */; }; + 685CCB1214D5BA1300F5B76B /* StringsAttached.m in Sources */ = {isa = PBXBuildFile; fileRef = 685CCB1114D5BA1300F5B76B /* StringsAttached.m */; }; + 686315D514DDE7B40067B682 /* ReceiveXFer.m in Sources */ = {isa = PBXBuildFile; fileRef = 686315D414DDE7B40067B682 /* ReceiveXFer.m */; }; + 68697A74166BC88900D08FEA /* PumpKIN.xib in Resources */ = {isa = PBXBuildFile; fileRef = 68697A73166BC88900D08FEA /* PumpKIN.xib */; }; + 68697A76166BC91900D08FEA /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 68697A75166BC91900D08FEA /* Credits.rtf */; }; + 68697A82166BCBE000D08FEA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 68697A80166BCBE000D08FEA /* InfoPlist.strings */; }; + 687435A914142E50003EF6EF /* klever-background.png in Resources */ = {isa = PBXBuildFile; fileRef = 687435A814142E50003EF6EF /* klever-background.png */; }; + 68783E43148585EB00DEE0B5 /* IPFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 68783E42148585EB00DEE0B5 /* IPFormatter.m */; }; + 68B3D56D14E1CD37002B0D56 /* ARequest.xib in Resources */ = {isa = PBXBuildFile; fileRef = 68B3D56C14E1CD37002B0D56 /* ARequest.xib */; }; + 68B3D57114E1CE8D002B0D56 /* ARequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 68B3D57014E1CE8D002B0D56 /* ARequest.m */; }; + 68D5F05D14F2ADBF00CF4CFE /* ConfirmRequest.xib in Resources */ = {isa = PBXBuildFile; fileRef = 68D5F05C14F2ADBF00CF4CFE /* ConfirmRequest.xib */; }; + 68D5F06114F4397200CF4CFE /* ConfirmRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 68D5F06014F4397200CF4CFE /* ConfirmRequest.m */; }; + 68DAEE1614118CB60007A630 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DAEE1514118CB60007A630 /* main.m */; }; + 68DAEE1D14118CB60007A630 /* PumpKIN.m in Sources */ = {isa = PBXBuildFile; fileRef = 68DAEE1C14118CB60007A630 /* PumpKIN.m */; }; + 68DAEE2E14118D370007A630 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 68DAEE2D14118D370007A630 /* main.c */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 68DAEE401412D5FC0007A630 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 68DAEDFC14118CB60007A630 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 68DAEE2914118D370007A630; + remoteInfo = biportal; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 6808EC7D166185F900F479A9 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 6; + files = ( + 6808EC7E1661860D00F479A9 /* biportal in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 68DAEE2814118D370007A630 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = usr/share/man/man1; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 68081EA8160E6D2B009D14E1 /* put.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = put.icns; sourceTree = ""; }; + 68081EAA160F856A009D14E1 /* get.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = get.icns; sourceTree = ""; }; + 68081EAC160F8BE8009D14E1 /* abort.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = abort.icns; sourceTree = ""; }; + 6808EC78166158AE00F479A9 /* IPTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPTransformer.h; sourceTree = ""; }; + 6808EC79166158AE00F479A9 /* IPTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IPTransformer.m; sourceTree = ""; }; + 680E89A41482B03A008C9134 /* pumpkin-defaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "pumpkin-defaults.plist"; sourceTree = ""; }; + 680E89A71482EF73008C9134 /* NumberTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberTransformer.h; sourceTree = ""; }; + 680E89A81482EF73008C9134 /* NumberTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NumberTransformer.m; sourceTree = ""; }; + 682A278E1419688A005AB8FB /* XFer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XFer.h; sourceTree = ""; }; + 682A278F1419688B005AB8FB /* XFer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XFer.m; sourceTree = ""; }; + 682A2791141BD97B005AB8FB /* TFTPPacket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TFTPPacket.m; sourceTree = ""; }; + 683B812A15EA9FB5002A9253 /* pumpkin.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = pumpkin.icns; sourceTree = ""; }; + 68428F79166BAFB500AF8D8C /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 68428F7B166BAFC600AF8D8C /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 68458CB5141579E100F1E4FF /* DaemonListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaemonListener.h; sourceTree = ""; }; + 68458CB6141579E100F1E4FF /* DaemonListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DaemonListener.m; sourceTree = ""; }; + 68458CB914157A1000F1E4FF /* TFTPPacket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TFTPPacket.h; sourceTree = ""; }; + 68458CBC14157A4100F1E4FF /* SendXFer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendXFer.h; sourceTree = ""; }; + 68458CBD14157A4100F1E4FF /* SendXFer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = SendXFer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 685CCB0D14D4AC7700F5B76B /* XFersViewDatasource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XFersViewDatasource.h; sourceTree = ""; }; + 685CCB0E14D4AC7700F5B76B /* XFersViewDatasource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XFersViewDatasource.m; sourceTree = ""; }; + 685CCB1014D5BA1300F5B76B /* StringsAttached.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringsAttached.h; sourceTree = ""; }; + 685CCB1114D5BA1300F5B76B /* StringsAttached.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StringsAttached.m; sourceTree = ""; }; + 686315D314DDE7B40067B682 /* ReceiveXFer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReceiveXFer.h; sourceTree = ""; }; + 686315D414DDE7B40067B682 /* ReceiveXFer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ReceiveXFer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 68697A73166BC88900D08FEA /* PumpKIN.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PumpKIN.xib; sourceTree = ""; }; + 68697A75166BC91900D08FEA /* Credits.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = ""; }; + 68697A7E166BCBAD00D08FEA /* pumpkin-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "pumpkin-Info.plist"; sourceTree = ""; }; + 68697A81166BCBE000D08FEA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 687435A814142E50003EF6EF /* klever-background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "klever-background.png"; sourceTree = ""; }; + 68783E41148585EA00DEE0B5 /* IPFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPFormatter.h; sourceTree = ""; }; + 68783E42148585EB00DEE0B5 /* IPFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IPFormatter.m; sourceTree = ""; }; + 68B3D56C14E1CD37002B0D56 /* ARequest.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ARequest.xib; sourceTree = ""; }; + 68B3D56F14E1CE8D002B0D56 /* ARequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ARequest.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 68B3D57014E1CE8D002B0D56 /* ARequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ARequest.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 68D5F05C14F2ADBF00CF4CFE /* ConfirmRequest.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ConfirmRequest.xib; sourceTree = ""; }; + 68D5F05F14F4397200CF4CFE /* ConfirmRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ConfirmRequest.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 68D5F06014F4397200CF4CFE /* ConfirmRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ConfirmRequest.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 68DAEE0514118CB60007A630 /* pumpkin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = pumpkin.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 68DAEE1514118CB60007A630 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 68DAEE1714118CB60007A630 /* pumpkin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "pumpkin-Prefix.pch"; sourceTree = ""; }; + 68DAEE1B14118CB60007A630 /* PumpKIN.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PumpKIN.h; sourceTree = ""; }; + 68DAEE1C14118CB60007A630 /* PumpKIN.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PumpKIN.m; sourceTree = ""; }; + 68DAEE2A14118D370007A630 /* biportal */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = biportal; sourceTree = BUILT_PRODUCTS_DIR; }; + 68DAEE2D14118D370007A630 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 68DAEE0214118CB60007A630 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 68428F7C166BAFC600AF8D8C /* Security.framework in Frameworks */, + 68428F7A166BAFB500AF8D8C /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 68DAEE2714118D370007A630 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 68428F75166BA34400AF8D8C /* graphics */ = { + isa = PBXGroup; + children = ( + 68081EAC160F8BE8009D14E1 /* abort.icns */, + 68081EAA160F856A009D14E1 /* get.icns */, + 68081EA8160E6D2B009D14E1 /* put.icns */, + 687435A814142E50003EF6EF /* klever-background.png */, + ); + name = graphics; + sourceTree = ""; + }; + 68DAEDFA14118CB60007A630 = { + isa = PBXGroup; + children = ( + 683B812A15EA9FB5002A9253 /* pumpkin.icns */, + 68DAEE0F14118CB60007A630 /* pumpkin */, + 68DAEE2C14118D370007A630 /* biportal */, + 68DAEE0814118CB60007A630 /* Frameworks */, + 68DAEE0614118CB60007A630 /* Products */, + ); + sourceTree = ""; + }; + 68DAEE0614118CB60007A630 /* Products */ = { + isa = PBXGroup; + children = ( + 68DAEE0514118CB60007A630 /* pumpkin.app */, + 68DAEE2A14118D370007A630 /* biportal */, + ); + name = Products; + sourceTree = ""; + }; + 68DAEE0814118CB60007A630 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 68428F7B166BAFC600AF8D8C /* Security.framework */, + 68428F79166BAFB500AF8D8C /* Cocoa.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 68DAEE0F14118CB60007A630 /* pumpkin */ = { + isa = PBXGroup; + children = ( + 68428F75166BA34400AF8D8C /* graphics */, + 685CCB0D14D4AC7700F5B76B /* XFersViewDatasource.h */, + 685CCB0E14D4AC7700F5B76B /* XFersViewDatasource.m */, + 68458CB914157A1000F1E4FF /* TFTPPacket.h */, + 682A2791141BD97B005AB8FB /* TFTPPacket.m */, + 68D5F05C14F2ADBF00CF4CFE /* ConfirmRequest.xib */, + 68D5F05F14F4397200CF4CFE /* ConfirmRequest.h */, + 68D5F06014F4397200CF4CFE /* ConfirmRequest.m */, + 682A278E1419688A005AB8FB /* XFer.h */, + 682A278F1419688B005AB8FB /* XFer.m */, + 686315D314DDE7B40067B682 /* ReceiveXFer.h */, + 686315D414DDE7B40067B682 /* ReceiveXFer.m */, + 68458CBC14157A4100F1E4FF /* SendXFer.h */, + 68458CBD14157A4100F1E4FF /* SendXFer.m */, + 68458CB5141579E100F1E4FF /* DaemonListener.h */, + 68458CB6141579E100F1E4FF /* DaemonListener.m */, + 68697A73166BC88900D08FEA /* PumpKIN.xib */, + 68DAEE1B14118CB60007A630 /* PumpKIN.h */, + 68DAEE1C14118CB60007A630 /* PumpKIN.m */, + 6808EC78166158AE00F479A9 /* IPTransformer.h */, + 6808EC79166158AE00F479A9 /* IPTransformer.m */, + 68B3D56C14E1CD37002B0D56 /* ARequest.xib */, + 68B3D56F14E1CE8D002B0D56 /* ARequest.h */, + 68B3D57014E1CE8D002B0D56 /* ARequest.m */, + 685CCB1014D5BA1300F5B76B /* StringsAttached.h */, + 685CCB1114D5BA1300F5B76B /* StringsAttached.m */, + 680E89A71482EF73008C9134 /* NumberTransformer.h */, + 680E89A81482EF73008C9134 /* NumberTransformer.m */, + 68783E41148585EA00DEE0B5 /* IPFormatter.h */, + 68783E42148585EB00DEE0B5 /* IPFormatter.m */, + 680E89A41482B03A008C9134 /* pumpkin-defaults.plist */, + 68697A7E166BCBAD00D08FEA /* pumpkin-Info.plist */, + 68DAEE1014118CB60007A630 /* Supporting Files */, + ); + path = pumpkin; + sourceTree = ""; + }; + 68DAEE1014118CB60007A630 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 68697A80166BCBE000D08FEA /* InfoPlist.strings */, + 68697A75166BC91900D08FEA /* Credits.rtf */, + 68DAEE1514118CB60007A630 /* main.m */, + 68DAEE1714118CB60007A630 /* pumpkin-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 68DAEE2C14118D370007A630 /* biportal */ = { + isa = PBXGroup; + children = ( + 68DAEE2D14118D370007A630 /* main.c */, + ); + path = biportal; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 68DAEE0414118CB60007A630 /* pumpkin */ = { + isa = PBXNativeTarget; + buildConfigurationList = 68DAEE2314118CB70007A630 /* Build configuration list for PBXNativeTarget "pumpkin" */; + buildPhases = ( + 68DAEE0114118CB60007A630 /* Sources */, + 68DAEE0214118CB60007A630 /* Frameworks */, + 68DAEE0314118CB60007A630 /* Resources */, + 6808EC7D166185F900F479A9 /* CopyFiles */, + 68697A84166BFCCB00D08FEA /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 68DAEE411412D5FC0007A630 /* PBXTargetDependency */, + ); + name = pumpkin; + productName = pumpkin; + productReference = 68DAEE0514118CB60007A630 /* pumpkin.app */; + productType = "com.apple.product-type.application"; + }; + 68DAEE2914118D370007A630 /* biportal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 68DAEE3114118D370007A630 /* Build configuration list for PBXNativeTarget "biportal" */; + buildPhases = ( + 68DAEE2614118D370007A630 /* Sources */, + 68DAEE2714118D370007A630 /* Frameworks */, + 68DAEE2814118D370007A630 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = biportal; + productName = biportal; + productReference = 68DAEE2A14118D370007A630 /* biportal */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 68DAEDFC14118CB60007A630 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + }; + buildConfigurationList = 68DAEDFF14118CB60007A630 /* Build configuration list for PBXProject "pumpkin" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 68DAEDFA14118CB60007A630; + productRefGroup = 68DAEE0614118CB60007A630 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 68DAEE0414118CB60007A630 /* pumpkin */, + 68DAEE2914118D370007A630 /* biportal */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 68DAEE0314118CB60007A630 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 687435A914142E50003EF6EF /* klever-background.png in Resources */, + 680E89A51482B03A008C9134 /* pumpkin-defaults.plist in Resources */, + 68B3D56D14E1CD37002B0D56 /* ARequest.xib in Resources */, + 68D5F05D14F2ADBF00CF4CFE /* ConfirmRequest.xib in Resources */, + 683B812B15EA9FB5002A9253 /* pumpkin.icns in Resources */, + 68081EA9160E6D2B009D14E1 /* put.icns in Resources */, + 68081EAB160F856A009D14E1 /* get.icns in Resources */, + 68081EAD160F8BE8009D14E1 /* abort.icns in Resources */, + 68697A74166BC88900D08FEA /* PumpKIN.xib in Resources */, + 68697A76166BC91900D08FEA /* Credits.rtf in Resources */, + 68697A82166BCBE000D08FEA /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 68697A84166BFCCB00D08FEA /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME).app", + "$(SRCROOT)/dmg-DS_Store", + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME).dmg", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -ex\n\nrm -f \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME-hybrid.dmg\"\nrm -rf \"$BUILT_PRODUCTS_DIR/DMG\" && mkdir -p \"$BUILT_PRODUCTS_DIR/DMG\"\ncp -R \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app\" \"$BUILT_PRODUCTS_DIR/DMG\"\nmkdir \"$BUILT_PRODUCTS_DIR/DMG/.background\"\ncp \"$SRCROOT/dmg-background.png\" \"$BUILT_PRODUCTS_DIR/DMG/.background/background.png\"\ncp \"$SRCROOT/dmg-DS_Store\" \"$BUILT_PRODUCTS_DIR/DMG/.DS_Store\"\nln -s /Applications \"$BUILT_PRODUCTS_DIR/DMG/Applications\"\nhdiutil makehybrid -o \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME-hybrid.dmg\" -hfs -hfs-openfolder \"$BUILT_PRODUCTS_DIR/DMG\" -default-volume-name \"PumpKIN\" \"$BUILT_PRODUCTS_DIR/DMG\"\nrm -rf \"$BUILT_PRODUCTS_DIR/DMG\"\n\nrm -f \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dmg\"\nhdiutil convert -format UDZO -o \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dmg\" \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME-hybrid.dmg\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 68DAEE0114118CB60007A630 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 68DAEE1614118CB60007A630 /* main.m in Sources */, + 68DAEE1D14118CB60007A630 /* PumpKIN.m in Sources */, + 68458CB7141579E100F1E4FF /* DaemonListener.m in Sources */, + 68458CBE14157A4100F1E4FF /* SendXFer.m in Sources */, + 682A27901419688B005AB8FB /* XFer.m in Sources */, + 682A2792141BD97B005AB8FB /* TFTPPacket.m in Sources */, + 680E89A91482EF73008C9134 /* NumberTransformer.m in Sources */, + 68783E43148585EB00DEE0B5 /* IPFormatter.m in Sources */, + 685CCB0F14D4AC7700F5B76B /* XFersViewDatasource.m in Sources */, + 685CCB1214D5BA1300F5B76B /* StringsAttached.m in Sources */, + 686315D514DDE7B40067B682 /* ReceiveXFer.m in Sources */, + 68B3D57114E1CE8D002B0D56 /* ARequest.m in Sources */, + 68D5F06114F4397200CF4CFE /* ConfirmRequest.m in Sources */, + 6808EC7A166158AF00F479A9 /* IPTransformer.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 68DAEE2614118D370007A630 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 68DAEE2E14118D370007A630 /* main.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 68DAEE411412D5FC0007A630 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 68DAEE2914118D370007A630 /* biportal */; + targetProxy = 68DAEE401412D5FC0007A630 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 68697A80166BCBE000D08FEA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 68697A81166BCBE000D08FEA /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 68DAEE2114118CB70007A630 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CODE_SIGN_ENTITLEMENTS = ""; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 68DAEE2214118CB70007A630 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_IDENTITY = "Developer ID Application: Mikhail Krelin"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + PROVISIONING_PROFILE = ""; + SDKROOT = macosx; + }; + name = Release; + }; + 68DAEE2414118CB70007A630 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "pumpkin/pumpkin-Prefix.pch"; + INFOPLIST_FILE = "pumpkin/pumpkin-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 68DAEE2514118CB70007A630 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "pumpkin/pumpkin-Prefix.pch"; + INFOPLIST_FILE = "pumpkin/pumpkin-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 68DAEE3214118D370007A630 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 68DAEE3314118D370007A630 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 68DAEDFF14118CB60007A630 /* Build configuration list for PBXProject "pumpkin" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 68DAEE2114118CB70007A630 /* Debug */, + 68DAEE2214118CB70007A630 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 68DAEE2314118CB70007A630 /* Build configuration list for PBXNativeTarget "pumpkin" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 68DAEE2414118CB70007A630 /* Debug */, + 68DAEE2514118CB70007A630 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 68DAEE3114118D370007A630 /* Build configuration list for PBXNativeTarget "biportal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 68DAEE3214118D370007A630 /* Debug */, + 68DAEE3314118D370007A630 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 68DAEDFC14118CB60007A630 /* Project object */; +} diff --git a/pumpkin.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/pumpkin.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ba44a6d --- a/dev/null +++ b/pumpkin.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/pumpkin/ARequest.h b/pumpkin/ARequest.h new file mode 100644 index 0000000..232dcf8 --- a/dev/null +++ b/pumpkin/ARequest.h @@ -0,0 +1,47 @@ +#import + +@interface ARequest : NSWindowController { + BOOL requestIsGet; + + CFHostRef cfhost; + + NSString *localFile; + NSString *remoteHost; + NSNumber *remotePort; + NSString *remoteFile; + NSString *xferType; + NSNumber *blockSize; + NSNumber *timeout; + + NSTextField *remoteHostBox; + BOOL doTouchMe; + NSString *statusLabel; + NSString *errorLabel; +} + +@property BOOL requestIsGet; +@property BOOL doTouchMe; +@property (copy) NSString *statusLabel; +@property (copy) NSString *errorLabel; + +@property (copy) NSString *localFile; +@property (copy) NSString *remoteHost; +@property (copy) NSNumber *remotePort; +@property (copy) NSString *remoteFile; +@property (copy) NSString *xferType; +@property (copy) NSNumber *blockSize; +@property (copy) NSNumber *timeout; + +@property (assign) IBOutlet NSTextField *remoteHostBox; + +- (IBAction)startXfer:(id)sender; +- (IBAction)pickFile:(id)sender; + +-(void)hostCallbackWithHost:(CFHostRef)h info:(CFHostInfoType)hi andError:(const CFStreamError*)e; + ++(void)getFile; ++(void)putFile; + +-(ARequest*)initWithGet:(BOOL)gr; + +@end diff --git a/pumpkin/ARequest.m b/pumpkin/ARequest.m new file mode 100644 index 0000000..439366e --- a/dev/null +++ b/pumpkin/ARequest.m @@ -0,0 +1,184 @@ + +#import "pumpkin.h" +#import "ARequest.h" +#import "ReceiveXFer.h" +#import "SendXFer.h" + +static void cbHost(CFHostRef h,CFHostInfoType hi,const CFStreamError *e,void *i) { + [(ARequest*)i hostCallbackWithHost:h info:hi andError:e]; +} + + +@implementation ARequest +@synthesize requestIsGet; +@synthesize doTouchMe; +@synthesize statusLabel; +@synthesize errorLabel; + +@synthesize localFile; +@synthesize remoteHost; +@synthesize remotePort; +@synthesize remoteFile; +@synthesize xferType; +@synthesize blockSize; +@synthesize timeout; + +@synthesize remoteHostBox; + +-(void)unhost { + if(!cfhost) return; + CFHostCancelInfoResolution(cfhost, kCFHostAddresses); + CFHostUnscheduleFromRunLoop(cfhost, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + CFRelease(cfhost); + cfhost = nil; +} +-(void)loadDefaults { + id d = [NSUserDefaultsController.sharedUserDefaultsController values]; + self.remotePort = [d valueForKey:@"remotePort"]; + self.blockSize = [d valueForKey:@"blockSize"]; + self.xferType = [d valueForKey:@"xferType"]; + self.remoteHost = [d valueForKey:@"remoteHost"]; + self.timeout = [d valueForKey:@"timeout"]; + + self.localFile = [[d valueForKey:@"tftpRoot"] stringByAppendingString:@"/"]; +} +-(void)saveDefaults { + NSUserDefaultsController *dc = [NSUserDefaultsController sharedUserDefaultsController]; + id d = dc.values; + [d setValue:self.remotePort forKey:@"remotePort"]; + [d setValue:self.remoteHost forKey:@"remoteHost"]; + [d setValue:self.blockSize forKey:@"blockSize"]; + [d setValue:self.xferType forKey:@"xferType"]; + [d setValue:self.timeout forKey:@"timeout"]; + [dc save:self]; +} + + +- (IBAction)startXfer:(id)sender { + if(!(cfhost = CFHostCreateWithName(kCFAllocatorDefault, (CFStringRef)remoteHost))) { + self.errorLabel = @"failed to even try to resolve."; + return; + } + struct CFHostClientContext hc; + hc.version=0; hc.info=self; hc.retain=0;hc.release=0; + hc.copyDescription=0; + CFHostSetClient(cfhost, cbHost, &hc); + CFHostScheduleWithRunLoop(cfhost, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + CFStreamError e; + if(!CFHostStartInfoResolution(cfhost, kCFHostAddresses, &e)) { + self.errorLabel = @"failed to start host resolution."; + [self unhost]; + return; + } + self.statusLabel = @"resolving remote host…"; + self.doTouchMe = NO; +} + +-(void)hostCallbackWithHost:(CFHostRef)h info:(CFHostInfoType)hi andError:(const CFStreamError *)e { + NSString *el = nil; + CFArrayRef aa = nil; + __block struct sockaddr_in peer; + do { + if(e && (e->domain || e->error)) { + el=@"failed to resolve remote address"; break; + } + Boolean hbr; + aa = CFHostGetAddressing(cfhost, &hbr); + if(!(hbr && aa && CFArrayGetCount(aa))) { + el=@"failed to find remote address"; break; + } + peer.sin_addr.s_addr=INADDR_NONE; [(NSArray*)aa enumerateObjectsUsingBlock:^(NSData *o,NSUInteger i,BOOL *s) { + const struct sockaddr_in *sin = o.bytes; + if(sin->sin_family!=AF_INET) return; + memmove(&peer,sin,sizeof(peer)); + *s = YES; + }]; + if(peer.sin_addr.s_addr==INADDR_NONE) { + el=@"found no ipv4 address"; break; + } + peer.sin_port = htons([remotePort unsignedIntValue]); + }while(false); + [self unhost]; + if(el) { + self.errorLabel = el; self.doTouchMe = YES; return; + } + [self saveDefaults]; + [[[requestIsGet?ReceiveXFer.class:SendXFer.class alloc] + initWithLocalFile:localFile peerAddress:&peer remoteFile:remoteFile xferType:xferType blockSize:blockSize.unsignedIntValue andTimeout:timeout.intValue] + autorelease]; + [self.window performClose:nil]; +} + +- (IBAction)pickFile:(id)sender { + NSSavePanel *p = nil; + if(requestIsGet) { + p = [NSSavePanel savePanel]; + p.canCreateDirectories = YES; + }else{ + NSOpenPanel *pp = [NSOpenPanel openPanel]; + pp.canChooseDirectories = NO; + pp.canChooseFiles = YES; + pp.allowsMultipleSelection = NO; + p = pp; + } + p.prompt = @"Pick the local file"; + if([p runModal]!=NSFileHandlingPanelOKButton) return; + self.localFile = p.URL.path; +} + +- (ARequest*) initWithGet:(BOOL)gr { + if(!(self = [super initWithWindowNibName:@"ARequest"])) return self; + self.doTouchMe = YES; + cfhost = nil; + requestIsGet = gr; + if(requestIsGet) { + self.window.title = @"Get file from remote TFTP server"; + self.window.initialFirstResponder = remoteHostBox; + }else{ + self.window.title = @"Put file to remote TFTP server"; + } + [self loadDefaults]; + [self addObserver:self forKeyPath:@"localFile" options:0 context:0]; + [self addObserver:self forKeyPath:@"remoteFile" options:0 context:0]; + return [self retain]; +} +-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if(requestIsGet) { + if([keyPath isEqualToString:@"remoteFile"]) { + if(self.remoteFile.length) { + self.localFile= [([self.localFile hasSuffix:@"/"] + ?self.localFile + :[self.localFile stringByDeletingLastPathComponent]) + stringByAppendingPathComponent:self.remoteFile.lastPathComponent]; + }else + self.localFile=[[self.localFile stringByDeletingLastPathComponent] stringByAppendingString:@"/"]; + } + }else{ + if([keyPath isEqualToString:@"localFile"]) { + self.remoteFile=[self.localFile hasSuffix:@"/"] + ?@"":self.localFile.lastPathComponent; + } + } +} + ++ (ARequest*) aRequestWithGet:(BOOL)gr { + return [[[ARequest alloc] initWithGet:gr] autorelease]; +} + +static void popMeUp(BOOL g) { + [[ARequest aRequestWithGet:g].window makeKeyAndOrderFront:nil]; +} ++ (void)getFile { popMeUp(YES); } ++ (void)putFile { popMeUp(NO); } + +- (void)windowDidLoad { +} + +- (void)windowWillClose:(NSNotification*)n { + [self unhost]; + [self removeObserver:self forKeyPath:@"localFile" context:0]; + [self removeObserver:self forKeyPath:@"remoteFile" context:0]; + [self release]; +} + +@end diff --git a/pumpkin/ARequest.xib b/pumpkin/ARequest.xib new file mode 100644 index 0000000..5a85dcf --- a/dev/null +++ b/pumpkin/ARequest.xib @@ -0,0 +1,1790 @@ + + + + 1080 + 12C60 + 2844 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + YES + NSButton + NSButtonCell + NSComboBox + NSComboBoxCell + NSCustomObject + NSProgressIndicator + NSTextField + NSTextFieldCell + NSUserDefaultsController + NSView + NSWindowTemplate + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + ARequest + + + FirstResponder + + + NSApplication + + + 3 + 2 + {{131, 159}, {553, 185}} + 611845120 + PumpKIN request + NSWindow + + + + + 256 + + YES + + + 268 + {{45, 145}, {65, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + Local file: + + LucidaGrande + 13 + 1044 + + _NS:3936 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 270 + {{115, 143}, {349, 22}} + + + + _NS:248 + YES + + -1804599231 + 272630784 + + + _NS:248 + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + NO + + + + 265 + {{472, 144}, {56, 19}} + + + + _NS:1491 + YES + + 67108864 + 134217728 + Browse + + LucidaGrande + 12 + 4883 + + _NS:1491 + + -2033434624 + 164 + + + 400 + 75 + + NO + + + + 268 + {{22, 115}, {88, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + Remote host: + + _NS:3936 + + + + + NO + + + + 268 + {{115, 113}, {146, 22}} + + + + _NS:248 + YES + + -1804599231 + 272630784 + + + _NS:248 + + YES + + + + NO + + + + 268 + {{266, 116}, {35, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + port: + + _NS:3936 + + + + + NO + + + + 268 + {{306, 113}, {71, 22}} + + + + _NS:248 + YES + + -1804599231 + 272630784 + + + _NS:248 + + YES + + + + NO + + + + 268 + {{380, 115}, {28, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + file: + + _NS:3936 + + + + + NO + + + + 268 + {{413, 113}, {120, 22}} + + + + _NS:248 + YES + + -1804599231 + 272630784 + + + _NS:248 + + YES + + + + NO + + + + 268 + {{17, 83}, {93, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + Transfer type: + + _NS:3936 + + + + + NO + + + + 268 + {{115, 79}, {99, 26}} + + + + _NS:66 + YES + + 342884416 + 272630784 + + + _NS:66 + + YES + + + 2 + YES + YES + + YES + octet + netascii + + + + + 274 + {13, 42} + + + _NS:108 + YES + NO + YES + + YES + + 10 + 10 + 1000 + + 75497472 + 0 + + + LucidaGrande + 12 + 16 + + + 3 + MC4zMzMzMzI5ODU2AA + + + + + 338690112 + 1024 + + + YES + + 6 + System + controlBackgroundColor + + + + + 3 + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 19 + tableViewAction: + -765427712 + + + + 1 + 15 + 0 + YES + 0 + 1 + + + NO + + + + 268 + {{39, 53}, {71, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + Block size: + + _NS:3936 + + + + + NO + + + + 268 + {{115, 49}, {99, 26}} + + + + _NS:66 + YES + + 342884416 + 272630784 + + + _NS:66 + + YES + + + 5 + YES + + YES + 512 + 1024 + 2048 + 4096 + + + + + 274 + {13, 84} + + + _NS:108 + YES + NO + YES + + YES + + 10 + 10 + 1000 + + 75497472 + 0 + + + + 3 + MC4zMzMzMzI5ODU2AA + + + + + 338690112 + 1024 + + + YES + + + + 3 + YES + + + + 3 + 2 + + + 19 + tableViewAction: + -765427712 + + + + 1 + 15 + 0 + YES + 0 + 1 + + + NO + + + + 268 + {{49, 23}, {61, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + Timeout: + + _NS:3936 + + + + + NO + + + + 268 + {{115, 20}, {96, 22}} + + + _NS:248 + YES + + -1804599231 + 272630784 + + + _NS:248 + + YES + + + + NO + + + + 268 + {{238, 45}, {178, 32}} + + + + _NS:161 + YES + + 67108864 + 134217728 + I've changed my mind + + _NS:161 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{416, 45}, {123, 32}} + + + + _NS:161 + YES + + 67108864 + 134217728 + Start transfer + + _NS:161 + + -2038284288 + 129 + + + DQ + 200 + 25 + + NO + + + + 1292 + {{244, 83}, {16, 16}} + + + + _NS:3954 + 28938 + 100 + + + + 268 + {{263, 83}, {273, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + status… + + _NS:3936 + + + + + NO + + + + 268 + {{241, 83}, {295, 17}} + + + + _NS:3936 + YES + + 68157504 + 272630784 + + + _NS:3936 + + + + 1 + MSAwIDAAA + + + NO + + + {553, 185} + + + + _NS:2818 + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + YES + + + YES + + + + + YES + + + window + + + + 29 + + + + blockSizeBox + + + + 60 + + + + remoteHostBox + + + + 129 + + + + startXfer: + + + + 130 + + + + pickFile: + + + + 131 + + + + performClose: + + + + 35 + + + + initialFirstResponder + + + + 62 + + + + delegate + + + + 128 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 80 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 82 + + + + value: self.blockSize + + + + + + value: self.blockSize + value + self.blockSize + + YES + + YES + NSContinuouslyUpdatesValue + NSValueTransformerName + + + YES + + NumberTransformer + + + 2 + + + 56 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 77 + + + + value: self.xferType + + + + + + value: self.xferType + value + self.xferType + + NSContinuouslyUpdatesValue + + + 2 + + + 52 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 75 + + + + value: self.remoteFile + + + + + + value: self.remoteFile + value + self.remoteFile + + NSContinuouslyUpdatesValue + + + 2 + + + 49 + + + + value: self.localFile + + + + + + value: self.localFile + value + self.localFile + + NSContinuouslyUpdatesValue + + + 2 + + + 43 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 70 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 73 + + + + value: self.remoteHost + + + + + + value: self.remoteHost + value + self.remoteHost + + NSContinuouslyUpdatesValue + + + 2 + + + 46 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 85 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 87 + + + + value: self.remotePort + + + + + + value: self.remotePort + value + self.remotePort + + NSValueTransformerName + NumberTransformer + + 2 + + + 111 + + + + animate: self.doTouchMe + + + + + + animate: self.doTouchMe + animate + self.doTouchMe + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 94 + + + + hidden: self.doTouchMe + + + + + + hidden: self.doTouchMe + hidden + self.doTouchMe + 2 + + + 95 + + + + value: self.statusLabel + + + + + + value: self.statusLabel + value + self.statusLabel + 2 + + + 104 + + + + enabled: self.doTouchMe + + + + + + enabled: self.doTouchMe + enabled + self.doTouchMe + 2 + + + 138 + + + + hidden: self.doTouchMe + + + + + + hidden: self.doTouchMe + hidden + self.doTouchMe + 2 + + + 140 + + + + value: self.errorLabel + + + + + + value: self.errorLabel + value + self.errorLabel + 2 + + + 115 + + + + hidden: self.doTouchMe + + + + + + hidden: self.doTouchMe + hidden + self.doTouchMe + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 118 + + + + value: self.timeout + + + + + + value: self.timeout + value + self.timeout + + NSValueTransformerName + NumberTransformer + + 2 + + + 127 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 3 + + + YES + + + + Window - Request dialog + + + 4 + + + YES + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + + YES + + + + Push Button - no + + + 6 + + + YES + + + + Push Button - go + + + 7 + + + YES + + + + Combo Box - block size + + + 8 + + + YES + + + + Combo Box - xfer type + + + 9 + + + YES + + + + + + 10 + + + YES + + + + + + 11 + + + YES + + + + Text Field - remote file + + + 12 + + + YES + + + + + + 13 + + + YES + + + + Text Field - local file + + + 14 + + + YES + + + + + + 15 + + + YES + + + + + + 16 + + + + + 17 + + + + + 18 + + + + + 19 + + + + + 20 + + + + + 21 + + + + + 22 + + + + + 23 + + + + + 24 + + + + + 25 + + + + + 26 + + + + + 30 + + + YES + + + + Text Field - remote host + + + 31 + + + + + 32 + + + YES + + + + + + 33 + + + + + 37 + + + + + 63 + + + YES + + + + + + 64 + + + + + 65 + + + YES + + + + Text Field - remote port + + + 66 + + + + + 88 + + + progress indicator + + + 89 + + + YES + + + + + + 90 + + + + + 112 + + + YES + + + + Static Text - error + + + 113 + + + + + 121 + + + YES + + + + + + 122 + + + + + 123 + + + YES + + + + Text Field - timeout + + + 124 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 10.IBPluginDependency + 11.IBAttributePlaceholdersKey + 11.IBPluginDependency + 112.IBPluginDependency + 113.IBPluginDependency + 12.IBPluginDependency + 121.IBPluginDependency + 122.IBPluginDependency + 123.IBAttributePlaceholdersKey + 123.IBPluginDependency + 124.IBPluginDependency + 13.IBAttributePlaceholdersKey + 13.IBPluginDependency + 14.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 19.IBPluginDependency + 20.IBPluginDependency + 21.IBPluginDependency + 22.IBPluginDependency + 23.IBAttributePlaceholdersKey + 23.IBComboBoxObjectValuesKey.objectValues + 23.IBPluginDependency + 24.IBComboBoxObjectValuesKey.objectValues + 24.IBPluginDependency + 25.IBPluginDependency + 26.IBPluginDependency + 3.IBPluginDependency + 3.NSWindowTemplate.visibleAtLaunch + 30.IBAttributePlaceholdersKey + 30.IBPluginDependency + 31.IBPluginDependency + 32.IBPluginDependency + 33.IBPluginDependency + 37.IBPluginDependency + 4.IBPluginDependency + 4.IBUserGuides + 5.IBPluginDependency + 6.IBAttributePlaceholdersKey + 6.IBPluginDependency + 63.IBPluginDependency + 64.IBPluginDependency + 65.IBAttributePlaceholdersKey + 65.IBPluginDependency + 66.IBPluginDependency + 7.IBAttributePlaceholdersKey + 7.IBPluginDependency + 8.IBAttributePlaceholdersKey + 8.IBPluginDependency + 88.IBPluginDependency + 89.IBPluginDependency + 9.IBPluginDependency + 90.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Remote file name (possibly with path relative to tftp root directory). + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Retransmission timeout in seconds. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Local full file name with path. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + YES + + + + + YES + octet + netascii + + com.apple.InterfaceBuilder.CocoaPlugin + + YES + 512 + 1024 + 2048 + 4096 + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Remote host name or IP address. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + YES + + com.apple.InterfaceBuilder.CocoaPlugin + + YES + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Remote UDP port. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Transmission block size in bytes. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + TFTP transfer type. Typically 'octet' or 'netascii'. Isn't really taken into account by PumpKIN. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 140 + + + + YES + + ARequest + NSWindowController + + YES + + YES + pickFile: + startXfer: + + + YES + id + id + + + + YES + + YES + pickFile: + startXfer: + + + YES + + pickFile: + id + + + startXfer: + id + + + + + remoteHostBox + NSTextField + + + remoteHostBox + + remoteHostBox + NSTextField + + + + IBProjectSource + ./Classes/ARequest.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/pumpkin/ConfirmRequest.h b/pumpkin/ConfirmRequest.h new file mode 100644 index 0000000..5db6f2e --- a/dev/null +++ b/pumpkin/ConfirmRequest.h @@ -0,0 +1,38 @@ + +#import +#import "TFTPPacket.h" +#import "XFer.h" + +enum RequestVerdict { + verdictDeny = 0, + verdictAllow, verdictRename, + verdictDefault = verdictDeny +}; + +@interface ConfirmRequest : NSWindowController { + XFer *xfer; + NSString *remoteHost; + NSString *remoteAction; + NSString *fileName; + BOOL fileExists; + BOOL isWriteRequest; + NSTimer *timeout; +} + +@property (copy) NSString *remoteHost; +@property (copy) NSString *remoteAction; +@property (copy) NSString *fileName; +@property BOOL fileExists; +@property BOOL isWriteRequest; + +@property (assign) IBOutlet NSButton *allowButton; +@property (assign) IBOutlet NSButton *denyButton; +@property (assign) IBOutlet NSButton *renameButton; + +- (IBAction)letItBe:(id)sender; +- (IBAction)deny:(id)sender; +- (IBAction)rename:(id)sender; + ++ (void) confirmationWithXfer:(XFer*)x; + +@end diff --git a/pumpkin/ConfirmRequest.m b/pumpkin/ConfirmRequest.m new file mode 100644 index 0000000..73dfcc1 --- a/dev/null +++ b/pumpkin/ConfirmRequest.m @@ -0,0 +1,57 @@ + +#import "ConfirmRequest.h" +#import "StringsAttached.h" + +@implementation ConfirmRequest +@synthesize remoteHost; +@synthesize remoteAction; +@synthesize fileName; +@synthesize fileExists; +@synthesize isWriteRequest; + +-(void)sentence:(int)v { + [timeout invalidate], [timeout release], timeout=nil; + [xfer goOnWithVerdict:v]; + [self.window performClose:nil]; + [[[NSUserDefaultsController sharedUserDefaultsController] values] + setValue:@(v) forKey:isWriteRequest?@"WRQ.lastSentence":@"RRQ.lastSentence"]; + [self release]; +} + +- (IBAction)letItBe:(id)sender { [self sentence:verdictAllow]; } +- (IBAction)deny:(id)sender { [self sentence:verdictDeny]; } +- (IBAction)rename:(id)sender { [self sentence:verdictRename]; } +- (void)timeout { [self sentence:verdictDefault]; } + +- (ConfirmRequest*) initWithXfer:(XFer *)x { + enum TFTPOp op = x.initialPacket.op; + NSAssert(op==tftpOpRRQ || op==tftpOpWRQ,@"Invalid request to confirm"); + if(!(self=[super initWithWindowNibName:@"ConfirmRequest"])) return self; + isWriteRequest = op==tftpOpWRQ; + remoteHost = [[NSString stringWithHostAddress:x.peer] retain]; + remoteAction = isWriteRequest?@"tries to send you":@"requests the file"; + fileName = x.xferFilename; + fileExists = [[NSFileManager defaultManager] fileExistsAtPath:x.localFile]; + xfer = [x retain]; + switch([[[[NSUserDefaultsController sharedUserDefaultsController] values] valueForKey:isWriteRequest?@"WRQ.lastSentence":@"RRQ.lastSentence"] intValue]) { + case verdictAllow: self.window.initialFirstResponder = self.allowButton; break; + case verdictDeny: self.window.initialFirstResponder = self.denyButton; break; + case verdictRename: self.window.initialFirstResponder = self.renameButton; break; + } + [self.window makeKeyAndOrderFront:nil]; + timeout = [[NSTimer scheduledTimerWithTimeInterval:[[[[NSUserDefaultsController sharedUserDefaultsController] values] valueForKey:@"confirmationTimeout"] intValue] target:self selector:@selector(timeout) userInfo:nil repeats:NO] retain]; + return self; +} + +- (void) dealloc { + if(timeout) [timeout invalidate], [timeout release]; + if(remoteHost) [remoteHost release]; + if(xfer) [xfer release]; + [super dealloc]; +} + ++ (void) confirmationWithXfer:(XFer *)x { + [[self alloc] initWithXfer:x]; +} + +@end diff --git a/pumpkin/ConfirmRequest.xib b/pumpkin/ConfirmRequest.xib new file mode 100644 index 0000000..86d0030 --- a/dev/null +++ b/pumpkin/ConfirmRequest.xib @@ -0,0 +1,695 @@ + + + + 1080 + 12C60 + 2844 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + NSButton + NSButtonCell + NSCustomObject + NSTextField + NSTextFieldCell + NSUserDefaultsController + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + ConfirmRequest + + + FirstResponder + + + NSApplication + + + 11 + 2 + {{578, 340}, {276, 203}} + 544735232 + Incoming request + NSWindow + + + {276, 203} + {276, 203} + + + 256 + + + + 268 + {{17, 166}, {60, 17}} + + + _NS:3936 + YES + + 68157504 + 272630784 + The host + + LucidaGrande + 13 + 1044 + + _NS:3936 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + {{79, 166}, {117, 17}} + + + _NS:3936 + YES + + 68157504 + 272630784 + 255.255.255.255 + + LucidaGrande-Bold + 13 + 2072 + + _NS:3936 + + YES + + + + NO + + + + 268 + {{17, 141}, {134, 17}} + + + _NS:3936 + YES + + 68157504 + 272630784 + is requesting the file + + _NS:3936 + + + + + NO + + + + 266 + {{17, 116}, {242, 17}} + + + _NS:3936 + YES + + 68157504 + 138413056 + tftp.bin + + _NS:3936 + + + + + NO + + + + 268 + {{17, 97}, {69, 11}} + + + _NS:3936 + YES + + 68157504 + 272630784 + (the file exists) + + LucidaGrande + 9 + 3614 + + _NS:3936 + + + + + NO + + + + 268 + {{96, 72}, {103, 17}} + + + _NS:3936 + YES + + 68157504 + 138413056 + do you want to + + _NS:3936 + + + + + NO + + + + 266 + {{20, 45}, {109, 19}} + + + _NS:1534 + YES + + -2080374784 + 134217728 + let it be + + LucidaGrande + 12 + 16 + + _NS:1534 + + -2038153216 + 164 + + + 400 + 75 + + NO + + + + 266 + {{146, 45}, {110, 19}} + + + _NS:1534 + YES + + -2080374784 + 134217728 + deny access + + _NS:1534 + + -2038153216 + 164 + + + 400 + 75 + + NO + + + + 266 + {{20, 19}, {236, 19}} + + _NS:1534 + YES + + -2080374784 + 134217728 + save under different name + + _NS:1534 + + -2038153216 + 164 + + + 400 + 75 + + NO + + + {276, 203} + + + + {{0, 0}, {1440, 878}} + {276, 225} + {276, 225} + YES + + + YES + + + + + + + window + + + + 37 + + + + rename: + + + + 40 + + + + deny: + + + + 46 + + + + letItBe: + + + + 47 + + + + allowButton + + + + 48 + + + + denyButton + + + + 49 + + + + renameButton + + + + 50 + + + + delegate + + + + 36 + + + + value: self.remoteHost + + + + + + value: self.remoteHost + value + self.remoteHost + 2 + + + 28 + + + + value: self.remoteAction + + + + + + value: self.remoteAction + value + self.remoteAction + 2 + + + 30 + + + + value: self.fileName + + + + + + value: self.fileName + value + self.fileName + 2 + + + 32 + + + + hidden: self.fileExists + + + + + + hidden: self.fileExists + hidden + self.fileExists + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 35 + + + + hidden: self.writeRequest + + + + + + hidden: self.writeRequest + hidden + self.writeRequest + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 45 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + + + + + + + + + + + + 3 + + + + + + + + 4 + + + + + 5 + + + + + + + + 6 + + + + + 7 + + + + + + + + 8 + + + + + 9 + + + + + + + + 10 + + + + + 11 + + + + + + + + 12 + + + + + 13 + + + + + + Button - allow + + + 14 + + + + + 15 + + + + + + + + 16 + + + + + 19 + + + + + + Button - deny + + + 20 + + + + + 21 + + + + + + Button - rename + + + 22 + + + + + 25 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Allow transfer. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Send back the rejection. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Automatically rename file before saving. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 50 + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/pumpkin/Credits.rtf b/pumpkin/Credits.rtf new file mode 100644 index 0000000..3855c1a --- a/dev/null +++ b/pumpkin/Credits.rtf @@ -0,0 +1,17 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 + +\f0\b\fs24 \cf0 \'a9 2012 Klever Group (http://www.klever.net/)\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\b0 \cf0 \ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\ +\ +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 + +\b \cf0 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.} \ No newline at end of file diff --git a/pumpkin/DaemonListener.h b/pumpkin/DaemonListener.h new file mode 100644 index 0000000..1bb6f2a --- a/dev/null +++ b/pumpkin/DaemonListener.h @@ -0,0 +1,15 @@ + +#import +#include + +@class PumpKIN; +@interface DaemonListener : NSObject { + CFSocketRef sockie; + PumpKIN *pumpkin; + CFRunLoopSourceRef runloopSource; +} + ++(DaemonListener*)listenerWithDefaults; +-(void)callbackWithType:(CFSocketCallBackType)t addr:(CFDataRef)a data:(const void *)d; + +@end diff --git a/pumpkin/DaemonListener.m b/pumpkin/DaemonListener.m new file mode 100644 index 0000000..ab14296 --- a/dev/null +++ b/pumpkin/DaemonListener.m @@ -0,0 +1,111 @@ +#import "DaemonListener.h" +#import "TFTPPacket.h" +#import "SendXFer.h" +#import "ReceiveXFer.h" +#import "StringsAttached.h" + +#include +#include +#include + +static void cbListener(CFSocketRef sockie,CFSocketCallBackType cbt,CFDataRef cba, + const void *cbd,void *i) { + [(DaemonListener*)i callbackWithType:cbt addr:cba data:cbd]; +} + +@implementation DaemonListener + +-(void)callbackWithType:(CFSocketCallBackType)t addr:(CFDataRef)a data:(const void *)d { + switch(t) { + case kCFSocketDataCallBack: + { + struct sockaddr_in *sin = (struct sockaddr_in*)CFDataGetBytePtr(a); + if([pumpkin hasPeer:sin]) { + [pumpkin log:@"I'm already processing the request from %@",[NSString stringWithSocketAddress:sin]]; + return; + } + TFTPPacket *p = [TFTPPacket packetWithData:(NSData*)d]; + switch([p op]) { + case tftpOpRRQ: [[[SendXFer alloc] initWithPeer:sin andPacket:p] autorelease]; break; + case tftpOpWRQ: [[[ReceiveXFer alloc] initWithPeer:sin andPacket:p] autorelease]; break; + default: + [pumpkin log:@"Invalid OP %d received from %@",p.op,[NSString stringWithSocketAddress:sin]]; + break; + } + } + break; + default: + NSLog(@"unhandled callback: %lu",t); + break; + } +} + + +-(DaemonListener*)initWithAddress:(struct sockaddr_in*)sin { + if(!(self=[super init])) return self; + + pumpkin = NSApplication.sharedApplication.delegate; + + @try { + CFSocketContext ctx; + ctx.version = 0; + ctx.info = self; + ctx.retain = 0; ctx.release = 0; + ctx.copyDescription = 0; + sockie = CFSocketCreate(kCFAllocatorDefault,PF_INET,SOCK_DGRAM,IPPROTO_UDP, + kCFSocketReadCallBack|kCFSocketDataCallBack, + cbListener,&ctx); + if(ntohs(sin->sin_port)>1024) { + NSData *nsd = [NSData dataWithBytes:sin length:sizeof(*sin)]; + if(CFSocketSetAddress(sockie, (CFDataRef)nsd)) + [[NSException exceptionWithName:@"BindFailure" + reason:[NSString stringWithFormat:@"Binding failed, error code: %d", errno] + userInfo:@{@"errno": @errno} + ] raise]; + }else{ + const char *args[] = { + 0, + [[NSString stringWithFormat:@"%d", CFSocketGetNative(sockie)] UTF8String], + [[NSString stringWithHostAddress:sin] UTF8String], + [[NSString stringWithPortNumber:sin] UTF8String], + NULL + }; + [pumpkin runBiportal:args]; + } + }@catch(NSException *e) { + if(sockie) { + CFSocketInvalidate(sockie); + CFRelease(sockie); + } + @throw; + } + + runloopSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, sockie, 0); + CFRunLoopAddSource(CFRunLoopGetCurrent(),runloopSource, kCFRunLoopDefaultMode); + return self; +} + +-(void)dealloc { + if(runloopSource) { + CFRunLoopRemoveSource(CFRunLoopGetCurrent(), runloopSource, kCFRunLoopDefaultMode); + CFRelease(runloopSource); + } + if(sockie) { + CFSocketInvalidate(sockie); + CFRelease(sockie); + } + [super dealloc]; +} + ++(DaemonListener*) listenerWithDefaults { + struct sockaddr_in sin; + memset(&sin,0,sizeof(sin)); + sin.sin_len=sizeof(sin); + sin.sin_family=AF_INET; + id d = [[NSUserDefaultsController sharedUserDefaultsController] values]; + sin.sin_port=htons([[d valueForKey:@"bindPort"] intValue]); + sin.sin_addr.s_addr=inet_addr([[d valueForKey:@"bindAddress"] UTF8String]); + return [[[DaemonListener alloc] initWithAddress:&sin] autorelease]; +} + +@end diff --git a/pumpkin/IPFormatter.h b/pumpkin/IPFormatter.h new file mode 100644 index 0000000..c98f3a0 --- a/dev/null +++ b/pumpkin/IPFormatter.h @@ -0,0 +1,6 @@ + +#import + +@interface IPFormatter : NSFormatter + +@end diff --git a/pumpkin/IPFormatter.m b/pumpkin/IPFormatter.m new file mode 100644 index 0000000..78a51b4 --- a/dev/null +++ b/pumpkin/IPFormatter.m @@ -0,0 +1,21 @@ + +#import "IPFormatter.h" +#include + +@implementation IPFormatter + +-(NSString *)stringForObjectValue:(id)obj { + if(![obj isKindOfClass:[NSString class]]) return nil; + return obj; +} + +-(BOOL)getObjectValue:(id*)anObject forString:(NSString*)string errorDescription:(NSString**)error { + if(inet_addr(string.UTF8String)==INADDR_NONE) { + if(error) *error=@"Doesn't look like an IP address to me"; + return NO; + } + *anObject = [NSString stringWithString:string]; + return YES; +} + +@end diff --git a/pumpkin/IPTransformer.h b/pumpkin/IPTransformer.h new file mode 100644 index 0000000..8c52c71 --- a/dev/null +++ b/pumpkin/IPTransformer.h @@ -0,0 +1,6 @@ + +#import + +@interface IPTransformer : NSValueTransformer + +@end diff --git a/pumpkin/IPTransformer.m b/pumpkin/IPTransformer.m new file mode 100644 index 0000000..2307b05 --- a/dev/null +++ b/pumpkin/IPTransformer.m @@ -0,0 +1,21 @@ + +#import "IPTransformer.h" + +#include + +@implementation IPTransformer + ++(Class)transformedValueClass { return [NSString class]; } ++(BOOL)allowsReverseTransformation { return YES; } +-(id)transformedValue:(id)value { + if(value && + [value respondsToSelector:@selector(UTF8String)] + && inet_addr([value UTF8String])!=INADDR_NONE ) + return value; + return nil; +} +-(id)reverseTransformedValue:(id)value { + return [self transformedValue:value]; +} + +@end \ No newline at end of file diff --git a/pumpkin/NSPortNumberTransformer.h b/pumpkin/NSPortNumberTransformer.h new file mode 100644 index 0000000..c9afb6c --- a/dev/null +++ b/pumpkin/NSPortNumberTransformer.h @@ -0,0 +1,5 @@ +#import + +@interface NSPortNumberTransformer : NSValueTransformer + +@end diff --git a/pumpkin/NSPortNumberTransformer.m b/pumpkin/NSPortNumberTransformer.m new file mode 100644 index 0000000..e1a14a5 --- a/dev/null +++ b/pumpkin/NSPortNumberTransformer.m @@ -0,0 +1,22 @@ +#import "NSPortNumberTransformer.h" + +@implementation NSPortNumberTransformer + ++(Class)transformedValueClass { return [NSNumber class]; } ++(BOOL)allowsReverseTransformation { return YES; } +-(id)transformedValue:(id)value { + if(value==nil) return nil; + if(![value respondsToSelector:@selector(integerValue)]) return nil; + NSInteger rv = [value integerValue]; + if(rv<1 || rv>32767) return nil; + return [NSString stringWithFormat:@"%u",rv]; +} +-(id)reverseTransformedValue:(id)value { + if(value==nil) return nil; + if(![value respondsToSelector:@selector(integerValue)]) return nil; + NSInteger rv = [value integerValue]; + if(rv<1 || rv>32767) return nil; + return [NSNumber numberWithInteger:rv]; +} + +@end diff --git a/pumpkin/NumberTransformer.h b/pumpkin/NumberTransformer.h new file mode 100644 index 0000000..373950e --- a/dev/null +++ b/pumpkin/NumberTransformer.h @@ -0,0 +1,6 @@ + +#import + +@interface NumberTransformer : NSValueTransformer + +@end diff --git a/pumpkin/NumberTransformer.m b/pumpkin/NumberTransformer.m new file mode 100644 index 0000000..c02cd8b --- a/dev/null +++ b/pumpkin/NumberTransformer.m @@ -0,0 +1,19 @@ + +#import "NumberTransformer.h" + +@implementation NumberTransformer + ++(Class)transformedValueClass { return [NSNumber class]; } ++(BOOL)allowsReverseTransformation { return YES; } +-(id)transformedValue:(id)value { + if(value==nil) return nil; + if(![value respondsToSelector:@selector(integerValue)]) return nil; + return [NSString stringWithFormat:@"%lu",[value integerValue]]; +} +-(id)reverseTransformedValue:(id)value { + if(value==nil) return nil; + if(![value respondsToSelector:@selector(integerValue)]) return nil; + return @([value integerValue]); +} + +@end diff --git a/pumpkin/PumpKIN.h b/pumpkin/PumpKIN.h new file mode 100644 index 0000000..d582c94 --- a/dev/null +++ b/pumpkin/PumpKIN.h @@ -0,0 +1,49 @@ +#import +#import "DaemonListener.h" +#include +#import "XFersViewDatasource.h" + +enum { + onRRQGive=0, onRRQPrompt, onRRQDeny, + onWRQTake=0, onWRQPromptIfExists, onWRQPrompt, onWRQDeny +}; + +@interface PumpKIN : NSObject { + NSWindow *window; + NSTextView *logger; + DaemonListener *listener; + NSWindow *preferencesWindow; + NSUserDefaultsController *theDefaults; + NSMutableArray *xfers; + NSTableView *xfersView; + XFersViewDatasource *xvDatasource; + NSToolbar *toolbar; +} + +@property (assign) IBOutlet NSWindow *window; +@property (assign) IBOutlet NSTextView *logger; +- (IBAction)showPreferences:(id)sender; +@property (assign) IBOutlet NSWindow *preferencesWindow; +@property (assign) IBOutlet NSUserDefaultsController *theDefaults; +- (IBAction)pickTFTPFolder:(id)sender; +- (IBAction)pickLogFile:(id)sender; +@property (assign) IBOutlet NSTableView *xfersView; +@property (readonly) BOOL hasSelectedXfer; +@property (assign) IBOutlet NSToolbar *toolbar; +- (IBAction)abortXfer:(id)sender; +- (IBAction)getFile:(id)sender; +- (IBAction)putFile:(id)sender; + ++(void)initialize; + +-(void)log:(NSString*)fmt,...; +-(void)registerXfer:(id)xfer; +-(void)unregisterXfer:(id)xfer; +-(void)updateXfers; +-(BOOL)hasPeer:(struct sockaddr_in*)sin; + +-(void)tableViewSelectionDidChange:(NSNotification*)an; + +- (void)runBiportal:(char const**)arg; + +@end diff --git a/pumpkin/PumpKIN.m b/pumpkin/PumpKIN.m new file mode 100644 index 0000000..9a4623a --- a/dev/null +++ b/pumpkin/PumpKIN.m @@ -0,0 +1,301 @@ +#include +#include + +#import "PumpKIN.h" +#import "NumberTransformer.h" +#import "IPTransformer.h" +#import "XFer.h" +#import "XFersViewDatasource.h" +#import "ARequest.h" + + +@implementation PumpKIN +@synthesize toolbar; +@synthesize preferencesWindow; +@synthesize theDefaults; + +@synthesize window; +@synthesize logger; +@synthesize xfersView; + +-(void) updateListener { + if(listener) { + [listener release]; listener = nil; + } + if(![[theDefaults.values valueForKey:@"listen"] boolValue]) return; + @try { + listener = [[DaemonListener listenerWithDefaults] retain]; + } + @catch (NSException *e) { + [self log:@"Error starting the server. %@: %@",e.name,e.reason]; + NSAlert *a = [NSAlert alertWithMessageText:@"Failed to enable tftp server" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Failed to enable tftp server.\n%@\n\n%@",e.name,e.reason]; + a.alertStyle = NSWarningAlertStyle; + enum act_type { + actDont = 0, + actBindToAny = NSAlertThirdButtonReturn+1, + actRemoveTFTPD, actChangePort + }; + id en; + if (e.userInfo && (en=(e.userInfo)[@"errno"])) { + switch([en intValue]) { + case EADDRINUSE: + { + int p = [[theDefaults.values valueForKey:@"bindPort"] intValue]; + if(p==69) { + a.informativeText = @"The OS reports that the address is already in use.\n\n" + "It probably means, that some other programm is listening on the TFTP port." + " since Mac OS X comes with its own tftpd, it is the likeliest suspect." + " If you're going to use tftp server a lot, you may prefer to use that one." + " If you want to use PumpKIN, you can either use unprivileged port (but make sure" + " the client is aware of that and supports it) or unload Apple tftpd using" + " command 'launchctl remove com.apple.tftpd' (as root). I can try doing either for you."; + [a addButtonWithTitle:@"Change port to 6969"].tag = actChangePort; + [a addButtonWithTitle:@"Try to stop Apple's tftpd"].tag = actRemoveTFTPD; + }else if(p!=6969) { + a.informativeText = @"The OS reports that the address is already in use.\n\n" + "It probably means, that some other program is listening on the port." + " you can either try to find out who's using the port and shut it down or" + " change the port. Make sure to notify your peers of the change." + " I can help you with changing the port."; + [a addButtonWithTitle:@"Change port to 6969"].tag = actChangePort; + }else { + a.informativeText = @"The OS reports that the address is already in use.\n\n" + "It probably means that some other program is listening on the port." + "You should either change port to the one that is not used or find the" + " offending program and shut it down. Or go on without server."; + } + } + break; + case EADDRNOTAVAIL: + a.informativeText = @"The OS reports that the address is not available.\n\n" + "It probably means, that the IP address you specified is not configured on this machine.\n\n" + "You can either ignore the error and go on without TFTP server, fix the ip address, by entering the one" + " that is configured, or bind to the special '0.0.0.0' ip address which means listen to any" + " address configured. The latter you can do automatically with a single click below."; + [a addButtonWithTitle:@"Listen to any address"].tag = actBindToAny; + [a addButtonWithTitle:@"Try removing Apple's daemon"].tag = actRemoveTFTPD; + break; + } + }; + [theDefaults.values setValue:@NO forKey:@"listen"]; + switch([a runModal]) { + case actBindToAny: + [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(bindToAny) userInfo:nil repeats:NO]; + break; + case actChangePort: + [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(bindTo6969) userInfo:nil repeats:NO]; + break; + case actRemoveTFTPD: + { + @try { + char const *args[] = { 0,"-k",NULL }; + [self runBiportal:args]; + }@catch(NSException *e) { + [self log:@"Error trying to unload com.apple.tftpd. %@: %@",e.name,e.reason]; + } + } + [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(bindAgain) userInfo:nil repeats:NO]; + break; + } + } +} + +-(void)bindAgain { + [theDefaults.values setValue:@YES forKey:@"listen"]; +} +-(void)bindTo6969 { + [theDefaults.values setValue:@6969 forKey:@"bindPort"]; + [self bindAgain]; +} +-(void)bindToAny { + [theDefaults.values setValue:@"0.0.0.0" forKey:@"bindAddress"]; + [self bindAgain]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if( object==theDefaults && ( + [keyPath isEqualToString:@"values.listen"] + || [keyPath isEqualToString:@"values.bindPort"] + || [keyPath isEqualToString:@"values.bindAddress"]) ) { + [self updateListener]; + } +} + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + [theDefaults addObserver:self forKeyPath:@"values.listen" options:0 context:0]; + [theDefaults addObserver:self forKeyPath:@"values.bindAddress" options:0 context:0]; + [theDefaults addObserver:self forKeyPath:@"values.bindPort" options:0 context:0]; + + listener = nil; + [window.contentView setWantsLayer:true]; + window.backgroundColor = [NSColor colorWithPatternImage:[NSImage imageNamed:@"klever-background.png"]]; + xfersView.dataSource = (xvDatasource = [[XFersViewDatasource alloc] initWithXfers:xfers=[NSMutableArray arrayWithCapacity:4]]); + [self updateListener]; + if(![[theDefaults values] valueForKey:@"tftpRoot"]) + [self showPreferences:nil]; +} + +- (IBAction)showPreferences:(id)sender { + [preferencesWindow makeKeyAndOrderFront:preferencesWindow]; +} + +- (void)log:(NSString*)fmt,... { + va_list vl; va_start(vl, fmt); + NSString *s = [[[[NSString alloc] initWithFormat:fmt arguments:vl] autorelease] stringByAppendingString:@"\n"]; + va_end(vl); + NSString *lf = [theDefaults.values valueForKey:@"logFile"]; + if(lf && ![lf isEqualTo:@""]) { + NSFileHandle *l = [NSFileHandle fileHandleForWritingAtPath:lf]; + if(!l) { + [[NSFileManager defaultManager] createFileAtPath:lf contents:nil attributes:nil]; + l = [NSFileHandle fileHandleForWritingAtPath:lf]; + } + if(!l) { + static NSString *bl = nil; + if(!(bl && [bl isEqualToString:lf])) { + [[logger textStorage] appendAttributedString:[[[NSAttributedString alloc] initWithString: + [NSString stringWithFormat:@"Failed to open/create '%@' log file\n",lf] ] autorelease]]; + if(bl) [bl release]; + bl = [NSString stringWithString:lf]; + } + }else{ + [l seekToEndOfFile]; + [l writeData:[[NSString stringWithFormat:@"[%@] %@",[[NSDate date] description],s] dataUsingEncoding:NSUTF8StringEncoding]]; + [l closeFile]; + } + } + [[logger textStorage] appendAttributedString:[[[NSAttributedString alloc] initWithString: + s ] autorelease]]; + [logger scrollToEndOfDocument:nil]; +} + +-(void)registerXfer:(id)xfer { + [xfers insertObject:xfer atIndex:0]; + [self updateXfers]; +} +-(void)unregisterXfer:(id)xfer { + [xfers removeObject:xfer]; + [self updateXfers]; +} +-(void)updateXfers { + [xfersView reloadData]; +} +-(BOOL)hasPeer:(struct sockaddr_in*)sin { + return NSNotFound!=[xfers indexOfObjectPassingTest:^BOOL(XFer *x,NSUInteger i,BOOL *s) { + struct sockaddr_in *p = x.peer; + return p->sin_len==sin->sin_len && !memcmp(p, sin, p->sin_len); + }]; +} + +-(BOOL)hasSelectedXfer { + return [xfersView selectedRow]>=0; +} + +-(void)tableViewSelectionDidChange:(NSNotification *)an { + [toolbar validateVisibleItems]; +} +-(BOOL)validateToolbarItem:(NSToolbarItem *)theItem { + if([theItem.itemIdentifier isEqualToString:@"abort_xfer"]) + return self.hasSelectedXfer; + return YES; +} +-(IBAction)abortXfer:(id)sender { + NSInteger r = [xfersView selectedRow]; + NSAssert(r>=0,@"no selected row"); + if(r<0) return; + XFer *x = xfers[r]; + [self log:@"Aborting transfer of '%@' %@",x.xferFilename,x.xferPrefix]; + [x abort]; +} + +- (IBAction)getFile:(id)sender { + [ARequest getFile]; +} +- (IBAction)putFile:(id)sender { + [ARequest putFile]; +} + +- (IBAction)pickTFTPFolder:(id)sender { + NSOpenPanel *op = [NSOpenPanel openPanel]; + op.canChooseDirectories = YES; op.canChooseFiles = NO; + op.canCreateDirectories = YES; + op.allowsMultipleSelection = NO; + op.prompt = @"Set TFTP root"; + op.title = @"TFTP root"; + op.nameFieldLabel = @"TFTP root:"; + if([op runModal]!=NSFileHandlingPanelOKButton) return; + [[theDefaults values] setValue:op.URL.path forKey:@"tftpRoot"]; +} + +- (IBAction)pickLogFile:(id)sender { + NSSavePanel *op = [NSSavePanel savePanel]; + op.canCreateDirectories = YES; + op.prompt = @"Set log file"; + op.title = @"Log to"; + op.nameFieldLabel = @"Log to"; + if([op runModal]!=NSFileHandlingPanelOKButton) return; + [[theDefaults values] setValue:op.URL.path forKey:@"logFile"]; + +} + +- (void)runBiportal:(char const**)args { + FILE *f=NULL; + AuthorizationRef a=nil; + @try { + NSString *bip=[[NSBundle mainBundle] pathForAuxiliaryExecutable:@"biportal"]; + struct stat st; + if(stat(bip.UTF8String, &st)) [NSException raise:@"ToolFailure" format:@"Can't see my tool"]; + if(st.st_uid || !(st.st_mode&S_ISUID)) { + OSStatus r = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &a); + if(r!=errAuthorizationSuccess) + [NSException raise:@"AuthFailure" format:@"failed to AuthorizationCreate(): %d",r]; + AuthorizationItem ai = {kAuthorizationRightExecute,0,NULL,0}; + AuthorizationRights ar = {1,&ai}; + r = AuthorizationCopyRights(a, &ar, NULL, kAuthorizationFlagDefaults|kAuthorizationFlagInteractionAllowed|kAuthorizationFlagPreAuthorize|kAuthorizationFlagExtendRights, NULL); + if(r!=errAuthorizationSuccess) + [NSException raise:@"AuthFailure" format:@"failed to AuthorizationCopyRights(): %d",r]; + const char *args[] = { NULL }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated" + r = AuthorizationExecuteWithPrivileges(a,bip.UTF8String, + kAuthorizationFlagDefaults, (char*const*)args, &f); +#pragma GCC diagnostic pop + if(r!=errAuthorizationSuccess) + [NSException raise:@"AuthFailure" format:@"failed to AuthorizationExecuteWithPrivileges(): %d",r]; + int e; + int sr = fscanf(f, "%d", &e); + fclose(f),f=NULL; + if(sr!=1) + [NSException raise:@"ToolFailure" format:@"failed to setup tool"]; + if(e) + [NSException raise:@"ToolFailure" format:@"failed to setup tool, error code: %d",e]; + } + *args = bip.UTF8String; + pid_t p = fork(); + if(p<0) [NSException raise:@"ToolFailure" format:@"failed to fork"]; + if(!p) execv(*args,(char**)args), exit(errno); + int r, wp; + while((wp=waitpid(p,&r,0))<0 && errno==EINTR); + if(wp!=p) [NSException raise:@"ToolFailure" format:@"failed to wait for tool"]; + if(!WIFEXITED(r)) [NSException raise:@"ToolFailure" format:@"tool failed"]; + if(WEXITSTATUS(r)) { + [[NSException exceptionWithName:@"ToolFailure" reason:[NSString stringWithFormat:@"tool failed, error code: %d", WEXITSTATUS(r)] userInfo:@{@"errno": @WEXITSTATUS(r)}] raise]; + } + }@finally { + if(f) fclose(f); + if(a) AuthorizationFree(a,kAuthorizationFlagDefaults); + } +} + ++(void)initialize { + [[NSUserDefaultsController sharedUserDefaultsController] setInitialValues: + [NSDictionary dictionaryWithContentsOfFile: + [[NSBundle mainBundle] pathForResource:@"pumpkin-defaults" ofType:@"plist"] + ] + ]; + [NSValueTransformer setValueTransformer:[[[NumberTransformer alloc] init] autorelease] forName:@"PortNumberTransformer"]; + [NSValueTransformer setValueTransformer:[[[IPTransformer alloc] init] autorelease] forName:@"IPAddressTransformer"]; +} + +@end diff --git a/pumpkin/PumpKIN.xib b/pumpkin/PumpKIN.xib new file mode 100644 index 0000000..8e76afe --- a/dev/null +++ b/pumpkin/PumpKIN.xib @@ -0,0 +1,4251 @@ + + + + 1080 + 12C60 + 2844 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + IBCustomFormatter + NSBox + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSMatrix + NSMenu + NSMenuItem + NSNumberFormatter + NSScrollView + NSScroller + NSSplitView + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell + NSTextView + NSToolbar + NSToolbarFlexibleSpaceItem + NSToolbarItem + NSToolbarSpaceItem + NSUserDefaultsController + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + + + PumpKIN + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + PumpKIN + + + + About PumpKIN + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide PumpKIN + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit PumpKIN + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + XFer + + 1048576 + 2147483647 + + + submenuAction: + + XFer + + + + Get file + g + 1048576 + 2147483647 + + + + + + Put file + p + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Abort xfer + + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find and Replace… + f + 1572864 + 2147483647 + + + 12 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + + + Show Spelling and Grammar + : + 1048576 + 2147483647 + + + + + + Check Document Now + ; + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + Correct Spelling Automatically + + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + + + Show Substitutions + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Dashes + + 2147483647 + + + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + Text Replacement + + 2147483647 + + + + + + + + + Transformations + + 2147483647 + + + submenuAction: + + Transformations + + + + Make Upper Case + + 2147483647 + + + + + + Make Lower Case + + 2147483647 + + + + + + Capitalize + + 2147483647 + + + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Customize Toolbar… + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + YES + Help + + 2147483647 + + + submenuAction: + + Help + + + + PumpKIN Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + 15 + 2 + {{335, 390}, {600, 322}} + 1954021376 + PumpKIN + NSWindow + + + 348FD175-E511-41B0-AC1C-205ED57FC50B + + + YES + YES + YES + NO + 1 + 2 + + + + 6D17B806-047D-4E35-9CBF-FA07113768DF + + Abort xfer + Abort xfer + Cancel transfer in progress. + + + NSImage + abort + + + + {0, 0} + {0, 0} + YES + YES + -1 + YES + 0 + + + + 7587C7D2-FAE0-4AF7-9DDB-64F34C45BD11 + + Put file + Put file + Initiate WRQ request. + + + NSImage + put + + + + {0, 0} + {0, 0} + YES + YES + -1 + YES + 0 + + + + FAB1C64D-0CC8-46A0-815A-6423AD586E28 + + Get file + Get file + Initiate RRQ request. + + + NSImage + get + + + + {0, 0} + {0, 0} + YES + YES + -1 + YES + 0 + + + NSToolbarFlexibleSpaceItem + + Flexible Space + + + + + + {1, 5} + {20000, 32} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + + + NSToolbarSpaceItem + + Space + + + + + + {32, 5} + {32, 32} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + + + + + + + + + + + + + + + + + + + + {492, 200} + + + 256 + + + + 274 + + + + 256 + + + + 274 + + + + 2304 + + + + 256 + {568, 115} + + + _NS:1197 + YES + NO + YES + + + 256 + {568, 17} + + + _NS:1199 + + + + + -2147483392 + {{224, 0}, {16, 17}} + _NS:1202 + + + + fileName + 235 + 40 + 1000 + + 75497536 + 2048 + file + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337641536 + 2048 + Text Cell + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 3 + YES + + + + xferType + 40 + 40 + 1000 + + 75497536 + 134219776 + type + + + + + + 67108928 + 2048 + Text Cell + + + + + + 3 + YES + + TFTP transfer type. + + + peerAddress + 150 + 10 + 3.4028234663852886e+38 + + 75497536 + 134219776 + peer + + + 6 + System + headerColor + + 3 + MQA + + + + + + 67108928 + 2048 + Text Cell + + + + + + 3 + YES + + Peer address. + + + ackBytes + 64 + 10 + 3.4028234663852886e+38 + + 75497536 + 134219776 + ACK + + + + + + 67108928 + 67110912 + Text Cell + + + + + + 3 + YES + + Acknowledged (transferred) portion size. + + + xferSize + 64 + 10 + 3.4028234663852886e+38 + + 75497536 + 134219776 + size + + + + + + 67108928 + 67110912 + Text Cell + + + + + + 3 + YES + + Total file size. + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + -750780416 + + + 5 + 15 + 0 + YES + 0 + 1 + + + {{1, 17}, {568, 115}} + + + _NS:1195 + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + _NS:1214 + NO + + _doScroller: + 37 + 0.1947367936372757 + + + + -2147483392 + {{1, 118}, {568, 15}} + + + _NS:1216 + NO + 1 + + _doScroller: + 0.99824253075571179 + + + + 2304 + + + + {{1, 0}, {568, 17}} + + + _NS:1200 + + + 4 + + + {570, 133} + + + _NS:1193 + 133682 + + + + + QSAAAEEgAABBmAAAQZgAAA + 0.25 + 4 + 1 + + + {570, 133} + + + _NS:547 + NSView + + + + 256 + + + + 274 + + + + 2304 + + + + 2322 + {568, 130} + + + _NS:3760 + + + + + + + + + + + + 38 + + + + 568 + 1 + + + 67119877 + 0 + + + + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + + + + + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + 1 + + 6 + {696, 10000000} + + + + {{1, 1}, {568, 130}} + + + _NS:3758 + + + + {4, 5} + + 12582912 + + + + + + TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym +SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA +AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA +AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA +AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA + + + + + + 3 + MCAwAA + + + + 4 + + + + 256 + {{553, 1}, {16, 130}} + + + _NS:3774 + NO + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + _NS:3762 + NO + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {570, 132} + + + _NS:148 + 133138 + + + + 0.25 + 4 + 1 + + + {{0, 134}, {570, 132}} + + + _NS:549 + NSView + + + {{15, 41}, {570, 266}} + + + _NS:545 + 2 + + + + 33 + + + + 274 + + + + 289 + {{13, 0}, {174, 29}} + + + _NS:239 + YES + + -2080374784 + 134217728 + Listen on the address + + _NS:239 + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + NO + + + + 289 + {{201, 3}, {119, 22}} + + + _NS:248 + YES + + -1804599231 + 138413056 + 0.0.0.0 + + _NS:248 + + YES + + 6 + System + textBackgroundColor + + + + 6 + System + textColor + + + + NO + + + + 289 + {{325, 2}, {75, 22}} + + + _NS:3936 + YES + + 68157504 + 138413056 + and port + + _NS:3936 + + YES + + 6 + System + controlColor + + + + + NO + + + + 289 + {{405, 3}, {40, 22}} + + _NS:248 + YES + + -1804599231 + 71304192 + 69 + + _NS:248 + + YES + + + + NO + + + {{1, 1}, {460, 28}} + + + _NS:11 + + + {{123, 7}, {462, 30}} + + + _NS:9 + {0, 0} + + 67108864 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 4 + 2 + NO + 5 + + 6 + System + windowBackgroundColor + + + + + {600, 322} + + + {{0, 0}, {1440, 878}} + {492, 269} + {10000000000000, 10000000000000} + YES + + + 3 + 2 + {{131, 159}, {603, 348}} + 1685586944 + PumpKIN Preferences + NSWindow + + + + + 256 + + + + 12 + + + + 274 + + + + 268 + {{18, 14}, {481, 22}} + + + _NS:248 + YES + + -1804599231 + 272630784 + + + _NS:248 + + YES + + + + NO + + + + 268 + {{507, 17}, {56, 19}} + + + _NS:1491 + YES + + 67108864 + 134217728 + Browse + + LucidaGrande + 12 + 16 + + _NS:1491 + + -2037104640 + 36 + + NSImage + NSPathTemplate + + + + 400 + 75 + + NO + + + {{1, 1}, {581, 46}} + + + _NS:632 + + + {{10, 266}, {583, 62}} + + + _NS:630 + {0, 0} + + 67108864 + 0 + TFTP filesystem root (download path) + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + + 12 + + + + 274 + + + + 268 + {{18, 14}, {481, 22}} + + + _NS:248 + YES + + -1804599231 + 272630784 + + + _NS:248 + + YES + + + + NO + + + + 268 + {{507, 15}, {56, 19}} + + + _NS:1491 + YES + + 67108864 + 134217728 + Browse + + _NS:1491 + + -2033434624 + 164 + + + 400 + 75 + + NO + + + {{1, 1}, {581, 46}} + + + _NS:632 + + + {{10, 200}, {583, 62}} + + + _NS:630 + {0, 0} + + 67108864 + 0 + Log file (leave empty to disable logging to file) + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + + 12 + + + + 274 + + + + 268 + {{18, 14}, {190, 58}} + + + _NS:266 + YES + NO + 3 + 1 + + + -2080374784 + 0 + Give all files + + + 1211912448 + 0 + + NSRadioButton + + 400 + 75 + + + 67108864 + 0 + Prompt before giving a file + + + 1 + 1211912448 + 0 + + 400 + 75 + + + 67108864 + 0 + Deny all requests + + + 2 + 1211912448 + 0 + + 400 + 75 + + + {190, 18} + {4, 2} + 1151868928 + NSActionCell + + 67108864 + 0 + Radio + + -1 + 1211912448 + 0 + + 549453824 + {18, 18} + + + + + + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw +IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ +29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 +dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA +AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG +AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ +0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ +7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ +5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ +3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD +AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns +AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ +6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ +/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ +///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl +YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA +AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD +AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu +AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB +AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + + + + + + + 400 + 75 + + + + + + + + {{1, 1}, {581, 82}} + + + _NS:632 + + + {{10, 98}, {583, 98}} + + + _NS:630 + {0, 0} + + 67108864 + 0 + Read Request Behavior + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + + 12 + + + + 274 + + + + 268 + {{18, 14}, {526, 38}} + + _NS:266 + YES + NO + 2 + 2 + + + -2080374784 + 0 + Take all files + + + 1211912448 + 0 + + + + 200 + 25 + + + 67108864 + 0 + Prompt if file exists + + + 1 + 1211912448 + 0 + + 400 + 75 + + + 67108864 + 0 + Always prompt before accepting a file + + + 2 + 1211912448 + 0 + + 549453824 + {18, 18} + + + + + + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw +IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ +29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 +dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA +AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG +AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ +0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ +7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ +5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ +3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD +AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns +AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ +6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ +/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ +///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl +YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA +AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD +AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu +AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB +AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + + + + + + + 400 + 75 + + + 67108864 + 0 + Deny all requests + + + 3 + 1211912448 + 0 + + 400 + 75 + + + {261, 18} + {4, 2} + 1151868928 + NSActionCell + + 67108864 + 0 + Radio + + -1 + 1211912448 + 0 + + 549453824 + {18, 18} + + + + + + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw +IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ +29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 +dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA +AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG +AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ +0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ +7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ +5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ +3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD +AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns +AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ +6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ +/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ +///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl +YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA +AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD +AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu +AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB +AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + + + + + + + 400 + 75 + + + + + + + + {{1, 1}, {581, 62}} + + + _NS:632 + + + {{10, 16}, {583, 78}} + + + _NS:630 + {0, 0} + + 67108864 + 0 + Write Request Behavior + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + {603, 348} + + _NS:2818 + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + YES + + + + + + + + + + + -∞ + + + +∞ + + # + # + + + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + YES + + + + PumpKIN + + + NSFontManager + + + YES + + + + + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + toggleAutomaticSpellingCorrection: + + + + 456 + + + + orderFrontSubstitutionsPanel: + + + + 458 + + + + toggleAutomaticDashSubstitution: + + + + 461 + + + + toggleAutomaticTextReplacement: + + + + 463 + + + + uppercaseWord: + + + + 464 + + + + capitalizeWord: + + + + 467 + + + + lowercaseWord: + + + + 468 + + + + pasteAsPlainText: + + + + 486 + + + + performFindPanelAction: + + + + 487 + + + + performFindPanelAction: + + + + 488 + + + + performFindPanelAction: + + + + 489 + + + + showHelp: + + + + 493 + + + + performFindPanelAction: + + + + 535 + + + + window + + + + 532 + + + + logger + + + + 572 + + + + toolbar + + + + 1020 + + + + abortXfer: + + + + 1142 + + + + abortXfer: + + + + 1143 + + + + getFile: + + + + 1144 + + + + putFile: + + + + 1145 + + + + putFile: + + + + 1146 + + + + preferencesWindow + + + + 1147 + + + + theDefaults + + + + 1148 + + + + showPreferences: + + + + 1149 + + + + pickLogFile: + + + + 1151 + + + + xfersView + + + + 1152 + + + + getFile: + + + + 1154 + + + + pickTFTPFolder: + + + + 1162 + + + + delegate + + + + 1019 + + + + enabled: self.hasSelectedXfer + + + + + + enabled: self.hasSelectedXfer + enabled + self.hasSelectedXfer + 2 + + + 1023 + + + + enabled: self.hasSelectedXfer + + + + + + enabled: self.hasSelectedXfer + enabled + self.hasSelectedXfer + 2 + + + 1027 + + + + formatter + + + + 1103 + + + + value: values.bindAddress + + + + + + value: values.bindAddress + value + values.bindAddress + + + IPTransformer + + 2 + + + 1164 + + + + formatter + + + + 1097 + + + + value: values.bindPort + + + + + + value: values.bindPort + value + values.bindPort + + NSValueTransformerName + NumberTransformer + + 2 + + + 1153 + + + + value: values.listen + + + + + + value: values.listen + value + values.listen + 2 + + + 1140 + + + + value: values.listen + + + + + + value: values.listen + value + values.listen + 2 + + + 1158 + + + + value: values.tftpRoot + + + + + + value: values.tftpRoot + value + values.tftpRoot + 2 + + + 1134 + + + + selectedTag: values.rrqBehavior + + + + + + selectedTag: values.rrqBehavior + selectedTag + values.rrqBehavior + 2 + + + 1133 + + + + selectedTag: values.wrqBehavior + + + + + + selectedTag: values.wrqBehavior + selectedTag + values.wrqBehavior + 2 + + + 1135 + + + + value: values.logFile + + + + + + value: values.logFile + value + values.logFile + 2 + + + 1136 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + + + + + + + + + + + 19 + + + + + + + + 56 + + + + + + + + 217 + + + + + + + + 83 + + + + + + + + 81 + + + + + + + + + + + 205 + + + + + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + + + + + + 216 + + + + + + + + 200 + + + + + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 57 + + + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + + + + + + 296 + + + + + + + + + 297 + + + + + 298 + + + + + 211 + + + + + + + + 212 + + + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + + + + + + 349 + + + + + + + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 371 + + + + + + + Window - PumpKIN + + + 372 + + + + + + + + + 420 + + + + + 450 + + + + + + + + 451 + + + + + + + + + + 452 + + + + + 453 + + + + + 454 + + + + + 457 + + + + + 459 + + + + + 460 + + + + + 462 + + + + + 465 + + + + + 466 + + + + + 485 + + + + + 490 + + + + + + + + 491 + + + + + + + + 492 + + + + + 494 + + + + + 534 + + + + + 536 + + + + + + + + + 537 + + + + + + + + 538 + + + + + + + + 547 + + + + + + + + + + 548 + + + + + 549 + + + + + 550 + + + + + 551 + + + + + + + + + + + 552 + + + + + 553 + + + + + 554 + + + + + 555 + + + + + + + + + + + + 556 + + + + + + + + 557 + + + + + + + + 558 + + + + + 559 + + + + + 566 + + + + + + + + 567 + + + + + 568 + + + + + + + + 569 + + + + + 570 + + + + + + + + 571 + + + + + 815 + + + + + + Window - PumpKIN preferences + + + 816 + + + + + + + + + + + 915 + + + + + 994 + + + + + + + + + + + + 998 + + + + + 999 + + + + + 1000 + + + Toolbar Item - Get file + + + 1001 + + + Toolbar Item - Put file + + + 1002 + + + Toolbar Item - Abort xfer + + + 1003 + + + Menu Item - Get file + + + 1004 + + + Menu Item - Put file + + + 1006 + + + + + 1007 + + + Menu Item - Abort xfer + + + 1096 + + + Port formatter + + + 1102 + + + IP formatter + + + 1108 + + + + + + + Box - TFTP filesystem root (download path) + + + 1115 + + + + + + + + 1114 + + + + + + + + 1117 + + + + + 1116 + + + + + 1106 + + + + + + + + 1123 + + + + + + + + + + + + 1128 + + + + + 1127 + + + Button Cell - take all + + + 1126 + + + Button Cell - prompt + + + 1125 + + + Button Cell - prompt if exists + + + 1124 + + + Button Cell - deny all + + + 1105 + + + + + + + Box - Log file (leave empty to disable logging to file) + + + 1130 + + + + + + + + 1129 + + + + + + + + 1132 + + + + + 1131 + + + + + 1107 + + + + + + + + 1118 + + + + + + + + + + + 1119 + + + Button Cell - deny all + + + 1120 + + + Button Cell - prompt + + + 1121 + + + Button Cell - give all + + + 1122 + + + + + 1161 + + + + + + + + + + + 1090 + + + + + + Check Box - listen + + + 1091 + + + + + 1082 + + + + + + Text Field - bind address + + + 1083 + + + + + 1086 + + + + + + + + 1087 + + + + + 1084 + + + + + + Text Field - bind port + + + 1085 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + abort_xfer + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + If you only want PumpKIN to listen to TFTP request on one IP address, specify it here. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + The standard TFTP port is 69. If you change it, make sure peers are aware of the change and support it. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + When enabled, pumpkin also acts as a daemon (server). Note, that this often requires escalating privileges to bind to the privileged (69 by default) port and may also conflict if you have another tftp daemon running (you'll be notified). + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + IPFormatter + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + TFTP root is a directory where incoming WRQ transfers are saved and RRQ transfers are served from. Point it to where the file you want to transfer are. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Browse for the TFTP root directory. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + No incoming RRQ will be served. Acess will be invariably denied. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + PumpKIN will prompt the user (probably, you) whenever RRQ request comes in. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Server will automatically approve all incoming RRQ transfers (as long as they stay in TFTP root, of course). + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + No incoming WRQ transfer will be accepted. Acess will be invariably denied. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Incoming WRQ transfers for non-existing files are pre-approved, whereas an attempt to transfer already existing file results in prompting the user. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + All incoming WRQ transfers should be accepted by the user. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + All incoming WRQ transfers will be accepted. Note, that if file by the same name already exists, it will be renamed. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Browse for the TFTP log file. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + PumpKIN can optionally log the activity shown on screen into this file. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{380, 496}, {480, 360}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Activity log. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + logger + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 1164 + + + + + IPFormatter + NSFormatter + + IBProjectSource + ./Classes/IPFormatter.h + + + + PumpKIN + NSObject + + id + id + id + id + id + id + + + + abortXfer: + id + + + getFile: + id + + + pickLogFile: + id + + + pickTFTPFolder: + id + + + putFile: + id + + + showPreferences: + id + + + + NSTextView + NSWindow + NSUserDefaultsController + NSToolbar + NSWindow + NSTableView + + + + logger + NSTextView + + + preferencesWindow + NSWindow + + + theDefaults + NSUserDefaultsController + + + toolbar + NSToolbar + + + window + NSWindow + + + xfersView + NSTableView + + + + IBProjectSource + ./Classes/PumpKIN.h + + + + + 0 + IBCocoaFramework + YES + 3 + + {11, 11} + {10, 3} + {13, 10} + {15, 15} + {32, 32} + {32, 32} + {32, 32} + + + + + + NSFormatter + + + + diff --git a/pumpkin/ReceiveXFer.h b/pumpkin/ReceiveXFer.h new file mode 100644 index 0000000..f62fcdc --- a/dev/null +++ b/pumpkin/ReceiveXFer.h @@ -0,0 +1,8 @@ + +#import "XFer.h" + +@interface ReceiveXFer : XFer + +-(ReceiveXFer*)initWithPeer:(struct sockaddr_in *)sin andPacket:(TFTPPacket*)p; +-(ReceiveXFer*)initWithLocalFile:(NSString *)lf peerAddress:(const struct sockaddr_in *)pa remoteFile:(NSString *)rf xferType:(NSString *)xt blockSize:(uint16_t)bs andTimeout:(int)to; +@end diff --git a/pumpkin/ReceiveXFer.m b/pumpkin/ReceiveXFer.m new file mode 100644 index 0000000..33e9604 --- a/dev/null +++ b/pumpkin/ReceiveXFer.m @@ -0,0 +1,168 @@ +#import "ReceiveXFer.h" +#import "StringsAttached.h" +#import "ConfirmRequest.h" + +@implementation ReceiveXFer + +- (ReceiveXFer*)initWithLocalFile:(NSString *)lf peerAddress:(const struct sockaddr_in *)pa remoteFile:(NSString *)rf xferType :(NSString *)xt blockSize:(uint16_t)bs andTimeout:(int)to{ + if(!(self = [super init])) return self; + xferPrefix = @"⬇"; + retryTimeout = to; + localFile = lf; + memmove(&peer,pa,sizeof(peer)); + [[NSFileManager defaultManager] createFileAtPath:localFile contents:nil attributes:nil]; + if(!(theFile = [[NSFileHandle fileHandleForWritingAtPath:localFile] retain])) { + [pumpkin log:@"Failed to create '%@', transfer aborted.", localFile]; + return self; + } + [self createSocket]; + NSMutableDictionary *o = [NSMutableDictionary dictionaryWithCapacity:4]; + [o setValue:[NSString stringWithFormat:@"%u",bs] forKey:@"blksize"]; + [o setValue:@"" forKey:@"tsize"]; + [o setValue:[NSString stringWithFormat:@"%d",(int)retryTimeout] forKey:@"timeout"]; + state = xferStateConnecting; + [self queuePacket:[TFTPPacket packetRRQWithFile:xferFilename=rf xferType:xferType=xt andOptions:o]]; + [self appear]; + return self; +} + +- (ReceiveXFer*)initWithPeer:(struct sockaddr_in *)sin andPacket:(TFTPPacket *)p { + if(!(self = [super initWithPeer:sin andPacket:p])) return self; + xferPrefix = @"⬇"; + xferFilename=[p.rqFilename retain]; xferType=[p.rqType retain]; + [pumpkin log:@"'%@' of type '%@' is coming from %@", xferFilename, xferType, [NSString stringWithSocketAddress:&peer]]; + + [self createSocket]; + [self appear]; + + if(![self makeLocalFileName:xferFilename]) + return self; + + switch([[pumpkin.theDefaults.values valueForKey:@"wrqBehavior"] intValue]) { + case onWRQDeny: [self goOnWithVerdict:verdictDeny]; break; + case onWRQTake: [self goOnWithVerdict:verdictAllow]; break; + case onWRQPromptIfExists: + if(![[NSFileManager defaultManager] fileExistsAtPath:localFile]) { + [self goOnWithVerdict:verdictAllow]; + break; + } + case onWRQPrompt: + [ConfirmRequest confirmationWithXfer:self]; + break; + } + return self; +} +-(void)goOnWithVerdict:(int)verdict { + if(!(verdict==verdictAllow || verdict==verdictRename)) { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrAccessViolation andMessage:@"Access denied"]]; + return; + } + NSFileManager *fm = [NSFileManager defaultManager]; + if(verdict==verdictRename) { + int i; + for(i=1;i>0;++i) { + if(![self makeLocalFileName:[NSString stringWithFormat:@"%@ (%d)",xferFilename,i]]) + return; + if(![fm fileExistsAtPath:localFile]) break; + [localFile release],localFile=nil; + } + if(!localFile) { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrFileExists andMessage:@"Couldn't find a name for a file"]]; + return; + } + } + [pumpkin log:@"Receiving '%@'",localFile]; + [fm createFileAtPath:localFile contents:nil attributes:nil]; + if(!(theFile = [[NSFileHandle fileHandleForWritingAtPath:localFile] retain])) { + [self queuePacket:[TFTPPacket packetErrorWithErrno:errno andFallback:@"couldn't write to file"]]; + return; + } + xferSize=0; + NSMutableDictionary *o = [NSMutableDictionary dictionaryWithCapacity:4]; + [initialPacket.rqOptions enumerateKeysAndObjectsUsingBlock:^(NSString* k,NSString *v,BOOL *s) { + if([k isEqualToString:@"blksize"]) { + [o setValue:[NSString stringWithFormat:@"%u",blockSize=v.intValue] forKey:@"blksize"]; + }else if([k isEqualToString:@"tsize"]) { + [o setValue:[NSString stringWithFormat:@"%lld",xferSize=v.longLongValue] forKey:@"tsize"]; + }else if([k isEqualToString:@"timeout"]) { + [o setValue:[NSString stringWithFormat:@"%d",v.intValue] forKey:@"timeout"]; + retryTimeout = v.intValue; + }else + [pumpkin log:@"Unknown option '%@' with value '%@'. Ignoring.",k,v]; + }]; + if(xferSize) { + long xb = (xferSize/blockSize)+1; + if(xb>UINT16_MAX) { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrUndefined andMessage:[NSString stringWithFormat:@"file seems to be too big (%lld bytes) and would take %ld blocks to be transferred with the block size of %d bytes", xferSize, xb,blockSize]] ]; + return; + } + xferBlocks = xb; + } + state = xferStateXfer; + if([o count]) { + [self queuePacket:[TFTPPacket packetOACKWithOptions:o]]; + }else{ + [self queuePacket:[TFTPPacket packetACKWithBlock:acked=0]]; + } + [self updateView]; +} + +-(void)eatTFTPPacket:(TFTPPacket *)p from:(struct sockaddr_in *)sin { + if(state==xferStateConnecting) { + peer.sin_port = sin->sin_port; + [self updateView]; + }else if(![self isPeer:sin]) { + [pumpkin log:@"Packet from unexpected source (%@) received",[NSString stringWithSocketAddress:sin]]; + return; + } + switch(p.op) { + case tftpOpDATA: + { + NSData *d=p.rqData;; + @try { + if(p.block > (acked+1)) + [pumpkin log:@"While transferring %@ block %d seems to immediately follow block %d",xferFilename,p.block,acked]; + [theFile seekToFileOffset:(p.block-1)*blockSize]; + [theFile writeData:d]; + [theFile truncateFileAtOffset:(p.block-1)*blockSize+d.length]; + }@catch (NSException *e) { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrUndefined andMessage:e.reason]]; + break; + } + [self queuePacket:[TFTPPacket packetACKWithBlock: acked=p.block]]; + [self updateView]; + if(d.length +#import "TFTPPacket.h" +#import "PumpKIN.h" +#import "XFer.h" + +#include + +@interface SendXFer : XFer { +} + +-(SendXFer*)initWithPeer:(struct sockaddr_in *)sin andPacket:(TFTPPacket*)p; +-(SendXFer*)initWithLocalFile:(NSString *)lf peerAddress:(const struct sockaddr_in *)pa remoteFile:(NSString *)rf xferType:(NSString *)xt blockSize:(uint16_t)bs andTimeout:(int)to; + +-(void)xfer; + +@end diff --git a/pumpkin/SendXFer.m b/pumpkin/SendXFer.m new file mode 100644 index 0000000..9a1d85b --- a/dev/null +++ b/pumpkin/SendXFer.m @@ -0,0 +1,156 @@ +#import "SendXFer.h" +#import "StringsAttached.h" +#import "ConfirmRequest.h" + +@implementation SendXFer + +-(SendXFer*)initWithLocalFile:(NSString *)lf peerAddress:(const struct sockaddr_in *)pa remoteFile:(NSString *)rf xferType:(NSString *)xt blockSize:(uint16_t)bs andTimeout:(int)to { + if(!(self = [super init])) return self; + xferPrefix = @"⬆"; + retryTimeout = to; + localFile = lf; + memmove(&peer,pa,sizeof(peer)); + if(!(theFile = [[NSFileHandle fileHandleForReadingAtPath:localFile] retain])) { + [pumpkin log:@"Failed to open '%@', transfer aborted.",localFile]; + return self; + } + + long xb = ((xferSize=[theFile seekToEndOfFile])/blockSize)+1; + if(xb > UINT16_MAX) { + [pumpkin log:@"file is too big (%lld bytes) and will take %ld blocks to be sent with block size of %d bytes",xferSize,xb,blockSize]; + return self; + } + xferBlocks = xb; + + [self createSocket]; + NSMutableDictionary *o = [NSMutableDictionary dictionaryWithCapacity:4]; + [o setValue:[NSString stringWithFormat:@"%u",bs] forKey:@"blksize"]; + [o setValue:[NSString stringWithFormat:@"%llu",xferSize] forKey:@"tsize"]; + [o setValue:[NSString stringWithFormat:@"%d",(int)retryTimeout] forKey:@"timeout"]; + state = xferStateConnecting; + [self queuePacket:[TFTPPacket packetWRQWithFile:xferFilename=rf xferType:xferType=xt andOptions:o]]; + [self appear]; + return self; +} + +-(SendXFer*)initWithPeer:(struct sockaddr_in *)sin andPacket:(TFTPPacket*)p { + if(!(self = [super initWithPeer:sin andPacket:p])) return self; + xferPrefix = @"⬆"; + xferFilename = [p.rqFilename retain]; xferType = [p.rqType retain]; + [pumpkin log:@"'%@' of type '%@' is requested from %@", + xferFilename, xferType, [NSString stringWithSocketAddress:&peer] ]; + + [self createSocket]; + [self appear]; + + if(![self makeLocalFileName:xferFilename]) + return self; + + switch([[pumpkin.theDefaults.values valueForKey:@"rrqBehavior"] intValue]) { + case onRRQDeny: [self goOnWithVerdict:verdictDeny]; break; + case onRRQGive: [self goOnWithVerdict:verdictAllow]; break; + default: + [ConfirmRequest confirmationWithXfer:self]; + break; + } + return self; +} +-(void)goOnWithVerdict:(int)verdict { + if(verdict!=verdictAllow) { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrAccessViolation andMessage:@"Access denied"]]; + return; + } + if(!(theFile = [[NSFileHandle fileHandleForReadingAtPath:localFile] retain])) { + [self queuePacket:[TFTPPacket packetErrorWithErrno:errno andFallback:@"couldn't open file"]]; + return; + } + xferSize = [theFile seekToEndOfFile]; + NSMutableDictionary *o = [NSMutableDictionary dictionaryWithCapacity:4]; + [[initialPacket rqOptions] enumerateKeysAndObjectsUsingBlock:^(NSString* k, NSString* v, BOOL *stop) { + if([k isEqualToString:@"blksize"]) { + [o setValue:[NSString stringWithFormat:@"%u",blockSize=v.intValue] forKey:@"blksize"]; + }else if([k isEqualToString:@"tsize"]) { + [o setValue:[NSString stringWithFormat:@"%lld",xferSize] forKey:@"tsize"]; + }else if([k isEqualToString:@"timeout"]) { + [o setValue:[NSString stringWithFormat:@"%d",v.intValue] forKey:@"timeout"]; + retryTimeout = v.intValue; + }else + [pumpkin log:@"Unknown option '%@' with value '%@'. Ignoring.",k,v]; + }]; + long xb = (xferSize/blockSize)+1; + if(xb > UINT16_MAX) { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrUndefined andMessage:[NSString stringWithFormat:@"file is too big (%lld bytes) and will take %ld blocks to be sent with block size of %d bytes",xferSize,xb,blockSize]]]; + return; + } + xferBlocks = xb; + state = xferStateXfer; + if(o.count) { + [self queuePacket:[TFTPPacket packetOACKWithOptions:o]]; + }else{ + [self xfer]; + } +} + +- (void) xfer { + NSAssert(theFile,@"no file!"); + [theFile seekToFileOffset:acked*blockSize]; + [self queuePacket:[TFTPPacket packetDataWithBlock:acked+1 andData:[theFile readDataOfLength:blockSize]]]; +} + +- (void) eatTFTPPacket:(TFTPPacket*)p from:(struct sockaddr_in*)sin{ + if(state==xferStateConnecting) { + peer.sin_port = sin->sin_port; + [self updateView]; + }else if(![self isPeer:sin]) { + [pumpkin log:@"Packet from unexpected source (%@) recevied",[NSString stringWithSocketAddress:sin]]; + return; + } + switch(p.op) { + case tftpOpACK: + if(state==xferStateShutdown || ( (acked=p.block)==xferBlocks && (state=xferStateShutdown) ) ) { + CFSocketEnableCallBacks(sockie, kCFSocketWriteCallBack); + return; + } + [self updateView]; + [self xfer]; + break; + case tftpOpERROR: + [pumpkin log:@"Error %u:%@",p.rqCode, p.rqMessage]; + [self updateView]; + [self disappear]; + return; + case tftpOpOACK: + if(acked) { + [pumpkin log:@"It's a bit too late to acknowledge options, ignoring OACK packet"]; + break; + } + { + __block BOOL a=NO; + [p.rqOptions enumerateKeysAndObjectsUsingBlock:^(NSString *k,NSString *v,BOOL *s) { + if([k isEqualToString:@"blksize"]) + blockSize = v.intValue; + else if([k isEqualToString:@"tsize"]) { + }else if([k isEqualToString:@"timeout"]) + retryTimeout = v.intValue; + else{ + [pumpkin log:@"Totally unknown option '%@' with value '%@' acknowledged by peer",k,v]; + a=YES; + } + }]; + if(a) { + [self abort]; + break; + } + state = xferStateXfer; + [self updateView]; + [self xfer]; + } + break; + default: + [pumpkin log:@"Totaly unexpected opcode %d received",p.op]; + break; + } +} + + +@end diff --git a/pumpkin/StringsAttached.h b/pumpkin/StringsAttached.h new file mode 100644 index 0000000..fa73ae0 --- a/dev/null +++ b/pumpkin/StringsAttached.h @@ -0,0 +1,11 @@ + +#import +#include + +@interface NSString (StringsAttached) + ++ stringWithSocketAddress:(const struct sockaddr_in*)sin; ++ stringWithHostAddress:(const struct sockaddr_in*)sin; ++ stringWithPortNumber:(const struct sockaddr_in*)sin; + +@end diff --git a/pumpkin/StringsAttached.m b/pumpkin/StringsAttached.m new file mode 100644 index 0000000..8ad5868 --- a/dev/null +++ b/pumpkin/StringsAttached.m @@ -0,0 +1,19 @@ + +#import "StringsAttached.h" +#include + +@implementation NSString (StringsAttached) + ++ stringWithSocketAddress:(const struct sockaddr_in*)sin { + return [NSString stringWithFormat:@"%@:%u",[NSString stringWithHostAddress:sin],ntohs(sin->sin_port)]; +} ++ stringWithHostAddress:(const struct sockaddr_in*)sin { + char tmp[32]; + addr2ascii(sin->sin_family,&sin->sin_addr,sizeof(sin->sin_addr),tmp); + return @(tmp); +} ++ (id)stringWithPortNumber:(const struct sockaddr_in *)sin { + return [NSString stringWithFormat:@"%u",ntohs(sin->sin_port)]; +} + +@end diff --git a/pumpkin/TFTPPacket.h b/pumpkin/TFTPPacket.h new file mode 100644 index 0000000..a46d5bc --- a/dev/null +++ b/pumpkin/TFTPPacket.h @@ -0,0 +1,87 @@ + +#import +#include + +enum TFTPOp { + tftpOpRRQ=1, tftpOpWRQ=2, + tftpOpDATA=3, + tftpOpACK=4, + tftpOpERROR=5, + tftpOpOACK=6 +}; + +enum TFTPError { + tftpErrUndefined=0, + tftpErrNotFound=1, + tftpErrAccessViolation=2, + tftpErrDiskFull=3, + tftpErrIllegalOp=4, + tftpErrUnknownTID=5, + tftpErrFileExists=6, + tftpErrNoUser=7, + tftpErrOption=8 +}; + +#pragma pack(push,1) +struct AnyTFTPPacket { + uint16_t op; + union { + struct { + char data[1]; + } any; + struct { + char data[1]; + } rq; + struct { + char data[1]; + } rrq; + struct { + char data[1]; + } wrq; + struct { + uint16_t block; + char data[1]; + } data; + struct { + uint16_t block; + } ack; + struct { + uint16_t code; + char data[1]; + } err; + struct { + char data[1]; + } oack; + }; +}; +#pragma pack(pop) + +@interface TFTPPacket : NSObject { + NSData *data; + struct AnyTFTPPacket *packet; +} + +@property (readonly) enum TFTPOp op; +@property (readonly) NSString* rqFilename; +@property (readonly) NSString* rqType; +@property (readonly) NSDictionary* rqOptions; +@property (readonly) NSData *data; +@property (readonly) uint16_t block; +@property (readonly) NSData *rqData; +@property (readonly) uint16_t rqCode; +@property (readonly) NSString* rqMessage; + +-(TFTPPacket*)initWithData:(NSData*)d; + ++(TFTPPacket*)packetWithData:(NSData*)d; ++(TFTPPacket*)packetWithBytesNoCopy:(void*)b andLength:(size_t)l; + ++(TFTPPacket*)packetErrorWithCode:(enum TFTPError)c andMessage:(NSString*)m; ++(TFTPPacket*)packetErrorWithErrno:(int)en andFallback:(NSString*)fb; ++(TFTPPacket*)packetOACKWithOptions:(NSDictionary*)o; ++(TFTPPacket*)packetDataWithBlock:(uint16_t)b andData:(NSData*)d; ++(TFTPPacket*)packetACKWithBlock:(uint16_t)b; ++(TFTPPacket*)packetRRQWithFile:(NSString*)f xferType:(NSString*)t andOptions:(NSDictionary*)o; ++(TFTPPacket*)packetWRQWithFile:(NSString*)f xferType:(NSString*)t andOptions:(NSDictionary*)o; + +@end diff --git a/pumpkin/TFTPPacket.m b/pumpkin/TFTPPacket.m new file mode 100644 index 0000000..73f5995 --- a/dev/null +++ b/pumpkin/TFTPPacket.m @@ -0,0 +1,203 @@ + +#import "TFTPPacket.h" + +@interface NSDictionary (TFTPOptions) + +- (size_t)tftpBytesLength; +- (size_t)tftpGetBytes:(char*)p maxLength:(size_t)ml; + +@end +@implementation NSDictionary (TFTPOptions) + +- (size_t)tftpBytesLength { + __block size_t rv = 0; + [self enumerateKeysAndObjectsUsingBlock:^(id k,id v,BOOL *s) { + rv += [k lengthOfBytesUsingEncoding:NSUTF8StringEncoding]+[v lengthOfBytesUsingEncoding:NSUTF8StringEncoding]+2; + }]; + return rv; +} + +- (size_t)tftpGetBytes:(char*)p maxLength:(size_t)ml { + __block char *_p = p; + __block size_t rl = ml; + __block size_t rv = 0; + [self enumerateKeysAndObjectsUsingBlock:^(NSString *k,NSString *v,BOOL *s) { + NSUInteger l; + [k getBytes:_p maxLength:rl usedLength:&l encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0,k.length) remainingRange:NULL]; + _p+=l; *_p++=0; rl-=l+1; rv+=l+1; + [v getBytes:_p maxLength:rl usedLength:&l encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0,v.length) remainingRange:NULL]; + _p+=l; *_p++=0; rl-=l+1; rv+=l+1; + }]; + return rv; +} + +@end + +@implementation TFTPPacket +@synthesize data; + +-(BOOL) isRQOp { + return self.op==tftpOpRRQ || self.op==tftpOpWRQ; +} +-(BOOL) isOptionsOp { + return self.isRQOp || self.op==tftpOpOACK; +} +-(BOOL) isBlockOp { + return self.op==tftpOpDATA || self.op==tftpOpACK; +} + +-(enum TFTPOp)op { + NSAssert(data.length,@"no data"); + return (enum TFTPOp)ntohs(packet->op); +} +-(NSString*)rqFilename { + NSAssert( self.isRQOp, @"Wrong TFTP opcode for rq filename retrieval"); + if(!memchr(packet->rq.data, 0, [data length]-sizeof(packet->op))) return nil; + return @(packet->rq.data); +} +-(NSString*)rqType { + NSAssert( self.isRQOp, @"Wrong TFTP opcode for rq type retrieval"); + const char *z = (const char*)memchr(packet->rq.data,0, data.length-sizeof(packet->op)); + if(!z) return nil; + if(!memchr(z+1,0,data.length-sizeof(packet->op)-(z-packet->rq.data))) return nil; + return @(z+1); +} +-(NSDictionary*)rqOptions { + enum TFTPOp op = self.op; + NSAssert( self.isOptionsOp, @"Wrong TFTP opcode for options retrieval"); + const char *p = packet->any.data, *p1 = (const char*)packet + data.length; + if(op==tftpOpRRQ || op==tftpOpWRQ) { + p = (const char *)memchr(p,0,p1-p); + if(!p) return nil; + p = (const char *)memchr(p+1,0,p1-p); + if(!p) return nil; + ++p; + } + NSMutableDictionary *rv = [NSMutableDictionary dictionaryWithCapacity:8]; + while(pdata); +} +-(NSData*)rqData { + NSAssert( self.op==tftpOpDATA, @"Can't get data from the request that doesn't have it"); + return [NSData dataWithBytes:packet->data.data length:data.length-sizeof(packet->op)-sizeof(packet->data.block)]; +} +-(uint16_t)rqCode { + NSAssert(self.op==tftpOpERROR,@"Wrong TFTP opcode for error code retrieval"); + return ntohs(packet->err.code); +} +-(NSString*)rqMessage { + NSAssert(self.op==tftpOpERROR,@"Wrong TFTP opcode for error message retrieval"); + return @(packet->err.data); +} + +-(TFTPPacket*)initWithData:(NSData *)d { + if(!(self = [super init])) return self; + packet = (struct AnyTFTPPacket*)(data = [d retain]).bytes; + return self; +} + + ++(TFTPPacket*)packetWithData:(NSData*)d { + return [[[self alloc] initWithData:d] autorelease]; +} ++(TFTPPacket*)packetWithBytesNoCopy:(void*)b andLength:(size_t)l { + return [[[self alloc] initWithData:[NSData dataWithBytesNoCopy:b length:l]] autorelease]; +} + ++(TFTPPacket*)packetErrorWithCode:(enum TFTPError)c andMessage:(NSString*)m { + NSUInteger ml = [m lengthOfBytesUsingEncoding:NSUTF8StringEncoding], bb; + struct AnyTFTPPacket *b = (struct AnyTFTPPacket*)malloc(bb = sizeof(b->op)+sizeof(b->err.code)+ml+1); + if(!b) return nil; + b->op = htons(tftpOpERROR); + b->err.code = ntohs(c); + [m getBytes:b->err.data maxLength:ml usedLength:NULL encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0,m.length) remainingRange:NULL]; + b->err.data[ml]=0; + return [self packetWithBytesNoCopy:b andLength:bb]; +} ++(TFTPPacket*)packetErrorWithErrno:(int)en andFallback:(NSString *)fb{ + switch(en) { + case EACCES: + return [self packetErrorWithCode:tftpErrAccessViolation andMessage:@"acess violation"]; + case ENOENT: + return [self packetErrorWithCode:tftpErrNotFound andMessage:@"not found"]; + } + return [self packetErrorWithCode:tftpErrUndefined andMessage:fb]; +} + ++(TFTPPacket*)packetXRQWithOp:(enum TFTPOp)op file:(NSString*)f xferType:(NSString*)t andOptions:(NSDictionary*)o { + NSAssert(f && t && o,@"Something is amiss in packetXRQWithOp"); + __block size_t dl = o.tftpBytesLength + +[f lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + +[t lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + +2; + size_t pl = dl; + struct AnyTFTPPacket *b = (struct AnyTFTPPacket*)malloc(pl+=sizeof(b->op)); + if(!b) return nil; + b->op = htons(op); + __block char *p = b->rrq.data; + NSUInteger l; + [f getBytes:p maxLength:dl usedLength:&l encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0,f.length) remainingRange:NULL]; + p+=l; *p++=0; dl-=l+1; + [t getBytes:p maxLength:dl usedLength:&l encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0,t.length) remainingRange:NULL]; + p+=l; *p++=0; dl-=l+1; + l = [o tftpGetBytes:p maxLength:dl]; + p+=l; dl-=l; + NSAssert1(dl==0,@"packet of the wrong size, remaining count: %lu",dl); + return [self packetWithBytesNoCopy:b andLength:pl]; +} + ++(TFTPPacket*)packetRRQWithFile:(NSString *)f xferType:(NSString *)t andOptions:(NSDictionary *)o { + return [self packetXRQWithOp:tftpOpRRQ file:f xferType:t andOptions:o]; +} ++(TFTPPacket*)packetWRQWithFile:(NSString *)f xferType:(NSString *)t andOptions:(NSDictionary *)o { + return [self packetXRQWithOp:tftpOpWRQ file:f xferType:t andOptions:o]; +} + ++(TFTPPacket*)packetOACKWithOptions:(NSDictionary*)o { + __block NSUInteger pl = [o tftpBytesLength]; + __block NSUInteger rc = pl; + __block struct AnyTFTPPacket *b = (struct AnyTFTPPacket*)malloc(pl+=sizeof(b->op)); + if(!b) return nil; + b->op = htons(tftpOpOACK); + __block char *p = b->oack.data; + rc -= [o tftpGetBytes:p maxLength:pl]; + NSAssert1(rc==0,@"packet of the wrong size, remaining count: %lu",rc); + return [self packetWithBytesNoCopy:b andLength:pl]; +} ++(TFTPPacket*)packetDataWithBlock:(uint16_t)b andData:(NSData*)d { + NSUInteger pl; + struct AnyTFTPPacket *p = (struct AnyTFTPPacket*)malloc(pl=sizeof(p->op)+sizeof(p->data.block)+d.length); + if(!p) return nil; + p->op = htons(tftpOpDATA); + p->data.block = htons(b); + [d getBytes:p->data.data length:d.length]; + return [self packetWithBytesNoCopy:p andLength:pl]; +} ++(TFTPPacket*)packetACKWithBlock:(uint16_t)b { + NSUInteger pl; + struct AnyTFTPPacket *p = (struct AnyTFTPPacket*)malloc(pl=sizeof(p->op)+sizeof(p->ack.block)); + if(!p) return nil; + p->op = htons(tftpOpACK); + p->ack.block = htons(b); + return [self packetWithBytesNoCopy:p andLength:pl]; +} + +-(void)dealloc { + [data release]; + [super dealloc]; +} + +@end diff --git a/pumpkin/XFer.h b/pumpkin/XFer.h new file mode 100644 index 0000000..ffe7fc1 --- a/dev/null +++ b/pumpkin/XFer.h @@ -0,0 +1,68 @@ + +#import +#import "PumpKIN.h" +#include +#import "TFTPPacket.h" + +enum XFerState { + xferStateNone = 0, + xferStateConnecting, + xferStateXfer, + xferStateShutdown +}; + +@interface XFer : NSObject { + struct sockaddr_in peer; + PumpKIN *pumpkin; + CFSocketRef sockie; + CFRunLoopSourceRef runloopSource; + NSFileHandle *theFile; + uint16_t blockSize; + uint16_t acked; + unsigned long long xferSize; + uint16_t xferBlocks; + enum XFerState state; + NSString *xferType; + NSString *xferFilename; + NSTimeInterval retryTimeout; + NSTimeInterval giveupTimeout; + TFTPPacket *lastPacket; + NSTimer *retryTimer; + NSTimer *giveupTimer; + TFTPPacket *initialPacket; + NSString *xferPrefix; + + NSString *localFile; + + NSMutableArray *queue; +} +@property (readonly) struct sockaddr_in *peer; +@property (readonly) TFTPPacket *initialPacket; +@property (readonly) NSString *xferFilename; +@property (readonly) NSString *localFile; +@property (readonly) NSString *xferPrefix; + +- (id) init; +- (id) initWithPeer:(struct sockaddr_in *)sin andPacket:(TFTPPacket*)p; + +- (BOOL) createSocket; +- (void) callbackWithType:(CFSocketCallBackType)t addr:(CFDataRef)a data:(const void *)d; +- (void) queuePacket:(TFTPPacket*)p; + +- (void) eatTFTPPacket:(TFTPPacket*)p from:(struct sockaddr_in*)sin; + +- (id) cellValueForColumn:(NSString*)ci; + +- (void) updateView; +- (void) appear; +- (void) disappear; + +- (BOOL) isPeer:(struct sockaddr_in*)sin; + +- (void) abort; + +- (void) goOnWithVerdict:(int)verdict; + +- (BOOL) makeLocalFileName:(NSString*)xf; + +@end diff --git a/pumpkin/XFer.m b/pumpkin/XFer.m new file mode 100644 index 0000000..6803ade --- a/dev/null +++ b/pumpkin/XFer.m @@ -0,0 +1,205 @@ + +#import "XFer.h" +#import "TFTPPacket.h" +#import "StringsAttached.h" + +static void cbXfer(CFSocketRef sockie,CFSocketCallBackType cbt,CFDataRef cba, + const void *cbd,void *i) { + [(XFer*)i callbackWithType:cbt addr:cba data:cbd]; +} + +@implementation XFer +@synthesize initialPacket; +@synthesize xferFilename; +@synthesize localFile; +@synthesize xferPrefix; + +- (id) init { + if(!(self = [super init])) return self; + blockSize = 512; + sockie = NULL; + theFile = nil; + acked = 0; + xferSize = 0; xferBlocks = 0; + xferType = nil; xferFilename = nil; + state = xferStateNone; + pumpkin = NSApplication.sharedApplication.delegate; + queue = [[NSMutableArray alloc]initWithCapacity:4]; + localFile = nil; + retryTimeout = 3; + giveupTimeout = [[[[NSUserDefaultsController sharedUserDefaultsController] values] valueForKey:@"giveUpTimeout"] intValue]; + lastPacket = nil; retryTimer = nil; + giveupTimer = nil; + initialPacket = nil; + return self; + +} + +- (id) initWithPeer:(struct sockaddr_in *)sin andPacket:(TFTPPacket*)p { + if(!(self=[self init])) return self; + memmove(&peer,sin,sizeof(peer)); + initialPacket = [p retain]; + return self; +} + +- (struct sockaddr_in*)peer { return &peer; } + +- (BOOL) makeLocalFileName:(NSString *)xf { + NSString *fn = [xf stringByReplacingOccurrencesOfString:@"\\" withString:@"/"]; + if([fn hasPrefix:@"../"] || [fn hasSuffix:@"/.."] || [fn rangeOfString:@"/../"].location!=NSNotFound) { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrAccessViolation andMessage:@"bad path"]]; + return NO; + } + localFile = [[[pumpkin.theDefaults.values valueForKey:@"tftpRoot"] stringByAppendingPathComponent:fn] retain]; + return YES; +} + +- (void) retryTimeout { + [self queuePacket:lastPacket]; [lastPacket release]; lastPacket = nil; +} +- (void) giveUp { + [pumpkin log:@"Connection timeout for '%@'",xferFilename]; + [self abort]; +} +- (void) renewHope { + if(giveupTimer) { + [giveupTimer invalidate]; [giveupTimer release]; + } + giveupTimer = [[NSTimer scheduledTimerWithTimeInterval:giveupTimeout target:self selector:@selector(giveUp) userInfo:nil repeats:NO] retain]; +} + +- (void) callbackWithType:(CFSocketCallBackType)t addr:(CFDataRef)a data:(const void *)d { + if(!giveupTimer) [self renewHope]; + if(retryTimer) { + [retryTimer release]; [retryTimer invalidate]; retryTimer = nil; + } + switch (t) { + case kCFSocketWriteCallBack: + if(queue.count) { + TFTPPacket *p = queue[0]; + CFSocketError r = CFSocketSendData(sockie, (CFDataRef)[NSData dataWithBytesNoCopy:&peer length:sizeof(peer) freeWhenDone:NO], (CFDataRef)[NSData dataWithData:p.data], 0); + if(r!=kCFSocketSuccess) + [pumpkin log:@"Failed to send data, error %d",errno]; + if(!(p.op==tftpOpDATA || p.op==tftpOpERROR)) { + if(lastPacket) [lastPacket release]; + lastPacket = [p retain]; + if(retryTimer) { + [retryTimer invalidate]; [retryTimer release]; + } + retryTimer = [[NSTimer scheduledTimerWithTimeInterval:retryTimeout target:self selector:@selector(retryTimeout) userInfo:nil repeats:NO] retain]; + }else{ + [lastPacket release]; lastPacket = nil; + } + [queue removeObjectAtIndex:0]; + if([queue count] || state==xferStateShutdown) + CFSocketEnableCallBacks(sockie, kCFSocketWriteCallBack); + }else if(state==xferStateShutdown) { + [pumpkin log:@"%@ Transfer of '%@' finished.",xferPrefix,xferFilename]; + [self disappear]; + } + break; + case kCFSocketDataCallBack: + [self renewHope]; + [self eatTFTPPacket:[TFTPPacket packetWithData:(NSData*)d] from:(struct sockaddr_in*)CFDataGetBytePtr(a)]; + break; + default: + NSLog(@"unhandled %lu callback",t); + break; + } +} + +- (BOOL) createSocket { + CFSocketContext ctx; + ctx.version=0; ctx.info=self; ctx.retain=0; ctx.release=0; ctx.copyDescription=0; + sockie = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_DGRAM, IPPROTO_UDP, + kCFSocketReadCallBack|kCFSocketWriteCallBack|kCFSocketDataCallBack, + cbXfer, &ctx); + if(!sockie) return NO; + struct sockaddr_in a; memset(&a, 0, sizeof(a)); + a.sin_family = AF_INET; + if(CFSocketSetAddress(sockie, (CFDataRef)[NSData dataWithBytesNoCopy:&a length:sizeof(a) freeWhenDone:NO]) + !=kCFSocketSuccess) { + [pumpkin log:@"failed to set socket address"]; + return NO; + } + runloopSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, sockie, 0); + CFRunLoopAddSource(CFRunLoopGetCurrent(), runloopSource, kCFRunLoopDefaultMode); + return YES; +} + +- (void) queuePacket:(TFTPPacket*)p { + [queue addObject:p]; + CFSocketEnableCallBacks(sockie, kCFSocketWriteCallBack|kCFSocketReadCallBack); + if(p.op==tftpOpERROR) state = xferStateShutdown; +} + +- (void) goOnWithVerdict:(int)verdict { + NSAssert(false,@"unimplemented goOnWithVerdict"); +} + +- (void) eatTFTPPacket:(TFTPPacket*)p from:(struct sockaddr_in*)sin { + NSAssert(false,@"unimplemented eatTFTPPacket"); +} +-(void) abort { + [self queuePacket:[TFTPPacket packetErrorWithCode:tftpErrUndefined andMessage:@"transfer cancelled"]]; +} + +- (id) cellValueForColumn:(NSString*)ci { + if([ci isEqualToString:@"fileName"]) { + return [NSString stringWithFormat:@"%@ %@",xferPrefix,xferFilename]; + }else if([ci isEqualToString:@"xferType"]) { + return xferType; + }else if([ci isEqualToString:@"peerAddress"]) { + switch (state) { + case xferStateConnecting: return [NSString stringWithHostAddress:&peer]; + default: return [NSString stringWithSocketAddress:&peer]; + } + }else if([ci isEqualToString:@"ackBytes"]) { + return [NSString stringWithFormat:@"%u",acked*blockSize]; + }else if([ci isEqualToString:@"xferSize"]) { + return xferSize?[NSString stringWithFormat:@"%llu",xferSize]:nil; + } + return nil; +} + +- (void) updateView { + [pumpkin updateXfers]; +} +- (void) appear { + [pumpkin registerXfer:self]; +} +- (void) disappear { + if(retryTimer) { + [retryTimer invalidate]; [retryTimer release]; retryTimer = nil; + } + if(giveupTimer) { + [giveupTimer invalidate]; [giveupTimer release]; retryTimer = nil; + } + [pumpkin unregisterXfer:self]; +} + +- (BOOL) isPeer:(struct sockaddr_in*)sin { + return sin->sin_len==peer.sin_len && !memcmp(sin,&peer,sin->sin_len); +} + +-(void)dealloc { + if(runloopSource) { + CFRunLoopSourceInvalidate(runloopSource); + CFRelease(runloopSource); + } + if(sockie) { + CFSocketInvalidate(sockie); + CFRelease(sockie); + } + [queue release]; + if(theFile) [theFile release]; + if(xferFilename) [xferFilename release]; + if(xferType) [xferType release]; + if(lastPacket) [lastPacket release]; + if(initialPacket) [initialPacket release]; + if(localFile) [localFile release]; + [super dealloc]; +} + + +@end diff --git a/pumpkin/XFersViewDatasource.h b/pumpkin/XFersViewDatasource.h new file mode 100644 index 0000000..3225e1b --- a/dev/null +++ b/pumpkin/XFersViewDatasource.h @@ -0,0 +1,11 @@ + +@interface XFersViewDatasource : NSObject { + NSMutableArray *xfers; +} + +- (id)initWithXfers:(NSMutableArray*)x; + +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex; +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; + +@end diff --git a/pumpkin/XFersViewDatasource.m b/pumpkin/XFersViewDatasource.m new file mode 100644 index 0000000..1f7c689 --- a/dev/null +++ b/pumpkin/XFersViewDatasource.m @@ -0,0 +1,24 @@ + +#import "XFersViewDatasource.h" +#import "XFer.h" + +@implementation XFersViewDatasource + +- (id)initWithXfers:(NSMutableArray*)x { + if(!(self = [super init])) return self; + xfers = [x retain]; + return self; +} +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { + return [xfers[rowIndex] cellValueForColumn:aTableColumn.identifier]; +} +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView { + return xfers.count; +} + +- (void) dealloc { + [xfers release]; + [super dealloc]; +} + +@end diff --git a/pumpkin/abort.icns b/pumpkin/abort.icns new file mode 100644 index 0000000..cd688ca --- a/dev/null +++ b/pumpkin/abort.icns Binary files differ diff --git a/pumpkin/en.lproj/InfoPlist.strings b/pumpkin/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..5495781 --- a/dev/null +++ b/pumpkin/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ +CFBundleDisplayName = "PumpKIN"; \ No newline at end of file diff --git a/pumpkin/get.icns b/pumpkin/get.icns new file mode 100644 index 0000000..c0120da --- a/dev/null +++ b/pumpkin/get.icns Binary files differ diff --git a/pumpkin/klever-background.png b/pumpkin/klever-background.png new file mode 100644 index 0000000..42bb1e5 --- a/dev/null +++ b/pumpkin/klever-background.png Binary files differ diff --git a/pumpkin/main.m b/pumpkin/main.m new file mode 100644 index 0000000..27f298f --- a/dev/null +++ b/pumpkin/main.m @@ -0,0 +1,6 @@ +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/pumpkin/pumpkin-Info.plist b/pumpkin/pumpkin-Info.plist new file mode 100644 index 0000000..a921bb4 --- a/dev/null +++ b/pumpkin/pumpkin-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + pumpkin + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + pumpkin + CFBundleIdentifier + net.klever.kin.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSApplicationCategoryType + public.app-category.utilities + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2012 Klever Group. All rights reserved. + NSMainNibFile + PumpKIN + NSPrincipalClass + NSApplication + + diff --git a/pumpkin/pumpkin-Prefix.pch b/pumpkin/pumpkin-Prefix.pch new file mode 100644 index 0000000..8976de1 --- a/dev/null +++ b/pumpkin/pumpkin-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'PumpKIN' target in the 'PumpKIN' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/pumpkin/pumpkin-defaults.plist b/pumpkin/pumpkin-defaults.plist new file mode 100644 index 0000000..511140f --- a/dev/null +++ b/pumpkin/pumpkin-defaults.plist @@ -0,0 +1,28 @@ + + + + + bindPort + 69 + bindAddress + 0.0.0.0 + remotePort + 69 + blockSize + 512 + xferType + octet + timeout + 10 + rrqBehavior + 1 + wrqBehavior + 2 + confirmationTimeout + 30 + giveUpTimeout + 120 + listen + + + diff --git a/pumpkin/put.icns b/pumpkin/put.icns new file mode 100644 index 0000000..5d62867 --- a/dev/null +++ b/pumpkin/put.icns Binary files differ diff --git a/res/down.ico b/res/down.ico deleted file mode 100644 index 433e718..0000000 --- a/res/down.ico +++ b/dev/null Binary files differ diff --git a/res/failed.wav b/res/failed.wav deleted file mode 100644 index 6d38550..0000000 --- a/res/failed.wav +++ b/dev/null Binary files differ diff --git a/res/finished.wav b/res/finished.wav deleted file mode 100644 index d8a0dc4..0000000 --- a/res/finished.wav +++ b/dev/null Binary files differ diff --git a/res/pumpkin.ico b/res/pumpkin.ico deleted file mode 100644 index a48bab9..0000000 --- a/res/pumpkin.ico +++ b/dev/null Binary files differ diff --git a/res/pumpkin.rc2 b/res/pumpkin.rc2 deleted file mode 100644 index 3471fab..0000000 --- a/res/pumpkin.rc2 +++ b/dev/null @@ -1,13 +0,0 @@ -// -// PUMPKIN.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// diff --git a/res/remove.ico b/res/remove.ico deleted file mode 100644 index 8e4473d..0000000 --- a/res/remove.ico +++ b/dev/null Binary files differ diff --git a/res/ring.wav b/res/ring.wav deleted file mode 100644 index 44b6ce2..0000000 --- a/res/ring.wav +++ b/dev/null Binary files differ diff --git a/res/rrq.ico b/res/rrq.ico deleted file mode 100644 index 4396eb3..0000000 --- a/res/rrq.ico +++ b/dev/null Binary files differ diff --git a/res/up.ico b/res/up.ico deleted file mode 100644 index 32f684b..0000000 --- a/res/up.ico +++ b/dev/null Binary files differ diff --git a/res/wrq.ico b/res/wrq.ico deleted file mode 100644 index 4e32659..0000000 --- a/res/wrq.ico +++ b/dev/null Binary files differ diff --git a/resource.h b/resource.h deleted file mode 100755 index 2c2fa02..0000000 --- a/resource.h +++ b/dev/null @@ -1,174 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by PumpKIN.rc -// -#define IDM_ABOUTBOX 0x0010 -#define IDD_ABOUTBOX 100 -#define IDS_ABOUTBOX 101 -#define IDC_TRAYICON 101 -#define IDD_PUMPKIN_DIALOG 102 -#define IDS_FMT_BYTES 102 -#define IDP_SOCKETS_INIT_FAILED 103 -#define IDS_TFTP_ERROR_ACCESS 104 -#define IDS_TFTP_ERROR_NOTFOUND 105 -#define IDS_TFTP_ERROR_DIRFULL 106 -#define IDD_PROPS_SERVER 106 -#define IDS_TFTP_ERROR_SHARING 107 -#define IDD_PROPS_NETWORK 107 -#define IDS_TFTP_ERROR_DISKFULL 108 -#define IDS_TFTP_ERROR_UNDEFINED 109 -#define IDS_LOG_START 110 -#define IDS_LOG_LISTENRECEIVEERROR 111 -#define IDS_LOG_LISTENACCEPTERROR 112 -#define IDS_LOG_RRQSERVE 113 -#define IDS_LOG_LISTENOPCODE 114 -#define IDS_LOG_XFERUDPSEND 115 -#define IDS_LOG_XFERRECEIVE 116 -#define IDS_LOG_XFERSEND 117 -#define IDS_LOG_XFERUDPRECEIVE 118 -#define IDS_LOG_XFERSOURCETID 119 -#define IDS_LOG_SENTTFTPERROR 120 -#define IDS_LOG_GOTTFTPERROR 121 -#define IDS_LOG_XFEROPCODE 122 -#define IDS_LOG_XFERRRQFINISHED 123 -#define IDS_TITLE_OPTIONS 124 -#define IDS_LOG_WRQSERVE 125 -#define IDS_TFTP_ERROR_FAILEDTORENAME 126 -#define IDS_RENAME_TITLE 127 -#define IDR_MAINFRAME 128 -#define IDS_LOG_TIMEDOUT 128 -#define IDS_CONFIRMEXIT_TITLE 129 -#define IDI_RRQ 129 -#define IDS_CONFIRMEXIT_TEXT 130 -#define IDI_WRQ 130 -#define IDD_CONFIRM_RRQ 131 -#define IDS_LOG_XFERWRQFINISHED 131 -#define IDD_CONFIRM_WRQ 132 -#define IDB_BACKGROUND 132 -#define IDS_LOG_XFERABORTED 132 -#define IDS_TITLE_PUTREQUEST 133 -#define IDS_TITLE_GETREQUEST 134 -#define IDR_WAVE_RING 135 -#define IDS_TALKHEADING 135 -#define IDS_WTALKHEADING 135 -#define IDR_WAVE_FINISHED 136 -#define IDS_TITLE_BROWSEFILE 136 -#define IDD_REQUEST 137 -#define IDS_LOG_RESOLVEFAILED 137 -#define IDS_LOG_FAILEDLOCALFILE 138 -#define IDD_PROPS_SOUNDS 138 -#define IDS_LOG_FAILEDTOOPEN 139 -#define IDM_POPUPS 140 -#define IDS_OTALXHEADING 140 -#define IDS_REGISTRYKEY 141 -#define IDS_KLEVERNET_URL 142 -#define IDR_WAVE_ABORTED 142 -#define IDS_LOGTIMEFORMAT 143 -#define IDS_DROPFILES_TITLE 144 -#define IDS_NOMULTIPLEDROP_TEXT 145 -#define IDI_BROWSE 145 -#define IDS_LOG_REQUESTING 146 -#define IDS_LOG_SENDING 147 -#define IDS_WTALKAT 148 -#define IDS_OTALXAT 149 -#define IDI_PLAY 149 -#define IDS_TFTP_ERROR_TSIZE 150 -#define IDD_PROPS_ACL 150 -#define IDS_TFTP_ERROR_BSIZE 151 -#define IDS_TFTP_ERROR_TOUT 152 -#define IDI_UP 152 -#define IDS_SELECT_TFTPROOT 153 -#define IDI_DOWN 153 -#define IDS_FILTER_WAV 154 -#define IDI_REMOVE 154 -#define IDS_TITLE_WAV 155 -#define IDS_BOX_CANTBIND 156 -#define IDS_NO_XFER_OP 157 -#define IDS_INVALID_IP 158 -#define IDS_INVALID_NETMASK 159 -#define IDS_INVALID_RULE 160 -#define IDS_LOG_LOGERROR 161 -#define IDS_TFTP_ERROR_TOOBIG 162 -#define IDS_LOG_DENYING 163 -#define IDC_KLEVERNET 1000 -#define IDC_CONNECTIONS 1001 -#define IDC_LOG 1003 -#define IDC_GET 1004 -#define IDC_PUT 1005 -#define IDC_ABORT 1006 -#define IDC_EXIT 1007 -#define IDC_TFTPROOT 1008 -#define IDC_TFTPSUBDIRS 1009 -#define IDC_RRQ_GIVEALL 1010 -#define IDC_RRQ_ALWAYSCONFIRM 1011 -#define IDC_RRQ_DENYALL 1012 -#define IDC_WRQ_TAKEALL 1013 -#define IDC_WRQ_PROMPTEXISTING 1014 -#define IDC_WRQ_ALWAYSCONFIRM 1015 -#define IDC_WRQ_DENYALL 1016 -#define IDC_PROMPTTIMEOUT 1017 -#define IDC_LISTENPORT 1018 -#define IDC_LISTENSPIN 1019 -#define IDC_SPEAKPORT 1020 -#define IDC_SPEAKSPIN 1021 -#define IDC_MAXUDPSIZE 1022 -#define IDC_MAXUDPSPIN 1023 -#define IDC_TIMEOUT 1024 -#define IDC_TIMESPIN 1025 -#define IDC_OPTIONS 1026 -#define IDC_BLOCKSIZE 1026 -#define IDC_BSIZESPIN 1027 -#define IDC_HOST 1028 -#define IDC_FILE 1029 -#define IDC_RENAME 1030 -#define IDC_REMOTEFILE 1030 -#define IDC_RESUME 1031 -#define IDC_REFRESH 1032 -#define IDC_BROWSE 1034 -#define IDC_TALKS 1035 -#define IDC_LOCALFILE 1036 -#define IDC_TYPE 1037 -#define IDC_BSIZE 1039 -#define IDC_RING 1041 -#define IDC_RING_BROWSE 1042 -#define IDC_RING_PLAY 1043 -#define IDC_ACL_LIST 1043 -#define IDC_FINISHED 1044 -#define IDC_ACL_UP 1044 -#define IDC_FINISHED_BROWSE 1045 -#define IDC_ACL_DOWN 1045 -#define IDC_FINISHED_PLAY 1046 -#define IDC_ACL_REMOVE 1046 -#define IDC_ABORTED 1047 -#define IDC_ACL_ADDR 1047 -#define IDC_ABORTED_BROWSE 1048 -#define IDC_ACL_RULE 1048 -#define IDC_ABORTED_PLAY 1049 -#define IDC_ACL_NETMASK 1049 -#define IDC_ACL_ADD 1050 -#define IDC_ACL_XFER 1051 -#define IDC_ACL_REPLACE 1052 -#define IDC_LISTENING 1052 -#define IDC_LOGFILE 1053 -#define IDC_LOGFILE_BROWSE 1054 -#define IDC_LISTENADDRESS 1055 -#define ID_TRAY_HELP 32771 -#define ID_TRAY_ABOUTPUMPKIN 32772 -#define ID_TRAY_EXIT 32773 -#define ID_TRAY_SENDFILE 32774 -#define ID_TRAY_FETCHFILE 32775 -#define ID_TRAY_OPTIONS 32776 -#define ID_TRAY_SHOWPUMPKINWINDOW 32777 -#define ID_TRAY_OPENFILESFOLDER 32778 -#define ID_TRAY_LISTEN 32780 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 156 -#define _APS_NEXT_COMMAND_VALUE 32781 -#define _APS_NEXT_CONTROL_VALUE 1056 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif diff --git a/shared-code/BTreendex.h b/shared-code/BTreendex.h deleted file mode 100644 index 88109ab..0000000 --- a/shared-code/BTreendex.h +++ b/dev/null @@ -1,595 +0,0 @@ -#ifndef __BTREENDEX_H -#define __BTREENDEX_H - -#include "Dynamide.h" - -namespace Klever { - -template -class CBTreendex : public CObject { -public: - typedef LONG CBTPageRef; - struct CBTRecordRef { - CBTPageRef m_Page; - INT m_Offset; - CBTRecordRef(CBTPageRef page=-1,INT offset=-1) : m_Page(page), m_Offset(offset) {} - }; - class CBTRecord : public CObject { - public: - CBTPageRef m_ptrLeft; - CBTPageRef m_ptrRight; - key m_Key; - value m_Value; - CBTRecord() : m_ptrLeft(-1), m_ptrRight(-1) {} - CBTRecord(key& _key,value& _value,CBTPageRef left=-1,CBTPageRef right=-1) : m_Key(_key), m_Value(_value), m_ptrLeft(left), m_ptrRight(right) {} - CBTRecord(CBTRecord& r) : m_Key(r.m_Key), m_Value(r.m_Value), m_ptrLeft(r.m_ptrLeft), m_ptrRight(r.m_ptrRight) {} - - CBTRecord& operator=(CBTRecord& r) {m_Key=r.m_Key, m_Value=r.m_Value, m_ptrLeft=r.m_ptrLeft, m_ptrRight=r.m_ptrRight;return *this;} - - void Serialize(CArchive& ar) { - if(ar.IsStoring()){ - ar << m_ptrLeft; - ar << m_ptrRight; - }else{ - ar >> m_ptrLeft; - ar >> m_ptrRight; - } - SerializeElements(ar,&m_Key,1); - SerializeElements(ar,&m_Value,1); - } - }; - class CBTPage : public CArray { - public: - void Serialize(CArchive& ar) { - int nCount = -1; - if(ar.IsStoring()){ - nCount = GetSize(); - ar << nCount; - }else{ - nCount = 0; - ar >> nCount; - RemoveAll(); - SetSize(nCount); - } - for(int tmp=0;tmp CBTDyna; - typedef CBTDyna::CDynaFile CBTDynaFile; - typedef CArray CBTRStack; - - CBTDyna m_BT; - struct _btCrap { - BOOL m_bRootSet; - CBTPageRef m_Root; - } *m_BTCrap; - BOOL m_bRO; - CBTRStack m_btStack; - CBTPage m_stackTop; - - CBTreendex() {} - ~CBTreendex() { Close(); } - BOOL Attach(CFile* file,BOOL bAutodelete) { - m_bRO = FALSE; - if(!m_BT.Attach(file,bAutodelete)) - return FALSE; - return Attach(); - } - BOOL Open(LPCTSTR file,BOOL bReadOnly) { - if(!m_BT.Open(file,bReadOnly)) - return FALSE; - m_bRO = bReadOnly; - return Attach(); - } - BOOL Create(LPCTSTR file) { - try{ - CFile* f = new CFile(file,CFile::modeCreate|CFile::modeReadWrite|CFile::shareDenyRead|CFile::shareDenyWrite|CFile::typeBinary); - ASSERT(f); - return Attach(f,TRUE); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - } - BOOL Attach() { - ASSERT(m_BT.IsOpened()); - m_BTCrap = (_btCrap*)m_BT.m_FB.crap; - if(!m_BTCrap->m_bRootSet){ - m_BTCrap->m_Root = AllocatePage(); - if(m_BTCrap->m_Root<0) - return FALSE; - m_BTCrap->m_bRootSet = TRUE; - m_BT.Write1stBlock(); - } - return TRUE; - } - BOOL Close() { - m_BT.Close(); - return TRUE; - } - BOOL IsOpened() { - return m_BT.IsOpened(); - } - - BOOL Lookup(key& _key,value& value) { - if(!IsOpened()) - return FALSE; - ASSERT(m_BTCrap->m_bRootSet); - if(!SeekToPage(_key)) - return FALSE; - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(rr.m_Offset<0) - return FALSE; - ASSERT(rr.m_Offsetm_bRootSet); - if(!SeekToPage(_key)) - return FALSE; - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - CBTRecord nuRecord(_key,_value); - if(rr.m_Offset<0){ - if(m_stackTop.GetSize()) - nuRecord.m_ptrLeft = m_stackTop[m_stackTop.GetUpperBound()].m_ptrRight; - }else if(rr.m_Offset==0){ - nuRecord.m_ptrRight = m_stackTop[0].m_ptrLeft; - }else{ - nuRecord.m_ptrLeft = m_stackTop[rr.m_Offset-1].m_ptrRight; - nuRecord.m_ptrRight = m_stackTop[rr.m_Offset].m_ptrLeft; - } -// ASSERT(rr.m_Offset==0 || (m_stackTop[rr.m_Offset-1].m_Key<_key && m_stackTop[rr.m_Offset-1].m_ptrRight<0)); -// ASSERT(rr.m_Offset<0 || m_stackTop[rr.m_Offset].m_Key>=_key && m_stackTop[rr.m_Offset].m_ptrLeft<0); - if(rr.m_Offset>=0 && m_stackTop[rr.m_Offset].m_Key==_key){ - // Exact match found - just replace. - m_stackTop[rr.m_Offset].m_Value = _value; - if(!SavePage(rr.m_Page,m_stackTop)) - return FALSE; - return TRUE; - } - // Split the page and propagate the split if needed.. - // Insert new element at rr.m_Offset.. - BOOL nuisnew = TRUE; - for(int sp=m_btStack.GetUpperBound();sp>=0;sp--){ - CBTPageRef opr = m_btStack[sp].m_Page; - int iAt = m_btStack[sp].m_Offset; - CBTPage op; - VERIFY(LoadPage(opr,op)); - if(iAt<0) - iAt = op.GetSize(); - else{ - if(op[iAt].m_Key nuRecord.m_Key); - } - op.InsertAt(iAt,nuRecord); - if(iAt>0) - op[iAt-1].m_ptrRight=nuRecord.m_ptrLeft; - if(iAt=0); - CBTPage np; - ASSERT(LoadPage(npr,np)); - ASSERT(!np.GetSize()); - nuRecord = op[treeOrder]; - if(iAt==treeOrder){ - // We're inserting central element! - drop out the stack top if this is still new one - for(int tmp=0;tmp=0); - CBTPage nurpa; - ASSERT(LoadPage(nuroot,nurpa)); - ASSERT(!nurpa.GetSize()); - nurpa.Add(nuRecord); - VERIFY(SavePage(nuroot,nurpa)); - m_btStack.InsertAt(0,CBTRecordRef(nuroot,0)); - m_BTCrap->m_Root = nuroot; - m_BT.Write1stBlock(); - return TRUE; - } - BOOL Delete(key& _key) { - if(!IsOpened()) - return FALSE; - ASSERT(m_BTCrap->m_bRootSet); - value _value; - if(!Lookup(_key,_value)) - return FALSE; - // Found key, check if it's a leaf - { - CBTRecordRef* rr = &m_btStack[m_btStack.GetUpperBound()]; - int rrIdx = m_btStack.GetUpperBound(); - if(m_stackTop[rr->m_Offset].m_ptrLeft>=0){ - ASSERT(m_stackTop[rr->m_Offset].m_ptrRight>=0); - // It isn't - scan for the _next_ key and do dirty deeds - m_btStack.Add(CBTRecordRef(m_stackTop[rr->m_Offset].m_ptrRight,0)); - for(;;){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - if(m_stackTop[0].m_ptrLeft<0) - break; - m_btStack.Add(CBTRecordRef(m_stackTop[0].m_ptrLeft,0)); - } - // We have a leaf node here, replace victim with the first element and kill it. - CBTPage uppage; - rr = &m_btStack[rrIdx]; - if(!LoadPage(rr->m_Page,uppage)) - return FALSE; - uppage[rr->m_Offset].m_Key=m_stackTop[0].m_Key; uppage[rr->m_Offset].m_Value=m_stackTop[0].m_Value; - m_stackTop.RemoveAt(0); - if(!(SavePage(rr->m_Page,uppage) && SavePage(m_btStack[m_btStack.GetUpperBound()].m_Page,m_stackTop))) - return FALSE; - }else{ - ASSERT(m_stackTop[rr->m_Offset].m_ptrRight<0); - m_stackTop.RemoveAt(rr->m_Offset); - if(!SavePage(rr->m_Page,m_stackTop)) - return FALSE; - } - } - // We have a page to check for underflow at the top of the stack now. - for(;;){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - if(m_stackTop.GetSize()>=treeOrder || m_btStack.GetSize()==1) - return TRUE; - CBTRecordRef& rr1 = m_btStack[m_btStack.GetUpperBound()-1]; - CBTPage daddy; - if(!LoadPage(rr1.m_Page,daddy)) - return FALSE; - CBTPageRef nPage = daddy[rr1.m_Offset].m_ptrRight; - BOOL bRight=TRUE; - if(nPage<0 || nPage==rr.m_Page){ - nPage = daddy[rr1.m_Offset].m_ptrLeft; - bRight = FALSE; - } - ASSERT(nPage>=0 && nPage!=rr.m_Page); - CBTPage neighbor; - if(!LoadPage(nPage,neighbor)) - return FALSE; - // Here we have possibly two cases: - // 1. Neighboring page can share some data with use, then do share and leave - // 2. Neighboring page is of treeorder in size, then merge and propagate - if(neighbor.GetSize()>treeOrder){ - TRACE0("Redistributing..\n"); - // Borrow some data from there. - int toBorrow = neighbor.GetSize()-treeOrder; - toBorrow=toBorrow/2+1; - ASSERT(toBorrow); - if(bRight) - m_stackTop.Add(CBTRecord(daddy[rr1.m_Offset].m_Key,daddy[rr1.m_Offset].m_Value,m_stackTop[m_stackTop.GetUpperBound()].m_ptrRight,neighbor[0].m_ptrLeft)); - else - m_stackTop.InsertAt(0,CBTRecord(daddy[rr1.m_Offset].m_Key,daddy[rr1.m_Offset].m_Value,neighbor[neighbor.GetUpperBound()].m_ptrRight,m_stackTop[0].m_ptrLeft)); - for(toBorrow--;toBorrow;toBorrow--){ - if(bRight){ - m_stackTop.Add(neighbor[0]); - neighbor.RemoveAt(0); - }else{ - m_stackTop.InsertAt(0,neighbor[neighbor.GetUpperBound()]); - neighbor.RemoveAt(neighbor.GetUpperBound()); - } - } - daddy[rr1.m_Offset].m_Key = neighbor[bRight?0:neighbor.GetUpperBound()].m_Key; daddy[rr1.m_Offset].m_Value = neighbor[bRight?0:neighbor.GetUpperBound()].m_Value; - neighbor.RemoveAt(bRight?0:neighbor.GetUpperBound()); - if(!(SavePage(rr1.m_Page,daddy) && SavePage(nPage,neighbor) && SavePage(rr.m_Page,m_stackTop))) - return FALSE; - rr.m_Offset = -1; // *** Point to the next?? - return TRUE; - } - TRACE0("Merging..\n"); - // We need to merge pages here.. - // We will merge them at stacktop, then we'll discard neighbor guy.. - if(bRight) - m_stackTop.Add(CBTRecord(daddy[rr1.m_Offset].m_Key,daddy[rr1.m_Offset].m_Value,m_stackTop[m_stackTop.GetUpperBound()].m_ptrRight,neighbor[0].m_ptrLeft)); - else - m_stackTop.InsertAt(0,CBTRecord(daddy[rr1.m_Offset].m_Key,daddy[rr1.m_Offset].m_Value,neighbor[neighbor.GetUpperBound()].m_ptrRight,m_stackTop[0].m_ptrLeft)); - if(bRight){ - while(neighbor.GetSize()){ - m_stackTop.Add(neighbor[0]); - neighbor.RemoveAt(0); - } - }else{ - while(neighbor.GetSize()){ - m_stackTop.InsertAt(0,neighbor[neighbor.GetUpperBound()]); - neighbor.RemoveAt(neighbor.GetUpperBound()); - } - } - if(rr1.m_Offset>0) - daddy[rr1.m_Offset-1].m_ptrRight=rr.m_Page; - if(rr1.m_Offsetm_bRootSet); - m_btStack.RemoveAll(); - m_btStack.Add(CBTRecordRef(m_BTCrap->m_Root,-1)); - for(;;){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - if(!m_stackTop.GetSize()){ - ASSERT(m_btStack.GetSize()==1); - return FALSE; - } - rr.m_Offset = 0; - if(m_stackTop[rr.m_Offset].m_ptrLeft<0) - return TRUE; - m_btStack.Add(CBTRecordRef(m_stackTop[rr.m_Offset].m_ptrLeft,-1)); - } - } - BOOL GoLast() { - if(!IsOpened()) - return FALSE; - ASSERT(m_BTCrap->m_bRootSet); - m_btStack.RemoveAll(); - m_btStack.Add(CBTRecordRef(m_BTCrap->m_Root,-1)); - for(;;){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - if(!m_stackTop.GetSize()){ - ASSERT(m_btStack.GetSize()==1); - return FALSE; - } - rr.m_Offset = m_stackTop.GetUpperBound(); - if(m_stackTop[rr.m_Offset].m_ptrRight<0) - return TRUE; - m_btStack.Add(CBTRecordRef(m_stackTop[rr.m_Offset++].m_ptrRight,-1)); - } - } - BOOL GoNext() { - if(!IsOpened()) - return FALSE; - if(!(m_btStack.GetSize() && m_btStack[m_btStack.GetUpperBound()].m_Offset>=0)) - return FALSE; - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - ASSERT(rr.m_Offset=0){ - // Advance pointer in this page and dive into subtree - // going left and left until we have nowhere to go. -// TRACE1("Dive into page %lu",m_stackTop[rr.m_Offset].m_ptrRight); - m_btStack.Add(CBTRecordRef(m_stackTop[rr.m_Offset++].m_ptrRight,0)); - for(;;){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - ASSERT(rr.m_Offset==0); - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - if(m_stackTop[rr.m_Offset].m_ptrLeft<0) - break; -// TRACE1(", %lu",m_stackTop[rr.m_Offset].m_ptrLeft); - m_btStack.Add(CBTRecordRef(m_stackTop[rr.m_Offset].m_ptrLeft,0)); - } -// TRACE0("\n"); - return TRUE; - }else if(rr.m_Offset=0)) - return FALSE; - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - ASSERT(rr.m_Offset=0){ - // Dive in and go right and right from the rightmost until - // we have nowhere to go. - m_btStack.Add(CBTRecordRef(m_stackTop[rr.m_Offset].m_ptrLeft,-1)); - for(;;){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - rr.m_Offset = m_stackTop.GetUpperBound(); - if(m_stackTop[rr.m_Offset].m_ptrRight<0) - return TRUE; - m_btStack.Add(CBTRecordRef(m_stackTop[rr.m_Offset++].m_ptrRight,-1)); - } - return TRUE; - }else if(rr.m_Offset>0){ - rr.m_Offset--; - return TRUE; - } - // We're at the leftmost element in page - go up and left until we're - // done or we have data. - m_btStack.RemoveAt(m_btStack.GetUpperBound()); - while(m_btStack.GetSize()){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - rr.m_Offset--; - if(rr.m_Offset>=0) - return TRUE; - m_btStack.RemoveAt(m_btStack.GetUpperBound()); - } - // No more data - we were at the first element in tree. - return FALSE; - } - BOOL GetThis(key& _key,value& _value) { - if(!IsOpened()) - return FALSE; - // *** MORE CHECKING - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - _key = m_stackTop[rr.m_Offset].m_Key; - _value = m_stackTop[rr.m_Offset].m_Value; - return TRUE; - } - - BOOL SeekToPage(const key& _key) { - ASSERT(IsOpened()); - ASSERT(m_BTCrap->m_bRootSet); - m_btStack.RemoveAll(); - m_btStack.Add(CBTRecordRef(m_BTCrap->m_Root,-1)); - for(;;){ - CBTRecordRef& rr = m_btStack[m_btStack.GetUpperBound()]; - if(!LoadPage(rr.m_Page,m_stackTop)) - return FALSE; - ASSERT(m_stackTop.GetSize() || !m_btStack.GetUpperBound()); - if(!m_stackTop.GetSize()){ - rr.m_Offset=-1; - return TRUE; - } - for(rr.m_Offset=0;rr.m_OffsetDelete(); - rv = FALSE; - } - delete pageFile; - return rv; - } - BOOL SavePage(CBTPageRef ref,CBTPage& page) { - CFile* pageFile = m_BT.OpenFile(ref); - if(!pageFile) - return FALSE; - BOOL rv = TRUE; - try{ - CArchive ar(pageFile,CArchive::store); - page.Serialize(ar); - ar.Close(); - }catch(CException* e){ - e->Delete(); - rv = FALSE; - } - delete pageFile; - return rv; - } - CBTPageRef AllocatePage() { - CBTDynaFile* pageFile = m_BT.CreateFile(); - if(!pageFile) - return -1; - CBTPage nothing; - CBTPageRef rv = pageFile->GetFile(); - try{ - CArchive ar(pageFile,CArchive::store); - nothing.Serialize(ar); - ar.Close(); - }catch(CException* e){ - e->Delete(); - rv = -1; - } - delete pageFile; - return rv; - } - BOOL DeallocatePage(CBTPageRef ref) { - return m_BT.DeleteFile(ref); - } - -}; - -}; - -#endif // __BTREENDEX_H diff --git a/shared-code/BellsNWhistles.h b/shared-code/BellsNWhistles.h deleted file mode 100644 index 1de77ae..0000000 --- a/shared-code/BellsNWhistles.h +++ b/dev/null @@ -1,146 +0,0 @@ -#ifndef __BELLSNWHISTLES_H -#define __BELLSNWHISTLES_H - -class CBellsNWhistles { -public: - class CBang { - public: - CString m_codeName; - enum _bangType { - bangNone, bangSpeaker, bangSystem, bangResource, - bangWaveform - } m_type; - BOOL m_bLoop; - union { - UINT system; - LPCTSTR resource; - LPCTSTR wave; - - LPCTSTR str; - UINT id; - }; - CString m_strWave; - CBang() : m_type(bangNone), m_bLoop(FALSE) {} - }; - typedef CTypedPtrMap CBangs; - struct CBelling { - LPCSTR snd; - HMODULE hm; - DWORD flags; - CBelling(LPCSTR snd,HMODULE hm,DWORD flags) : snd(snd), hm(hm), - flags(flags) {} - CBelling(CBelling& s) : snd(s.snd), hm(s.hm), flags(s.flags) {} - CBelling& operator=(CBelling& s) { - snd=s.snd; hm=s.hm; flags=s.flags; - return *this; - } - }; - typedef CBelling* Whistling; - - CBangs m_bangs; - - ~CBellsNWhistles() { - POSITION p = m_bangs.GetStartPosition(); - while(p){ - CString s; CBang* b; - m_bangs.GetNextAssoc(p,s,b); - delete b; - } - m_bangs.RemoveAll(); - } - - BOOL AssignSound(LPCTSTR codeName,LPCTSTR id,CBang::_bangType type=CBang::bangWaveform) { - CString cn = codeName; - cn.MakeLower(); - CBang* b; - if(!m_bangs.Lookup(cn,b)) { - b = new CBang; - b->m_codeName=cn; - m_bangs[cn]=b; - } - b->m_type=type; - b->str = id; - if(type==CBang::bangWaveform){ - b->m_strWave=id; b->str = b->m_strWave; - } - return TRUE; - } - BOOL AssignSound(LPCTSTR codeName,UINT nID,CBang::_bangType type=CBang::bangResource) { - CString cn = codeName; - cn.MakeLower(); - CBang* b; - if(!m_bangs.Lookup(cn,b)) { - b = new CBang; - b->m_codeName=cn; - m_bangs[cn]=b; - } - b->m_type=type; - b->id = nID; - ASSERT(type!=CBang::bangWaveform); - return TRUE; - } - BOOL UnassignSound(LPCTSTR codeName) { - CString cn = codeName; - cn.MakeLower(); - CBang* b; - if(m_bangs.Lookup(cn,b)) { - m_bangs.RemoveKey(cn); - delete b; - return TRUE; - } - return FALSE; - } - - Whistling StartSound(LPCTSTR codeName) { - Whistling* rv = NULL; - CString cn = codeName; - CBang* b; - if(!m_bangs.Lookup(cn,b)){ - ::PlaySound(cn,AfxGetInstanceHandle(),SND_ASYNC|SND_NODEFAULT|SND_NOWAIT|SND_FILENAME); - return NULL; - } - UINT flags = SND_ASYNC|SND_NODEFAULT|SND_NOWAIT; - LPCSTR snd = NULL; - switch(b->m_type){ - case CBang::bangNone: return NULL; - case CBang::bangSpeaker: MessageBeep(0xFFFFFFFF); return NULL; - case CBang::bangSystem: MessageBeep(b->system); return NULL; - case CBang::bangResource: - snd = b->resource; - flags|=SND_RESOURCE; break; - case CBang::bangWaveform: - snd = b->wave; - flags|=SND_FILENAME; break; -#ifdef _DEBUG - default: - ASSERT(FALSE); return NULL; -#endif - } - if(b->m_bLoop) - flags|=SND_LOOP; - HMODULE hm = AfxGetInstanceHandle(); - if(!::PlaySound(snd,hm,flags)) - return NULL; - return b->m_bLoop?new CBelling(snd,hm,flags):NULL; - } - BOOL StopSound(Whistling whistle) { - if(!whistle) - return FALSE; - ::PlaySound(whistle->snd,whistle->hm,whistle->flags|SND_PURGE); - delete whistle; - return TRUE; - } - UINT FillInCombo(CComboBox* combo) { - POSITION p = m_bangs.GetStartPosition(); - UINT rv = 0; - while(p) { - CString s; - CBang* b; - m_bangs.GetNextAssoc(p,s,b); - combo->AddString(s); - } - return rv; - } -}; - -#endif // _BELLSNWHISTLES_H \ No newline at end of file diff --git a/shared-code/BitSet.h b/shared-code/BitSet.h deleted file mode 100644 index cf36e3b..0000000 --- a/shared-code/BitSet.h +++ b/dev/null @@ -1,105 +0,0 @@ -#ifndef __BITSET_H -#define __BITSET_H - -namespace Klever { - -class CBitSet : public CObject { -public: - CWordArray m_Bits; - ULONG m_BitsInSet; - enum { - bitsPerWord = sizeof(WORD)*8 - }; - - CBitSet(ULONG size = 0) : m_BitsInSet(0) { SetSize(size); } - CBitSet(CBitSet& o) : m_BitsInSet(0) { CopyFrom(o); } - - void SetSize(ULONG size,BOOL bFillOnes=FALSE) { - UINT os = m_Bits.GetSize(); - UINT ns = (size+bitsPerWord-1)/bitsPerWord; - if(os==ns){ - if(os){ - if(bFillOnes) - m_Bits[m_BitsInSet/bitsPerWord]|=(~(WORD)0)<<(m_BitsInSet%bitsPerWord); - else - m_Bits[m_BitsInSet/bitsPerWord]&=~((~(WORD)0)<<(m_BitsInSet%bitsPerWord)); - } - m_BitsInSet=size; - }else{ - // *?* ASSERT((!os) || (((os-1)*bitsPerWord)<=m_BitsInSet && m_BitsInSet<(os*bitsPerWord))); - if(os=0;i--) - m_Bits[i]=~m_Bits[i]; - } - CBitSet& operator&=(CBitSet& o) { - if(o.m_BitsInSet=0;i--) - m_Bits[i]&=o.m_Bits[i]; - return *this; - } - CBitSet& operator|=(CBitSet& o) { - if(o.m_BitsInSet>m_BitsInSet) - SetSize(o.m_BitsInSet); - for(int i=o.m_Bits.GetUpperBound();i>=0;i--) - m_Bits[i]|=o.m_Bits[i]; - return *this; - } - CBitSet& operator=(CBitSet& o) { - CopyFrom(o); - return *this; - } - void CopyFrom(CBitSet& o) { - m_BitsInSet=o.m_BitsInSet; - m_Bits.Copy(o.m_Bits); - } - void Serialize(CArchive& ar) { - if(ar.IsStoring()){ - ar << m_BitsInSet; - m_Bits.Serialize(ar); - }else{ - ar >> m_BitsInSet; - m_Bits.Serialize(ar); - } - } -}; - -}; - -#endif // __BITSET_H diff --git a/shared-code/Dynamide.h b/shared-code/Dynamide.h deleted file mode 100644 index 32c93f7..0000000 --- a/shared-code/Dynamide.h +++ b/dev/null @@ -1,443 +0,0 @@ -#ifndef __DYNAMIDE_H -#define __DYNAMIDE_H - -#include "LRUCache.h" - -namespace Klever { - -template -class CDynamide : public CObject { - struct firstBlock { - LONG freeFile; - BYTE crap[fbSize-sizeof(LONG)]; - }; - struct theBlock { - LONG next; - BYTE data[bSize-sizeof(LONG)]; - }; -public: - static firstBlock FirstBlock; - static theBlock TheBlock; -private: - class CDynaCache : public CLRUCache { - public: - CFile* m_File; - BOOL m_bAutodelete; - CDynaCache(CFile* file,BOOL bAutodelete=TRUE) : CLRUCache(64) { - m_File=file; - m_bAutodelete=bAutodelete; - } - virtual ~CDynaCache() { - Flush(); - if(m_bAutodelete){ - m_File->Close(); - delete m_File; - } - } - virtual BOOL _ReadIn(DWORD idx,theBlock* data) { - LONG p = sizeof(firstBlock)+idx*sizeof(theBlock); - LONG s = m_File->Seek(p,CFile::begin); - if(p==s){ - UINT rb = m_File->Read(data,sizeof(*data)); - if(rb==sizeof(*data)) - return TRUE; - if(rb) - return FALSE; - memset(data,0,sizeof(*data)); - data->next=-1; - try{ - m_File->Write(data,sizeof(*data)); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - }else{ - LONG togo = p-s; - ASSERT(togo>0); - ASSERT(!(togo%sizeof(theBlock))); - memset(data,0,sizeof(*data)); - data->next=-1; - while(togo>=0){ - try{ - m_File->Write(data,sizeof(*data)); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - } - } - return TRUE; - } - virtual BOOL _WriteOut(DWORD idx,theBlock* data) { - LONG p = sizeof(firstBlock)+idx*sizeof(theBlock); - LONG s = m_File->Seek(p,CFile::begin); - if(p!=s) - return FALSE; - try{ - m_File->Write(data,sizeof(*data)); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - return TRUE; - } - DWORD AllocateNode() { - LONG l = m_File->GetLength(); - ASSERT(!((l-sizeof(firstBlock))%sizeof(theBlock))); - m_File->SetLength(l+sizeof(theBlock)); - return (l-sizeof(firstBlock))/sizeof(theBlock); - } - BOOL Read1stBlock(firstBlock* fb) { - m_File->SeekToBegin(); - UINT rb = m_File->Read(fb,sizeof(*fb)); - if(rb==sizeof(*fb)) - return TRUE; - if(rb) - return FALSE; - memset(fb,0,sizeof(*fb)); - fb->freeFile = -1; - try{ - m_File->Write(fb,sizeof(*fb)); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - return TRUE; - } - BOOL Write1stBlock(firstBlock* fb) { - m_File->SeekToBegin(); - try{ - m_File->Write(fb,sizeof(*fb)); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - return TRUE; - } - }; -public: - class CDynaFile : public CFile { - public: - CDynamide* m_Daddy; - CArray m_Blocks; - LONG m_Position; - - CDynaFile(CDynamide* daddy) : m_Daddy(NULL) { AttachToDaddy(daddy); } - virtual ~CDynaFile() { Close(); DetachFromDaddy(); } - - void AttachToDaddy(CDynamide* daddy) { - ASSERT(!m_Daddy); - ASSERT(daddy); - m_Daddy=daddy; - m_Daddy->AttachDynaFile(this); - } - void DetachFromDaddy() { - ASSERT(m_Daddy); - ASSERT(!IsOpened()); - m_Daddy->DetachDynaFile(this); - m_Daddy=NULL; - } - - BOOL Create() { - if(IsOpened()) - return FALSE; - m_Blocks.SetAtGrow(0,m_Daddy->Allocate()); - ASSERT(m_Blocks[0]>=0); - m_Position=0; - return TRUE; - } - BOOL Open(LONG fb) { - if(IsOpened()) - return FALSE; - ASSERT(fb>=0); - theBlock* b; - do{ - m_Blocks.Add(fb); - b = m_Daddy->m_File->GetCached(fb); - ASSERT(b); - fb=b->next; - if(m_Blocks[m_Blocks.GetUpperBound()]==fb) - return FALSE; - }while(fb>=0); - m_Position=0; - return TRUE; - } - - LONG GetFile() { - if(!IsOpened()) - return -1; - return m_Blocks[0]; - } - virtual DWORD GetPosition() const { - if(!IsOpened()) - return 0; - if(m_Position<0) - return 0; - if(m_Position>GetLength()) - return GetLength(); - return m_Position; - } - virtual CString GetFileName() { - CString rv; - if(IsOpened()) - rv.Format("0x%08lX",m_Blocks[0]); - else - rv.Format("None"); - return rv; - } - virtual CString GetFileTitle() { return GetFileName(); } - virtual CString GetFilePath() { return GetFileName(); } - virtual void SetFilePath(LPCTSTR lpszNewName) { ASSERT(FALSE); } - - virtual BOOL Open(LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError = NULL) { ASSERT(FALSE); return FALSE; } - virtual CFile* Duplicate() { ASSERT(FALSE); return NULL; } - - virtual LONG Seek(LONG lOff, UINT nFrom) { - if(!IsOpened()) - return -1; - switch(nFrom){ - case CFile::begin: - m_Position=lOff; - break; - case CFile::current: - m_Position+=lOff; - break; - case CFile::end: - m_Position=GetLength()+lOff; - break; - default: - ASSERT(FALSE); - return -1; - } - if(m_Position<0) - m_Position=0; - if(m_Position>GetLength()) - m_Position=GetLength(); - return m_Position; - } - virtual void SetLength(DWORD dwNewLen) { - if(!IsOpened()) - return; - if(dwNewLen1){ - LONG mb = m_Blocks[m_Blocks.GetUpperBound()]; - LONG mb1 = m_Blocks[m_Blocks.GetUpperBound()-1]; - theBlock* b = m_Daddy->m_File->GetCached(mb1); - ASSERT(b); - ASSERT(b->next==mb); - b->next=-1; - m_Daddy->m_File->MakeDirty(mb1); - m_Daddy->Deallocate(mb); - m_Blocks.SetSize(m_Blocks.GetSize()-1); - } - }else{ - while(dwNewLen>GetLength()){ - LONG mb = m_Blocks[m_Blocks.GetUpperBound()]; - LONG newBlock = m_Daddy->Allocate(); - ASSERT(newBlock>=0); - theBlock* b = m_Daddy->m_File->GetCached(mb); - ASSERT(b); - ASSERT(b->next<0); - b->next=newBlock; - m_Daddy->m_File->MakeDirty(mb); - m_Blocks.Add(newBlock); - } - } - } - virtual DWORD GetLength() const { - return ((long)m_Blocks.GetSize())*((long)sizeof(TheBlock.data)); - } - - virtual UINT Read(void* lpBuf, UINT nCount) { - UINT rv = 0; - ASSERT(m_Position>=0 && m_Position<=GetLength()); - LPBYTE data = (LPBYTE)lpBuf; - while(nCount && m_Positionm_File->GetCached(m_Blocks[bn]); - ASSERT(b); - UINT bc = min(nCount,sizeof(TheBlock.data)-bo); - memmove(data,&b->data[bo],bc); - nCount-=bc; - data=&data[bc]; - rv+=bc; - m_Position+=bc; - } - return rv; - } - virtual void Write(const void* lpBuf, UINT nCount) { - ASSERT(m_Position>=0 && m_Position<=GetLength()); - LPBYTE data = (LPBYTE)lpBuf; - while(nCount){ - UINT bn = m_Position/sizeof(TheBlock.data); - UINT bo = m_Position%sizeof(TheBlock.data); - while(bn>=m_Blocks.GetSize()){ - LONG mb = m_Blocks[m_Blocks.GetUpperBound()]; - LONG newBlock = m_Daddy->Allocate(); - ASSERT(newBlock>=0); - theBlock* b = m_Daddy->m_File->GetCached(mb); - ASSERT(b); - ASSERT(b->next<0); - b->next=newBlock; - m_Daddy->m_File->MakeDirty(mb); - m_Blocks.Add(newBlock); - } - theBlock* b = m_Daddy->m_File->GetCached(m_Blocks[bn]); - ASSERT(b); - UINT bc = min(nCount,sizeof(TheBlock.data)-bo); - memmove(&b->data[bo],data,bc); - m_Daddy->m_File->MakeDirty(m_Blocks[bn]); - nCount-=bc; - data=&data[bc]; - m_Position+=bc; - } - } - - virtual void LockRange(DWORD dwPos, DWORD dwCount) { ASSERT(FALSE); } - virtual void UnlockRange(DWORD dwPos, DWORD dwCount) { ASSERT(FALSE); } - - virtual void Abort() { ASSERT(FALSE); } - virtual void Flush() { - m_Daddy->m_File->Flush(); - } - virtual void Close() { - m_Blocks.RemoveAll(); - } - - BOOL IsOpened() const { return m_Blocks.GetSize()!=0; } - }; - - CDynaCache* m_File; - firstBlock m_FB; - - CDynamide() : m_File(NULL) {} - ~CDynamide() { Close(); } - - BOOL AttachDynaFile(CDynaFile* f) { - // ASSERT(!m_Files.Find(f)); - // m_Files.AddHead(f); - return TRUE; - } - BOOL DetachDynaFile(CDynaFile* f) { - //POSITION p = m_Files.Find(f); - // ASSERT(p); - // m_Files.RemoveAt(p); - return TRUE; - } - - BOOL Open(LPCTSTR file,BOOL bRO=FALSE) { - Close(); - try{ - CFile* f = new CFile(file,CFile::typeBinary|(bRO?CFile::modeRead|CFile::shareDenyWrite:CFile::modeReadWrite|CFile::shareDenyRead)); - return Attach(f,TRUE); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - } - BOOL Create(LPCTSTR file) { - Close(); - try{ - CFile* f = new CFile(file,CFile::typeBinary|CFile::modeCreate|CFile::modeReadWrite|CFile::shareDenyRead); - return Attach(f,TRUE); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - } - BOOL Attach(CFile* file,BOOL bAutodelete=TRUE) { - if(IsOpened()) - return FALSE; - m_File = new CDynaCache(file,bAutodelete); - if(!m_File->Read1stBlock(&m_FB)){ - memset(&m_FB,0,sizeof(m_FB)); - m_FB.freeFile=-1; - VERIFY(m_File->Write1stBlock(&m_FB)); - } - return IsOpened(); - } - // CFile* Detach(); - BOOL Close() { - if(!IsOpened()) - return FALSE; - m_File->Write1stBlock(&m_FB); - delete m_File; - m_File=NULL; - return TRUE; - } - BOOL IsOpened() { - return m_File != NULL; - } - BOOL Write1stBlock(void) { - if(!IsOpened()) - return FALSE; - VERIFY(m_File->Write1stBlock(&m_FB)); - return TRUE; - } - - CDynaFile* CreateFile() { - CDynaFile* rv = new CDynaFile(this); - if(rv->Create()) - return rv; - delete rv; - return NULL; - } - CDynaFile* OpenFile(LONG fb) { - CDynaFile* rv = new CDynaFile(this); - if(rv->Open(fb)) - return rv; - delete rv; - return NULL; - } - BOOL DeleteFile(LONG fb) { - while(fb>=0){ - theBlock* b = m_File->GetCached(fb); - LONG nb = b->next; - Deallocate(fb); - fb=nb; - } - return TRUE; - } - - LONG Allocate() { - if(!IsOpened()) - return -1; - if(m_FB.freeFile<0){ - LONG rv = m_File->AllocateNode(); - theBlock *b = m_File->GetCached(rv); - b->next=-1; - m_File->MakeDirty(rv); - return rv; - } - LONG rv = m_FB.freeFile; - theBlock *b = m_File->GetCached(rv); - m_FB.freeFile=b->next; - b->next=-1; - m_File->MakeDirty(rv); - m_File->Write1stBlock(&m_FB); - return rv; - } - BOOL Deallocate(LONG bk) { - if(!IsOpened()) - return FALSE; - theBlock* b = m_File->GetCached(bk); - ASSERT(b); - if(m_FB.freeFile<0){ - b->next=-1; - m_FB.freeFile=bk; - }else{ - b->next=m_FB.freeFile; - m_FB.freeFile=bk; - } - m_File->MakeDirty(bk); - m_File->Write1stBlock(&m_FB); - return TRUE; - } -}; - -}; - -#endif // __DYNAMIDE_H diff --git a/shared-code/FindIFace.h b/shared-code/FindIFace.h deleted file mode 100644 index 8dec8c4..0000000 --- a/shared-code/FindIFace.h +++ b/dev/null @@ -1,125 +0,0 @@ -#ifndef __FINDIFACE_H -#define __FINDIFACE_H - -#include "SNMPeer.h" -#include "SNMPExtDLL.h" -#include "SNMPOIDs.h" - -namespace Klever { - -inline BOOL FindIFace(in_addr& target,in_addr& source) -{ -DEFINE_OID(ipRouteDest, OIDipRouteDest); -DEFINE_OID(ipRouteMask, OIDipRouteMask); -DEFINE_OID(ipRouteIfIndex, OIDipRouteIfIndex); -DEFINE_OID(ipRouteMetric1, OIDipRouteMetric1); -DEFINE_OID(ipAdEntIfIndex, OIDipAdEntIfIndex); -DEFINE_OID(ipAdEntAddr, OIDipAdEntAddr); -struct _route { - int iface; - int metric; - DWORD nm; -} routes[16]; -int nRoutes = 0; -CSNMPVarBindList vbl; - vbl.AddTail(CSNMPVarBind(CASNAny(CASNAny::typeASNOID,ipRouteDest,sizeof(ipRouteDest)))); - vbl.AddTail(CSNMPVarBind(CASNAny(CASNAny::typeASNOID,ipRouteMask,sizeof(ipRouteMask)))); - vbl.AddTail(CSNMPVarBind(CASNAny(CASNAny::typeASNOID,ipRouteIfIndex,sizeof(ipRouteIfIndex)))); - vbl.AddTail(CSNMPVarBind(CASNAny(CASNAny::typeASNOID,ipRouteMetric1,sizeof(ipRouteMetric1)))); -CSNMPExtDLL snmp("INETMIB1"); - while(nRoutes<(sizeof(routes)/sizeof(routes[0]))){ - if( - snmp.Request(CASNAny::typeASNGetNextRequest,vbl,vbl) - && vbl.GetCount() == 4 - ){ - POSITION p = vbl.GetHeadPosition(); - _route r = {-1,-1}; - in_addr d, m; - BOOL bD = FALSE, bM = FALSE; - while(p){ - CSNMPVarBind& vb = vbl.GetNext(p); - if( - vb.IsName(ipRouteDest,sizeof(ipRouteDest)) - && vb.value.type==CASNAny::typeASNIP - ){ - d.s_addr=vb.value.value.ip.s_addr; bD = TRUE; - }else if( - vb.IsName(ipRouteMask,sizeof(ipRouteMask)) - && vb.value.type==CASNAny::typeASNIP - ){ - m.s_addr=vb.value.value.ip.s_addr; bM = TRUE; - }else if( - vb.IsName(ipRouteIfIndex,sizeof(ipRouteIfIndex)) - && vb.value.type==CASNAny::typeASNInteger - ){ - r.iface=vb.value.value.number; - }else if( - vb.IsName(ipRouteMetric1,sizeof(ipRouteMetric1)) - && vb.value.type==CASNAny::typeASNInteger - ){ - r.metric=vb.value.value.number; - }else - break; - } - if(r.iface<0 || r.metric<0 || (!bD) || (!bM)) - break; - if((target.s_addr&m.s_addr)==(d.s_addr&m.s_addr)){ - r.nm=htonl(m.s_addr); - memmove(&routes[nRoutes++],&r,sizeof(routes[0])); - } - }else - break; - } - if(!nRoutes) - return FALSE; -int rn = 0; - if(nRoutes>1){ - for(int tmp=1;tmproutes[rn].nm - ) - rn = tmp; - } -int iface = routes[rn].iface; - vbl.RemoveAll(); - vbl.AddTail(CSNMPVarBind(CASNAny(CASNAny::typeASNOID,ipAdEntAddr,sizeof(ipAdEntAddr)))); - vbl.AddTail(CSNMPVarBind(CASNAny(CASNAny::typeASNOID,ipAdEntIfIndex,sizeof(ipAdEntIfIndex)))); - for(;;){ - if( - snmp.Request(CASNAny::typeASNGetNextRequest,vbl,vbl) - && vbl.GetCount()==2 - ){ - in_addr a; a.s_addr = INADDR_NONE; - int ifn = -1; - POSITION p = vbl.GetHeadPosition(); - while(p){ - CSNMPVarBind& vb = vbl.GetNext(p); - if( - vb.IsName(ipAdEntAddr,sizeof(ipAdEntAddr)) - && vb.value.type==CASNAny::typeASNIP - ){ - a.s_addr=vb.value.value.ip.s_addr; - }else if( - vb.IsName(ipAdEntIfIndex,sizeof(ipAdEntIfIndex)) - && vb.value.type==CASNAny::typeASNInteger - ){ - ifn = vb.value.value.number; - }else - break; - } - if(ifn<0) - break; - if(ifn==iface){ - source.s_addr=a.s_addr; - return TRUE; - } - }else - break; - } - return FALSE; -} - -}; - -#endif // __FINDIFACE_H diff --git a/shared-code/LRUCache.h b/shared-code/LRUCache.h deleted file mode 100644 index 569e829..0000000 --- a/shared-code/LRUCache.h +++ b/dev/null @@ -1,113 +0,0 @@ -#ifndef __LRUCACHE_H -#define __LRUCACHE_H - -namespace Klever { - -template -class CLRUCache : public CObject { -public: - struct CacheEntry { - enum cacheState { - cacheClean, cacheDirty, cacheEmpty - }; - cacheState m_State; - UINT m_hits; - - IDX m_idx; - DATA* m_pData; - - CacheEntry() { m_State=cacheEmpty; VERIFY(m_pData=new DATA); m_hits=0; } - virtual ~CacheEntry() { delete m_pData; } - }; - typedef CMap CCacheMap; - typedef CList CCacheList; - - CCacheList m_Cache; - CCacheMap m_Map; - - CLRUCache(UINT cacheSize) { - for(int tmp=0;tmpm_hits++; - PopUp(rv); - return rv->m_pData; - } - if(!bLoad) - return NULL; - rv = m_Cache.GetTail(); - ASSERT(rv); - switch(rv->m_State){ - case CacheEntry::cacheDirty: - FlushEntry(rv); - case CacheEntry::cacheClean: - m_Map.RemoveKey(rv->m_idx); - rv->m_State=CacheEntry::cacheEmpty; - case CacheEntry::cacheEmpty: - break; - default: - ASSERT(FALSE); - } - if(!_ReadIn(idx,rv->m_pData)) - return NULL; - rv->m_hits=1; - rv->m_State=CacheEntry::cacheClean; - rv->m_idx=idx; - m_Map[idx]=rv; - PopUp(rv); - return rv->m_pData; - } - BOOL MakeDirty(ARGIDX idx) { - CacheEntry* pEntry; - if(m_Map.Lookup(idx,pEntry)){ - ASSERT(pEntry->m_State==CacheEntry::cacheClean || pEntry->m_State==CacheEntry::cacheDirty); - pEntry->m_State=CacheEntry::cacheDirty; - return TRUE; - } - return FALSE; - } - BOOL Flush() { - POSITION p = m_Cache.GetHeadPosition(); - while(p){ - CacheEntry* pEntry = m_Cache.GetNext(p); - ASSERT(pEntry); - FlushEntry(pEntry); - } - return TRUE; - } - BOOL FlushEntry(CacheEntry* pEntry) { - if(pEntry->m_State==CacheEntry::cacheDirty){ - BOOL rv = _WriteOut(pEntry->m_idx,pEntry->m_pData); - if(rv) - pEntry->m_State=CacheEntry::cacheClean; - } - return FALSE; - } - void PopUp(CacheEntry* pEntry) { - POSITION p = m_Cache.Find(pEntry); - ASSERT(p); - m_Cache.RemoveAt(p); - VERIFY(m_Cache.AddHead(pEntry)); - } - - virtual BOOL _ReadIn(ARGIDX idx,DATA* data) = 0; - virtual BOOL _WriteOut(ARGIDX idx,DATA* data) = 0; -}; - -}; - -#endif // __LRUCACHE_H diff --git a/shared-code/RegEx.cpp b/shared-code/RegEx.cpp deleted file mode 100644 index b7bab62..0000000 --- a/shared-code/RegEx.cpp +++ b/dev/null @@ -1,1697 +0,0 @@ -#include "../stdafx.h" -#include "RegEx.h" - -#define isWordableChar(c) (isalnum(c) || (c)=='_') - -BOOL CRegEx::Compile(LPCTSTR regex,int flags) -{ - ASSERT(!((flags®Extended) && (flags®Literal))); - m_Matches.RemoveAll(); - m_Strip.RemoveAll(); - m_Strip.SetSize(0,15); - m_Pattern=regex; - m_ParsePointer=0; - m_Error=0; - m_Sets.RemoveAll(); - m_Flags=flags; - m_iFlags=0; - m_BOLs=m_EOLs=0; - m_Subexps = 0; - m_Categories=1; // 0 is 'everything else' - m_bBackRefs=FALSE; - memset(m_Category,0,sizeof(m_Category)); - - // Go ahead. - m_Error || m_Strip.Add(CSop(CSop::opEnd)); - if(flags®Extended){ - ParseERE(); - }else if(flags®Literal){ - ParseLiteral(); - }else{ - ParseBRE(); - } - m_Error || m_Strip.Add(CSop(CSop::opEnd)); - Categorize(); - m_Strip.FreeExtra(); - FigureMust(); - m_Pluses=CountPluses(); - if(m_iFlags&iflagsBad){ - m_Error || (m_Error=regeAssert); - // ??? point to nuls? ;-) - } - // We may wish to free some memory here if we're erroneous (ie. m_Error..) - m_ParseParens.RemoveAll(); -#ifdef _DEBUG - if(m_Error){ - CString tmp; - tmp.Format("RE: ParseError: %d\n",m_Error); - TRACE0(tmp); - } -// DumpStrip(afxDump); -#endif - return (m_bCompiled=(!m_Error)); -} - -BOOL CRegEx::Match(LPCTSTR src,int flags) -{ - if(!m_bCompiled) - return FALSE; - if(m_iFlags&iflagsBad) - return FALSE; - m_Input=src; - m_mFlags=flags; - m_mPointer=m_Input; - m_mBegin=m_Input; - m_mEnd=&m_mBegin[m_Input.GetLength()]; - ASSERT(m_mPointer<=m_mEnd); - m_Matches.RemoveAll(); - if(!m_Must.IsEmpty()){ - if(m_Input.Find(m_Must)<0) - return FALSE; - } - // Go ahead.. -int stripLen = m_Strip.GetSize(); - m_mLastPos.SetSize(0); - for(int tmp=0;tmp0 && !m_mLastPos.GetSize()) - m_mLastPos.SetSize(m_Pluses); - dp = MatchBackRef(m_cOldP,endp,1,stripLen-1,0); - } - if(dp) - break; - // Uh.. oh.. we couldn't find a subexpression-level match - ASSERT(m_bBackRefs); - ASSERT(m_Pluses==0 || m_mLastPos.GetSize()); - for(;;){ - if(dp || endp <= m_cOldP) - break; // defeat.. ? - endp = MatchSlow(m_cOldP,endp-1,1,stripLen-1); - if(!endp) - break; // defeat.. ? - // Try it on a shorter possibility.. -#ifdef _DEBUG - for(tmp=1;tmp<=m_Subexps;tmp++) - ASSERT(m_Matches[tmp].m_Begin<0 && m_Matches[tmp].m_End<0); -#endif - dp = MatchBackRef(m_cOldP,endp,1,stripLen-1,0); - } - ASSERT((!dp) || dp==endp); - if(dp) // Found a shorter one.. - break; - // Despite initial appearances, there is no match here - beginp = m_cOldP+1; - ASSERT(beginp<=m_mEnd); - } - // Fill in the detail if so requested.. - if(!(m_mFlags®NoSubExpressions)){ - if(!m_Matches.GetSize()) - m_Matches.SetSize(1); - m_Matches[0].m_Begin=m_cOldP-m_mBegin; - m_Matches[0].m_End=endp-m_mBegin; - } - m_mLastPos.RemoveAll(); - return TRUE; -} - -CString CRegEx::Replace(LPCTSTR src,LPCTSTR rep,int flags) -{ - // *** - return CString(); -} - -void CRegEx::ParseERE(int stop) -{ -UCHAR c; -BOOL first=TRUE; -int prevF, prevB; - for(;;){ - int co = m_Strip.GetSize(); - while(m_ParsePointer < m_Pattern.GetLength() && ((c=m_Pattern[m_ParsePointer])!='|') && c!=stop) - ParseEREexp(); - if(m_Strip.GetSize()==co){ - m_Error || (m_Error=regeEmpty); - // ??? point to nuls? - } - if(m_ParsePointer>=m_Pattern.GetLength() || m_Pattern[m_ParsePointer]!='|') - break; - else - m_ParsePointer++; - if(first){ - StripInsert(co,CSop(CSop::opChoice0,m_Strip.GetSize()-co+1)); - prevF = prevB = co; - first=FALSE; - } - m_Error || m_Strip.Add(CSop(CSop::opOr0,m_Strip.GetSize()-prevB)); - prevB = m_Strip.GetSize()-1; - m_Error || (m_Strip[prevF].m_Operand=m_Strip.GetSize()-prevF); - prevF = m_Strip.GetSize(); - m_Error || m_Strip.Add(CSop(CSop::opOr1,0)); // offset isn't really right.. very so.. - } - if(!first){ - m_Error || (m_Strip[prevF].m_Operand=m_Strip.GetSize()-prevF); - m_Error || m_Strip.Add(CSop(CSop::opChoice1,m_Strip.GetSize()-prevB)); - } - ASSERT(m_ParsePointer >= m_Pattern.GetLength() || m_Pattern[m_ParsePointer]==stop); -} - -void CRegEx::ParseEREexp() -{ - ASSERT(m_ParsePointer < m_Pattern.GetLength()); -UCHAR c = m_Pattern[m_ParsePointer++]; -int pos = m_Strip.GetSize(); -int subno; -int count, count2; -BOOL wascaret=FALSE; - switch(c){ - case '(': - if(!(m_ParsePointer=m_Pattern.GetLength() || m_Pattern[m_ParsePointer]!=')') - ParseERE(')'); - VERIFY(m_ParseParens[m_Subexps].m_End = m_Strip.GetSize()); - m_Error || m_Strip.Add(CSop(CSop::opRightParen,subno)); - if(m_ParsePointer >= m_Pattern.GetLength() || m_Pattern[m_ParsePointer++]!=')'){ - TRACE0("RE: No matching ')'\n"); - if(!m_Error) - m_Error = regeParen; - // ??? point to nuls? - } - break; - case '^': - m_Error || m_Strip.Add(CSop(CSop::opBOL)); - m_iFlags|=iflagsUseBOL; - m_BOLs++; - wascaret=TRUE; - break; - case '$': - m_Error || m_Strip.Add(CSop(CSop::opEOL)); - m_iFlags|=iflagsUseEOL; - m_EOLs++; - break; - case '|': - TRACE0("RE: '|' outside of expression\n"); - if(!m_Error) - m_Error = regeEmpty; - // ??? point to nuls? - break; - case '*': - case '+': - case '?': - TRACE0("RE: '*'/'+'/'?' with no previous expression\n"); - if(!m_Error) - m_Error = regeBadRepeat; - // ??? point to nuls? - break; - case '.': - if(m_Flags®NewLine) - EmitNonNewLineAny(); - else - m_Error || m_Strip.Add(CSop(CSop::opAny)); - break; - case '[': - ParseBracket(); - break; - case '\\': - if(m_ParsePointer >= m_Pattern.GetLength()){ - TRACE0("RE: '\\' at the end of the pattern\n"); - if(!m_Error) - m_Error = regeEscape; - // ??? point to nuls? - }else{ - c = m_Pattern[m_ParsePointer++]; - EmitOrdinary(c); - } - break; - case '{': - if(m_ParsePointer >= m_Pattern.GetLength() || !isdigit(m_Pattern[m_ParsePointer])){ - TRACE0("RE: '{' with no repeat count\n"); - if(!m_Error) - m_Error = regeBadRepeat; - // ??? point to nuls? - } - // Fallthrough.. - default: - EmitOrdinary(c); - break; - } - if(m_ParsePointer >= m_Pattern.GetLength()) - return; - c = m_Pattern[m_ParsePointer]; - // Call a '{' repetition if followed by a digit - if (!(c=='*' || c=='+' || c=='?' || ( c=='{' && (m_ParsePointer+1) < m_Pattern.GetLength() && isdigit(m_Pattern[m_ParsePointer+1])) )) - return; // No repetitor - done. - m_ParsePointer++; - if(wascaret){ - TRACE0("RE: repetitive '^' detected\n"); - if(!m_Error) - m_Error = regeBadRepeat; - // ??? point to nuls? - } - switch(c){ - case '*': // Implemeted as +? - // + expression - StripInsert(pos,CSop(CSop::opPlus0,m_Strip.GetSize()-pos+1)); - m_Error || m_Strip.Add(CSop(CSop::opPlus1,m_Strip.GetSize()-pos)); - // ? expression - StripInsert(pos,CSop(CSop::opQuest0,m_Strip.GetSize()-pos+1)); - m_Error || m_Strip.Add(CSop(CSop::opQuest1,m_Strip.GetSize()-pos)); - break; - case '+': - // + expression - StripInsert(pos,CSop(CSop::opPlus0,m_Strip.GetSize()-pos+1)); - m_Error || m_Strip.Add(CSop(CSop::opPlus1,m_Strip.GetSize()-pos)); - break; - case '?': - // Kludge - emit y? as (y|) until subtle bug gets fixed :-) - StripInsert(pos,CSop(CSop::opChoice0,m_Strip.GetSize()-pos+1)); - m_Error || m_Strip.Add(CSop(CSop::opOr0,m_Strip.GetSize()-pos)); - m_Error || (m_Strip[pos].m_Operand=m_Strip.GetSize()-pos); - m_Error || m_Strip.Add(CSop(CSop::opOr1,1)); - m_Error || m_Strip.Add(CSop(CSop::opChoice1,2)); - break; - case '{': - count = ParseCount(); - if(m_ParsePointer < m_Pattern.GetLength() && m_Pattern[m_ParsePointer]==','){ - m_ParsePointer++; - if(isdigit(m_Pattern[m_ParsePointer])){ // HHH Personally, I doubt it is always available - count2=ParseCount(); - if(!(count<=count2)){ - TRACE0("RE: Disbalanced counts in '{}' repeater\n"); - m_Error || (m_Error=regeBadBrace); - // ??? point to nuls? - } - }else // Single number with comma - count2=256; // Infinity - }else // Single number - count2=count; - EmitRepeat(pos,count,count2); - if(m_ParsePointer >= m_Pattern.GetLength() || m_Pattern[m_ParsePointer]!='}'){ - // No '}'.. - TRACE0("RE: No immediately following '}' of '{' expression\n"); - while(m_ParsePointer < m_Pattern.GetLength() && m_Pattern[m_ParsePointer]!='}') - m_ParsePointer++; - if(m_ParsePointer >= m_Pattern.GetLength()){ - TRACE0("RE: No closing '}' found\n"); - m_Error || (m_Error=regeBrace); - }else - m_Error || (m_Error=regeBadBrace); - // ??? point to nuls? - }else - m_ParsePointer++; - break; - } - if(m_ParsePointer >= m_Pattern.GetLength()) - return; - c = m_Pattern[m_ParsePointer]; - if(!(c=='*' || c=='+' || c=='?' || (c=='{' && (m_ParsePointer+1)=pos) - m_ParseParens[tmp].m_Begin++; - if(m_ParseParens[tmp].m_End>=pos) - m_ParseParens[tmp].m_End++; - } -} - -void CRegEx::EmitOrdinary(UCHAR c) -{ - if(m_Flags®IgnoreCase && isalpha(c) && (tolower(c) !=toupper(c))){ - // Emit both cases - CString savePattern = m_Pattern; - int savePointer = m_ParsePointer; - m_Pattern=c; - m_Pattern+=']'; - m_ParsePointer=0; - ParseBracket(); - m_Pattern=savePattern; - m_ParsePointer=savePointer; - }else{ - m_Error || m_Strip.Add(CSop(CSop::opChar,c)); - if(!m_Category[(BYTE)c]) - m_Category[(BYTE)c]=m_Categories++; - } -} - -void CRegEx::EmitNonNewLineAny() -{ - // Kludges're going on and on.. -CString savePattern = m_Pattern; -int savePointer = m_ParsePointer; - m_Pattern="^\n]"; - m_ParsePointer=0; - ParseBracket(); - m_Pattern=savePattern; - m_ParsePointer=savePointer; -} - -int CRegEx::ParseCount() -{ -BOOL nonEmpty=FALSE; -int rv = 0; -UCHAR c; - while(m_ParsePointer < m_Pattern.GetLength() && isdigit(c=m_Pattern[m_ParsePointer]) && rv <=255){ - rv = rv*10 + c-'0'; - nonEmpty=TRUE; - m_ParsePointer++; - } - if(rv>255 || !nonEmpty){ - m_Error || (m_Error=regeBadBrace); - // ??? point to nuls? - } - return rv; -} - -void CRegEx::ParseBracket() -{ - // Dept. of truly sickening special case kludges - if((m_ParsePointer+5) < m_Pattern.GetLength() && !m_Pattern.Mid(m_ParsePointer,6).Compare("[:<]]")){ - m_Error || m_Strip.Add(CSop(CSop::opBOW)); - m_ParsePointer+=6; - return; - } - if((m_ParsePointer+5) < m_Pattern.GetLength() && !m_Pattern.Mid(m_ParsePointer,6).Compare("[:>]]")){ - m_Error || m_Strip.Add(CSop(CSop::opEOW)); - m_ParsePointer+=6; - return; - } -BOOL invert=TRUE; - if(m_ParsePointer < m_Pattern.GetLength() && m_Pattern[m_ParsePointer]=='^') - m_ParsePointer++; - else - invert=FALSE; -CSet cset; - if(m_ParsePointer < m_Pattern.GetLength()){ - switch(m_Pattern[m_ParsePointer]){ - case ']': - case '-': - cset.Add(m_Pattern[m_ParsePointer]); - m_ParsePointer++; - break; - } - } - while(m_ParsePointer < m_Pattern.GetLength() && m_Pattern[m_ParsePointer]!=']' && !((m_ParsePointer+1)=0;tmp--){ - if(cset.IsIn(tmp) && isalpha(tmp) && (toupper(tmp)!=tolower(tmp))) - cset.Add(isupper(tmp)?tolower(tmp):toupper(tmp)); - } - /* - if(!cset->m_Multis.IsEmpty()) - cset.CollatingCase(); - */ - } - if(invert){ - for(int tmp=CSet::size-1;tmp>=0;tmp--) - if(cset.IsIn(tmp)) - cset.Sub(tmp); - else - cset.Add(tmp); - if(m_Flags®NewLine) - cset.Sub('\n'); - /* - if(!cset.m_Multis.IsEmpty()) - cset.CollatingInvert(); - */ - } -UCHAR c = cset.GetOnly(); - if(c){ - EmitOrdinary(c); - }else - m_Error || m_Strip.Add(CSop(CSop::opAnyOf,StoreSet(cset))); -} - -void CRegEx::CSet::Add(UCHAR c) -{ - m_Set[(BYTE)c]=TRUE; - m_Hash+=c; -} - -BOOL CRegEx::CSet::IsIn(UCHAR c) -{ - return m_Set[(BYTE)c]; -} - -void CRegEx::CSet::Sub(UCHAR c) -{ - m_Set[(BYTE)c]=FALSE; - m_Hash-=c; -} - -UCHAR CRegEx::CSet::GetOnly() -{ -int rv = 0; -UCHAR only = 0; - for(int tmp=0;tmp=m_Pattern.GetLength()){ - m_Error || (m_Error=regeBracket); - // ??? point to nuls? - } - c = m_Pattern[m_ParsePointer]; - if(c== '-' || c==']'){ - m_Error || (m_Error=regeCType); - // ??? point to nuls? - } - ParseBracketCClass(cset); - if(m_ParsePointer>=m_Pattern.GetLength()){ - m_Error || (m_Error=regeBracket); - // ??? point to nuls? - } - if((m_ParsePointer+1)>=m_Pattern.GetLength() || (m_Pattern.Mid(m_ParsePointer,2).Compare(":]"))){ - m_Error || (m_Error=regeCType); - // ??? point to nuls? - }else - m_ParsePointer+=2; - break; - case '=': // Equivalence class - m_ParsePointer+=2; - if(m_ParsePointer >= m_Pattern.GetLength()){ - m_Error || (m_Error=regeBracket); - // ??? point to nuls? - } - c = m_Pattern[m_ParsePointer]; - if(c== '-' || c==']'){ - m_Error || (m_Error=regeCollate); - // ??? point to nuls? - } - ParseBracketEClass(cset); - if((m_ParsePointer+1)>=m_Pattern.GetLength() || (m_Pattern.Mid(m_ParsePointer,2).Compare("=]"))){ - m_Error || (m_Error=regeCollate); - // ??? point to nuls? - }else - m_ParsePointer+=2; - break; - default: // Symbol, character or range - { - UCHAR start, finish; - start = ParseBracketSymbol(); - if((m_ParsePointer((BYTE)finish)){ - m_Error || (m_Error=regeRange); - // ??? point to nuls? - } - for(int tmp=start;tmp<=(BYTE)finish;tmp++) - cset.Add(tmp); - } - break; - } -} - -void CRegEx::ParseBracketCClass(CSet& cset) -{ -static struct { - char *className; - char *classChars; -} cc[] = { - {"alnum","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"}, - {"alpha","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"}, - {"blank"," \t"}, - {"cntrl","\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37\177"}, - {"digit","0123456789"}, - {"graph","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"}, - {"lower","abcdefghijklmnopqrstuvwxyz"}, - {"print","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ "}, - {"punct","!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"}, - {"space","\t\n\v\f\r "}, - {"upper","ABCDEFGHIJKLMNOPQRSTUVWXYZ"}, - {"xdigit","0123456789ABCDEFabcdef"} -}; -CString cclass; -UCHAR c; - while(m_ParsePointer < m_Pattern.GetLength() && isalpha(c=m_Pattern[m_ParsePointer])){ - cclass+=c; - m_ParsePointer++; - } -char *classChars = NULL; - for(int tmp=0;tmp<(sizeof(cc)/sizeof(cc[0]));tmp++){ - if(!cclass.CompareNoCase(cc[tmp].className)){ - classChars=cc[tmp].classChars; - break; - } - } - if(!classChars){ - m_Error || (m_Error=regeCType); - // ??? point to nuls? - return; - } - while(*classChars) - cset.Add(*(classChars++)); - // --- multis -} - -void CRegEx::ParseBracketEClass(CSet& cset) -{ - cset.Add(ParseBracketCollatingElement('='));; -} - -UCHAR CRegEx::ParseBracketCollatingElement(UCHAR term) -{ -static struct { - char *entityName; - char entity; -} cc[] = { {"NUL",'\0'},{"SOH",'\001'},{"STX",'\002'},{"ETX",'\003'},{"EOT",'\004'},{"ENQ",'\005'},{"ACK",'\006'},{"BEL",'\007'},{"alert",'\007'},{"BS",'\010'},{"backspace",'\b'},{"HT",'\011'},{"tab",'\t'},{"LF",'\012'},{"newline",'\n'},{"VT",'\013'},{"vertical-tab",'\v'},{"FF",'\014'},{"form-feed",'\f'},{"CR",'\015'},{"carriage-return",'\r'},{"SO",'\016'},{"SI",'\017'},{"DLE",'\020'},{"DC1",'\021'},{"DC2",'\022'},{"DC3",'\023'},{"DC4",'\024'},{"NAK",'\025'},{"SYN",'\026'},{"ETB",'\027'},{"CAN",'\030'},{"EM",'\031'},{"SUB",'\032'},{"ESC",'\033'},{"IS4",'\034'},{"FS",'\034'},{"IS3",'\035'},{"GS",'\035'},{"IS2",'\036'},{"RS",'\036'},{"IS1",'\037'},{"US",'\037'},{"space",' '},{"exclamation-mark",'!'},{"quotation-mark",'"'},{"number-sign",'#'},{"dollar-sign",'$'},{"percent-sign",'%'},{"ampersand",'&'},{"apostrophe",'\''},{"left-parenthesis",'('},{"right-parenthesis",')'},{"asterisk",'*'},{"plus-sign",'+'},{"comma",','},{"hyphen",'-'},{"hyphen-minus",'-'},{"period",'.'},{"full-stop",'.'},{"slash",'/'},{"solidus",'/'},{"zero",'0'},{"one",'1'},{"two",'2'},{"three",'3'},{"four",'4'},{"five",'5'},{"six",'6'},{"seven",'7'},{"eight",'8'},{"nine",'9'},{"colon",':'},{"semicolon",';'},{"less-than-sign",'<'},{"equals-sign",'='},{"greater-than-sign",'>'},{"question-mark",'?'},{"commercial-at",'@'},{"left-square-bracket",'['},{"backslash",'\\'},{"reverse-solidus",'\\'},{"right-square-bracket",']'},{"circumflex",'^'},{"circumflex-accent",'^'},{"underscore",'_'},{"low-line",'_'},{"grave-accent",'`'},{"left-brace",'{'},{"left-curly-bracket",'{'},{"vertical-line",'|'},{"right-brace",'}'},{"right-curly-bracket",'}'},{"tilde",'~'},{"DEL",'\177'} }; -CString seeTwo; - seeTwo=term; - seeTwo+=']'; -CString entityName; - while(m_ParsePointer=m_Pattern.GetLength()){ - m_Error || (m_Error=regeBracket); - // ??? point to nuls? - return 0; - } - for(int tmp=0;tmp<(sizeof(cc)/sizeof(cc[0]));tmp++) - if(!entityName.CompareNoCase(cc[tmp].entityName)) - return cc[tmp].entity; - if(entityName.GetLength()==1) - return entityName[0]; - m_Error || (m_Error=regeCollate); - // ??? point to nuls? - return 0; -} - -UCHAR CRegEx::ParseBracketSymbol() -{ - if(m_ParsePointer>=m_Pattern.GetLength()){ - m_Error || (m_Error=regeBracket); - // ??? point to nuls? - } - if((m_ParsePointer+1)mustLength){ - mustStart=seqStart; - mustLength=seqLength; - } - seqLength=0; - break; - } - } // Hmm.. originally it's meant to be do while not opEnd.. - if(!mustLength) - return; - // Turn into string, but, wait, personally I'm sure it could be put in the main loop.. or maybe not.. - for(tmp=0;tmprv) - rv = nest; - nest--; - break; - } - } // Again, originally we were supposed to scan till opEnd.. - if(nest) - m_iFlags|=iflagsBad; // Could this be an ASSERTion? - return rv; -} - -void CRegEx::ParseLiteral() -{ - if(!m_Pattern.GetLength()){ - m_Error || (m_Error=regeEmpty); - // ??? point to nuls? - } - while(m_ParsePointer < m_Pattern.GetLength()) - EmitOrdinary(m_Pattern[m_ParsePointer++]); -} - -void CRegEx::ParseBRE(int stopa,int stopb) -{ -int start = m_Strip.GetSize(); -BOOL first=TRUE; -BOOL wasDollar=FALSE; - if(m_ParsePointer=m_Pattern.GetLength()){ - m_Error || (m_Error=regeEscape); - // ??? point to nuls - }else - c = 0x100|m_Pattern[m_ParsePointer++]; - } - switch(c){ - case '.': - if(m_Flags®NewLine) - EmitNonNewLineAny(); - else - m_Error || m_Strip.Add(CSop(CSop::opAny,0)); - break; - case '[': - ParseBracket(); - break; - case 0x100|'{': - m_Error || (m_Error=regeBadRepeat); - // ??? point to nuls? - break; - case 0x100|'(': - m_Subexps++; - subno=m_Subexps; - m_ParseParens.SetAtGrow(m_Subexps,CParenthesis(m_Strip.GetSize())); - m_Error || m_Strip.Add(CSop(CSop::opLeftParen,subno)); - if(m_ParsePointercount2){ - m_Error || (m_Error=regeBadBrace); - // ??? poin to nuls? - } - }else // Single number with comma - count2=256; - }else // Single number - count2=count; - EmitRepeat(pos,count,count2); - if((m_ParsePointer+1)>=m_Pattern.GetLength() || m_Pattern.Mid(m_ParsePointer,2).Compare("\\}")){ - while(m_ParsePointer=m_Pattern.GetLength()){ - m_Error || (m_Error=regeBrace); - // ??? point to nuls? - } - m_Error || (m_Error=regeBadBrace); - }else - m_ParsePointer+=2; - }else if(c=='$') - return TRUE; - return FALSE; -} - -CRegEx::CRegEx() -{ - m_bCompiled=FALSE; -} - -LPCTSTR CRegEx::MatchFast(LPCTSTR begin) -{ - MatchStatesClear(CSop::stCurrent); - m_Strip[1].m_MatchData|=CSop::stCurrent; -int stripLen = m_Strip.GetSize(); - MatchStep(1,stripLen-1,CSop::stCurrent,charNothing,CSop::stCurrent); - MatchStatesCopy(CSop::stFresh,CSop::stCurrent); -LPCTSTR coldp = NULL; -LPCTSTR p = begin; -int c = (begin==m_mBegin)?charOut:((int)(BYTE)m_mPointer[-1]); - for(;;){ - // next character.. - int lastc = c; - c = (p==m_mEnd)?charOut:(int)*(BYTE*)p; - if(MatchStatesEqual(CSop::stCurrent,CSop::stFresh)) - coldp=p; - // Is there an EOL and/or BOL between lastc and c? - they ask.. - int flagc=0; - int i = 0; - if((lastc=='\n' && m_Flags®NewLine) || (lastc==charOut && !(m_mFlags®NotBOL))){ - flagc=charBOL; - i=m_BOLs; - } - if((c=='\n' && m_Flags®NewLine) || (c==charOut && !(m_mFlags®NotEOL))){ - flagc=(flagc==charBOL)?charBOLEOL:charEOL; - i+=m_EOLs; - } - if(i){ - for(;i>0;i--) - MatchStep(1,stripLen-1,CSop::stCurrent,flagc,CSop::stCurrent); - } - // What about a word boundary? - they wonder.. - if((flagc==charBOL || (lastc!=charOut && !isWordableChar(c))) && (c!=charOut && isWordableChar(c))) - flagc = charBOW; - if((lastc!=charOut && isWordableChar(lastc)) && (flagc==charEOL || (c!=charOut && !isWordableChar(c)))) - flagc = charEOW; - if(flagc==charBOW || flagc==charEOW){ - MatchStep(1,stripLen-1,CSop::stCurrent,flagc,CSop::stCurrent); - } - // Are we done? Now WE wonder.. - if((m_Strip[stripLen-1].m_MatchData&CSop::stCurrent) || p==m_mEnd) - break; // They insist I need to note break out.. Okay, I do.. - // Nope, we're not done. We have to face this character.. - MatchStatesCopy(CSop::stTemp,CSop::stCurrent); - MatchStatesCopy(CSop::stCurrent,CSop::stFresh); - ASSERT(c!=charOut); - MatchStep(1,stripLen-1,CSop::stTemp,c,CSop::stCurrent); - p++; - } - ASSERT(coldp); - m_cOldP=coldp; // *** I believe this variable can be changed 'in-place' - if(m_Strip[stripLen-1].m_MatchData&CSop::stCurrent) - return &p[1]; - else - return NULL; -} - -void CRegEx::MatchStatesClear(BYTE mask) -{ -int stripLen = m_Strip.GetSize(); - for(int tmp=0;tmp0;i--) - MatchStep(from,to,CSop::stCurrent,flagc,CSop::stCurrent); - } - // Now we wonder about word boundaries.. - if((flagc==charBOL || (lastc!=charOut && !isWordableChar(lastc))) && (c!=charOut && isWordableChar(c))) - flagc=charBOW; - if((lastc!=charOut && isWordableChar(lastc)) && (flagc==charEOL || (c!=charOut && !isWordableChar(c)))) - flagc=charEOW; - if(flagc==charBOW || flagc==charEOW){ - MatchStep(from,to,CSop::stCurrent,flagc,CSop::stCurrent); - } - // Are we done we all wonder?? - if(m_Strip[to].m_MatchData&CSop::stCurrent) - mp=p; - if(MatchStatesEqual(CSop::stCurrent,CSop::stEmpty) || p==end) - break; // Again, we're obliged to note break out. We do. - // Sucks.. we have to face this character.. - MatchStatesCopy(CSop::stTemp,CSop::stCurrent); - MatchStatesCopy(CSop::stCurrent,CSop::stEmpty); - ASSERT(c!=charOut); - MatchStep(from,to,CSop::stTemp,c,CSop::stCurrent); - MatchStep(from,to,CSop::stCurrent,charNothing,CSop::stCurrent); - p++; - } - return mp; -} - -LPCTSTR CRegEx::MatchDissect(LPCTSTR begin,LPCTSTR end,int from,int to) -{ -LPCTSTR sp = begin, dp; -LPCTSTR stp, rest, tail, ssp, oldssp, sep; -int ssub, esub; -int es; -int i; - for(int ss=from;ss=sp); // It did work.. It should've.. - } - ssub=ss+1; - esub=es-1; - // Did innards match? - if(MatchSlow(sp,rest,ssub,esub)){ - dp = MatchDissect(sp,rest,ssub,esub); - ASSERT(dp==rest); - }else // nope.. - ASSERT(sp==rest); - sp = rest; - break; - case CSop::opPlus0: - stp=end; - for(;;){ - // How long could this one be?? - rest = MatchSlow(sp,stp,ss,es); - ASSERT(rest); // It did.. It should've.. - // Could the rest match the rest? - tail = MatchSlow(rest,end,es,to); - if(tail==end) - break; // yup. - // nope.. - stp=rest-1; - ASSERT(stp>=sp); // It should've worked, we believe.. - } - ssub=ss+1; - esub=es-1; - ssp=sp; - oldssp=ssp; - for(;;){ // Find last match of innards.. - sep = MatchSlow(ssp,rest,ssub,esub); - if((!sep) || sep==ssp) - break; // Failed or matched nothin' - oldssp=ssp; - ssp=sep; - } - if(!sep){ - // Last successfull.. - sep=ssp; - ssp=oldssp; - } - ASSERT(sep=rest); // Must exhaust substring they say.. - VERIFY(MatchSlow(ssp,sep,ssub,esub)==rest); // Assert or verify - that is the question.. - dp = MatchDissect(ssp,sep,ssub,esub); - ASSERT(dp==sep); - sp=rest; - break; - case CSop::opChoice0: - stp = end; - for(;;){ - // how long.. - rest = MatchSlow(sp,stp,ss,es); - ASSERT(rest); - // Could it.. - tail = MatchSlow(rest,end,es,to); - if(tail==end) - break; // y - // n - stp = rest-1; - ASSERT(stp>=sp); - } - ssub=ss+1; - esub=ss+m_Strip[ss].m_Operand-1; - ASSERT(m_Strip[esub].m_Operator==CSop::opOr0); - for(;;){ // Find first matching branch.. - if(MatchSlow(sp,rest,ssub,esub)==rest) - break; - // this one missed, try next.. - ASSERT(m_Strip[esub].m_Operator==CSop::opOr0); - esub++; - ASSERT(m_Strip[esub].m_Operator==CSop::opOr1); - ssub=esub+1; - esub+=m_Strip[esub].m_Operand; - if(m_Strip[esub].m_Operator==CSop::opOr1) - esub--; - else - ASSERT(m_Strip[esub].m_Operator==CSop::opChoice1); - } - dp = MatchDissect(sp,rest,ssub,esub); - ASSERT(dp==rest); - sp=rest; - break; - case CSop::opPlus1: - case CSop::opQuest1: - case CSop::opOr0: - case CSop::opOr1: - case CSop::opChoice1: - ASSERT(FALSE); - break; - case CSop::opLeftParen: - i = m_Strip[ss].m_Operand; - ASSERT(0m_mBegin && !isWordableChar(*(sp-1)))) && (spm_mBegin && isWordableChar(*(sp-1))))) - return NULL; - break; - case CSop::opQuest1: - break; - case CSop::opOr0: // Matches null, but needs to skip - ss++; - s = m_Strip[ss]; - do{ - ASSERT(s.m_Operator==CSop::opOr1); - ss+=s.m_Operand; - }while((s=m_Strip[ss]).m_Operator!=CSop::opChoice1); - // Now we should note that ss++ gets us past the Choice1.. - break; - default: - // Have to make a choice.. - hard=TRUE; - break; - } - } - if(!hard){ // That was it.. - if(sp!=end) - return NULL; - return sp; - } - ss--; // Adjust for ther for's final increment.. - // Hard stuff.. is going on and on.. -CSop s = m_Strip[ss]; -int i, len, offsave; -int ssub,esub; -LPCTSTR ssp, dp; - switch(s.m_Operator){ - case CSop::opBackRef0: // The vilest depths they say.. If I only knew what the 'viles' stands for.. - i = s.m_Operand; - ASSERT(0=0); - len = m_Matches[i].GetLength(); - ASSERT((end-m_mBegin)>=len); - if(sp>end-len) - return NULL; // Not enough left to match.. - ssp = m_mBegin+m_Matches[i].m_Begin; - if(memcmp(sp,ssp,len)) - return NULL; - while(m_Strip[ss]!=CSop(CSop::opBackRef1,i)) - ss++; - return MatchBackRef(sp+len,end,ss+1,to,level-1); - break; - case CSop::opQuest0: // to null or not they wonder.. - dp = MatchBackRef(sp,end,ss+1,to,level); - if(dp) - return dp; // not.. - return MatchBackRef(sp,end,ss+s.m_Operand+1,to,level-1); - break; - case CSop::opPlus0: - ASSERT(m_mLastPos.GetSize()); - ASSERT(level+1 <= m_Pluses); - m_mLastPos[level+1]=sp; - return MatchBackRef(sp,end,ss+1,to,level+1); - break; - case CSop::opPlus1: - if(sp == m_mLastPos[level]) // Last pass matched null - return MatchBackRef(sp,end,ss+1,to,level-1); - // Try another pass.. - m_mLastPos[level]=sp; - dp = MatchBackRef(sp,end,ss-s.m_Operand+1,to,level); - if(dp) - return dp; - return MatchBackRef(sp,end,ss+1,to,level-1); - break; - case CSop::opChoice0: // find the right one, ifany - ssub = ss+1; - esub = ss+s.m_Operand-1; - ASSERT(m_Strip[esub].m_Operator==CSop::opOr0); - for(;;){ // Find first matching branch. - dp = MatchBackRef(sp,end,ssub,esub,level); - if(dp) - return dp; - // This one missed, try next one.. - if(m_Strip[esub].m_Operator==CSop::opChoice1) - return NULL; // There is none.. - esub++; - ASSERT(m_Strip[esub].m_Operator==CSop::opOr1); - ssub=esub+1; - esub+=m_Strip[esub].m_Operand; - if(m_Strip[esub].m_Operator==CSop::opOr1) - esub--; - else - ASSERT(m_Strip[esub].m_Operator==CSop::opChoice1); - } - break; - case CSop::opLeftParen: // Must undo assignment if rest fails.. - i = s.m_Operand; - ASSERT(0= m_Matches.GetSize()) - return rv; - if(m_Matches[match].m_Begin<0 || m_Matches[match].m_End<0) - return rv; - ASSERT(m_Matches[match].m_Begin CMatchBox; - enum { - matchMatch = 0, - matchPreMatch = -1, - matchPostMatch = -2 - }; - CMatchBox m_Matches; - enum { - charOut = 256, - charBOL, charEOL, charBOLEOL, charNothing, charBOW, charEOW, - charMaxCode = charEOW, - charNNChars = (charMaxCode-255) - }; - int m_mFlags; - enum { - regeSuccess = 0, - regeNoMatch = 1, regeBadPattern, regeCollate, regeCType, regeEscape, regeSubReg, regeBracket, - regeParen, regeBrace, regeBadBrace, regeRange, regeSpace, regeBadRepeat, regeEmpty, regeAssert, - regeInvArg - }; - int m_Error; - CRegEx(); - BOOL m_bCompiled; - CString m_Pattern; - BOOL m_bBackRefs; - int m_Pluses; - CString m_Must; - BYTE m_Category[CHAR_MAX-CHAR_MIN+1]; - int m_Categories; - int m_EOLs; - int m_BOLs; - int m_iFlags; - int m_Subexps; - struct CSop { - void Dump(CDumpContext& dc); - CSop() {} - CSop(BYTE op,DWORD opnd=0) : m_Operator(op), m_Operand(opnd) {} - BOOL operator==(CSop& other) {return m_Operator==other.m_Operator && m_Operand==other.m_Operand;} - BOOL operator!=(CSop& other) { return !((*this)==other);} - enum { - opEnd = 1, opChar, opBOL, opEOL, opAny, opAnyOf, opBackRef0, opBackRef1, - opPlus0, opPlus1, opQuest0, opQuest1, opLeftParen, opRightParen, opChoice0, - opOr0, opOr1, opChoice1, opBOW, opEOW - }; - BYTE m_Operator; - DWORD m_Operand; - enum { - stCurrent = 1, stFresh = 2, stTemp = 4, stEmpty = 8 - }; - BYTE m_MatchData; - }; - typedef CArray CStrip; - CStrip m_Strip; - int m_Flags; - struct CSet { - CSet() : m_Hash(0) { memset(m_Set,0,sizeof(m_Set)); } - CSet(CSet& src) { (*this)=src; } - CSet& operator=(CSet& src) { memmove(this,&src,sizeof(*this)); return *this; } - BOOL operator==(CSet& other) { if(m_Hash!=other.m_Hash)return FALSE;return !memcmp(m_Set,other.m_Set,sizeof(m_Set)); } - enum { - size = (CHAR_MAX-CHAR_MIN+1) - }; - BOOL m_Set[size]; - BYTE m_Hash; - public: - UCHAR GetOnly(); - void Sub(UCHAR c); - BOOL IsIn(UCHAR c); - void Add(UCHAR c); - }; - typedef CArray CSets; - CSets m_Sets; - enum { - // Compile flags - regBasic = 0, regExtended = 1, - regIgnoreCase = 2, - regNoSubExpressions = 4, // Also works for matching. - regNewLine = 16, - regLiteral = 32, - // Match Flags - regNotBOL = 1, - regNotEOL = 2, - regOneMatch=64, - regBackRefs=128, - // iFlags - iflagsUseBOL=1, iflagsUseEOL=2, iflagsBad=4 - }; - CString Replace(LPCTSTR src,LPCTSTR rep,int flags=0); - BOOL Match(LPCTSTR src,int flags=0); - BOOL Compile(LPCTSTR regex,int flags=0); -private: -#ifdef _DEBUG - void DumpStrip(CDumpContext& dc); -#endif - LPCTSTR MatchBackRef(LPCTSTR begin,LPCTSTR end,int from,int to,int level); - typedef CArray CStrPtrArray; - CStrPtrArray m_mLastPos; - LPCTSTR MatchDissect(LPCTSTR begin,LPCTSTR end,int from,int to); - LPCTSTR MatchSlow(LPCTSTR begin,LPCTSTR end,int from,int to); - LPCTSTR m_cOldP; - BOOL MatchStatesEqual(BYTE m1,BYTE m2); - LPCTSTR m_mBegin; - void MatchStatesCopy(BYTE dst,BYTE src); - void MatchStep(int from,int to,BYTE maskBefore,int charCode,BYTE maskAfter); - void MatchStatesClear(BYTE mask); - LPCTSTR MatchFast(LPCTSTR begin); - LPCTSTR m_mEnd; - LPCTSTR m_mPointer; - BOOL ParseBREexp(BOOL ordinaryStar); - void ParseBRE(int stopa=0,int stopb=0); - void ParseLiteral(); - int CountPluses(); - void FigureMust(); - BOOL IsInSameSets(UCHAR c1,UCHAR c2); - BOOL IsInSets(UCHAR c); - void Categorize(); - int StripDuplicate(int from,int to); - void EmitRepeat(int pos,int from,int to); - UCHAR ParseBracketSymbol(); - UCHAR ParseBracketCollatingElement(UCHAR term); - void ParseBracketEClass(CSet& cset); - void ParseBracketCClass(CSet& cset); - void ParseBracketTerm(CSet& cset); - int StoreSet(CSet& cset); - void ParseBracket(); - int ParseCount(); - void EmitNonNewLineAny(); - void EmitOrdinary(UCHAR c); - void StripInsert(int pos,CSop& sop); - void ParseEREexp(); - void ParseERE(int stop=0); - struct CParenthesis { - long m_Begin; - long m_End; - CParenthesis(long b=0,long e=0) : m_Begin(b), m_End(e) {} - }; - typedef CArray CParens; - CParens m_ParseParens; - int m_ParsePointer; -}; -#ifdef _DEBUG -inline CDumpContext& operator<<(CDumpContext& dc, CRegEx::CSop& sop) { sop.Dump(dc); return dc; } -#endif - -#endif // __REGEX_H \ No newline at end of file diff --git a/shared-code/SNMPExtDll.h b/shared-code/SNMPExtDll.h deleted file mode 100644 index 14c920d..0000000 --- a/shared-code/SNMPExtDll.h +++ b/dev/null @@ -1,252 +0,0 @@ -#ifndef __SNMPEXTDLL_H -#define __SNMPEXTDLL_H - -#include "snmpeer.h" - -#include - -namespace Klever { - -class CSNMPExtDLL : public CSNMPeer { -public: - HINSTANCE m_hInstance; - HANDLE m_hEvent; - AsnObjectIdentifier m_OID; - BOOL (SNMP_FUNC_TYPE *m_extInit)(DWORD dw,HANDLE h,AsnObjectIdentifier* aoid); - BOOL (SNMP_FUNC_TYPE *m_extQuery)(BYTE b,RFC1157VarBindList* rvbl,AsnInteger* ai1,AsnInteger* ai2); - BOOL (SNMP_FUNC_TYPE *m_extTrap)(AsnObjectIdentifier*,AsnNetworkAddress*,AsnInteger*,AsnInteger*,AsnTimeticks*,RFC1157VarBindList*); - - HINSTANCE m_hSNMPAPI; - void (SNMP_FUNC_TYPE *m_snmpOIDFree)(AsnObjectIdentifier*); - LPVOID (SNMP_FUNC_TYPE *m_snmpAlloc)(UINT); - void (SNMP_FUNC_TYPE *m_snmpFree)(LPVOID); - void (SNMP_FUNC_TYPE *m_snmpVBLFree)(RFC1157VarBindList* vbl); - void InitSNMP() { - m_hSNMPAPI = ::LoadLibraryEx("SNMPAPI",NULL,0); - if(!m_hSNMPAPI) - return; - *(FARPROC*)&m_snmpOIDFree = ::GetProcAddress(m_hSNMPAPI,"SnmpUtilOidFree"); - *(FARPROC*)&m_snmpAlloc = ::GetProcAddress(m_hSNMPAPI,"SnmpUtilMemAlloc"); - *(FARPROC*)&m_snmpFree = ::GetProcAddress(m_hSNMPAPI,"SnmpUtilMemFree"); - *(FARPROC*)&m_snmpVBLFree = ::GetProcAddress(m_hSNMPAPI,"SnmpUtilVarBindListFree"); - if( - (m_snmpFree && !m_snmpAlloc) || - (m_snmpAlloc && !m_snmpFree) - ) - DeinitSNMP(); - } - void DeinitSNMP() { - if(!m_hSNMPAPI) - return; - ::FreeLibrary(m_hSNMPAPI); - m_hSNMPAPI=NULL; - } - void SNMPFreeOID(AsnObjectIdentifier* oid) { - if(m_hSNMPAPI && m_snmpOIDFree) - (*m_snmpOIDFree)(oid); - else - ::GlobalFree((HGLOBAL)oid->ids); - } - LPVOID SNMPAlloc(UINT size) { - if(m_hSNMPAPI && m_snmpAlloc) - return (*m_snmpAlloc)(size); - else - return ::GlobalAlloc(GMEM_FIXED,size); - } - void SNMPFree(LPVOID addr) { - if(m_hSNMPAPI && m_snmpFree) - (*m_snmpFree)(addr); - else - :: GlobalFree((HGLOBAL)addr); - } - void SNMPFreeVBL(RFC1157VarBindList& vbl) { - if(m_hSNMPAPI && m_snmpVBLFree) - (*m_snmpVBLFree)(&vbl); - else{ - for(UINT tmp=0;tmpsizeof(i)) - return FALSE; - i.s_addr=0; - memmove(&i,ip.stream,ip.length); - ou.Set(i); - return TRUE; - } - - - CSNMPExtDLL(LPCTSTR dllName) : m_hInstance(NULL) { InitSNMP(); Init(dllName); } - ~CSNMPExtDLL() { Deinit(); DeinitSNMP(); } - - BOOL Init(LPCTSTR dllName) { - Deinit(); - m_hInstance = ::LoadLibraryEx(dllName,NULL,0); - if(!m_hInstance) - return FALSE; - *(FARPROC*)&m_extInit = ::GetProcAddress(m_hInstance,"SnmpExtensionInit"); - *(FARPROC*)&m_extQuery = ::GetProcAddress(m_hInstance,"SnmpExtensionQuery"); - *(FARPROC*)&m_extTrap = ::GetProcAddress(m_hInstance,"SnmpExtensionTrap"); - if(!(m_extInit && m_extQuery && m_extTrap)){ - Deinit(); - return FALSE; - } - if(!((*m_extInit)(GetCurrentTime(),&m_hEvent,&m_OID))){ - Deinit(); - return FALSE; - } - return TRUE; - } - void Deinit() { - if(!m_hInstance) - return; - ::FreeLibrary(m_hInstance); - } - virtual BOOL Request(BYTE type,CSNMPVarBindList& in,CSNMPVarBindList& ou) { - RFC1157VarBindList vbl; - SNMPBuildVBL(vbl,in); - AsnInteger errorStatus, errorIndex; - (*m_extQuery)(type,&vbl,&errorStatus,&errorIndex); - ou.RemoveAll(); - SNMPParseVBL(vbl,ou); - SNMPFreeVBL(vbl); - return TRUE; - } -}; - -}; - -#endif // __SNMPEXTDLL_H diff --git a/shared-code/SNMPOIDs.h b/shared-code/SNMPOIDs.h deleted file mode 100644 index 68ee659..0000000 --- a/shared-code/SNMPOIDs.h +++ b/dev/null @@ -1,221 +0,0 @@ -#ifndef __SNMPOIDS_H -#define __SNMPOIDS_H - -#define DEFINE_OID(name,oid) static UINT name[] = oid - -// MIB-II OIDs - -#define OIDccitt {0} -#define OIDnull {0,0} -#define OIDiso {1} -#define OIDorg {1,3} -#define OIDdod {1,3,6} -#define OIDinternet {1,3,6,1} -#define OIDdirectory {1,3,6,1,1} -#define OIDmgmt {1,3,6,1,2} -#define OIDmib_2 {1,3,6,1,2,1} -#define OIDsystem {1,3,6,1,2,1,1} -#define OIDsysDescr {1,3,6,1,2,1,1,1} -#define OIDsysObjectID {1,3,6,1,2,1,1,2} -#define OIDsysUpTime {1,3,6,1,2,1,1,3} -#define OIDsysContact {1,3,6,1,2,1,1,4} -#define OIDsysName {1,3,6,1,2,1,1,5} -#define OIDsysLocation {1,3,6,1,2,1,1,6} -#define OIDsysServices {1,3,6,1,2,1,1,7} -#define OIDtransmission {1,3,6,1,2,1,10} -#define OIDsnmp {1,3,6,1,2,1,11} -#define OIDsnmpInPkts {1,3,6,1,2,1,11,1} -#define OIDsnmpInBadValues {1,3,6,1,2,1,11,10} -#define OIDsnmpInReadOnlys {1,3,6,1,2,1,11,11} -#define OIDsnmpInGenErrs {1,3,6,1,2,1,11,12} -#define OIDsnmpInTotalReqVars {1,3,6,1,2,1,11,13} -#define OIDsnmpInTotalSetVars {1,3,6,1,2,1,11,14} -#define OIDsnmpInGetRequests {1,3,6,1,2,1,11,15} -#define OIDsnmpInGetNexts {1,3,6,1,2,1,11,16} -#define OIDsnmpInSetRequests {1,3,6,1,2,1,11,17} -#define OIDsnmpInGetResponses {1,3,6,1,2,1,11,18} -#define OIDsnmpInTraps {1,3,6,1,2,1,11,19} -#define OIDsnmpOutPkts {1,3,6,1,2,1,11,2} -#define OIDsnmpOutTooBigs {1,3,6,1,2,1,11,20} -#define OIDsnmpOutNoSuchNames {1,3,6,1,2,1,11,21} -#define OIDsnmpOutBadValues {1,3,6,1,2,1,11,22} -#define OIDsnmpOutGenErrs {1,3,6,1,2,1,11,24} -#define OIDsnmpOutGetRequests {1,3,6,1,2,1,11,25} -#define OIDsnmpOutGetNexts {1,3,6,1,2,1,11,26} -#define OIDsnmpOutSetRequests {1,3,6,1,2,1,11,27} -#define OIDsnmpOutGetResponses {1,3,6,1,2,1,11,28} -#define OIDsnmpOutTraps {1,3,6,1,2,1,11,29} -#define OIDsnmpInBadVersions {1,3,6,1,2,1,11,3} -#define OIDsnmpEnableAuthenTraps {1,3,6,1,2,1,11,30} -#define OIDsnmpInBadCommunityNames {1,3,6,1,2,1,11,4} -#define OIDsnmpInBadCommunityUses {1,3,6,1,2,1,11,5} -#define OIDsnmpInASNParseErrs {1,3,6,1,2,1,11,6} -#define OIDsnmpInTooBigs {1,3,6,1,2,1,11,8} -#define OIDsnmpInNoSuchNames {1,3,6,1,2,1,11,9} -#define OIDinterfaces {1,3,6,1,2,1,2} -#define OIDifNumber {1,3,6,1,2,1,2,1} -#define OIDifTable {1,3,6,1,2,1,2,2} -#define OIDifEntry {1,3,6,1,2,1,2,2,1} -#define OIDifIndex {1,3,6,1,2,1,2,2,1,1} -#define OIDifInOctets {1,3,6,1,2,1,2,2,1,10} -#define OIDifInUcastPkts {1,3,6,1,2,1,2,2,1,11} -#define OIDifInNUcastPkts {1,3,6,1,2,1,2,2,1,12} -#define OIDifInDiscards {1,3,6,1,2,1,2,2,1,13} -#define OIDifInErrors {1,3,6,1,2,1,2,2,1,14} -#define OIDifInUnknownProtos {1,3,6,1,2,1,2,2,1,15} -#define OIDifOutOctets {1,3,6,1,2,1,2,2,1,16} -#define OIDifOutUcastPkts {1,3,6,1,2,1,2,2,1,17} -#define OIDifOutNUcastPkts {1,3,6,1,2,1,2,2,1,18} -#define OIDifOutDiscards {1,3,6,1,2,1,2,2,1,19} -#define OIDifDescr {1,3,6,1,2,1,2,2,1,2} -#define OIDifOutErrors {1,3,6,1,2,1,2,2,1,20} -#define OIDifOutQLen {1,3,6,1,2,1,2,2,1,21} -#define OIDifSpecific {1,3,6,1,2,1,2,2,1,22} -#define OIDifType {1,3,6,1,2,1,2,2,1,3} -#define OIDifMtu {1,3,6,1,2,1,2,2,1,4} -#define OIDifSpeed {1,3,6,1,2,1,2,2,1,5} -#define OIDifPhysAddress {1,3,6,1,2,1,2,2,1,6} -#define OIDifAdminStatus {1,3,6,1,2,1,2,2,1,7} -#define OIDifOperStatus {1,3,6,1,2,1,2,2,1,8} -#define OIDifLastChange {1,3,6,1,2,1,2,2,1,9} -#define OIDat {1,3,6,1,2,1,3} -#define OIDatTable {1,3,6,1,2,1,3,1} -#define OIDatEntry {1,3,6,1,2,1,3,1,1} -#define OIDatIfIndex {1,3,6,1,2,1,3,1,1,1} -#define OIDatPhysAddress {1,3,6,1,2,1,3,1,1,2} -#define OIDatNetAddress {1,3,6,1,2,1,3,1,1,3} -#define OIDip {1,3,6,1,2,1,4} -#define OIDipForwarding {1,3,6,1,2,1,4,1} -#define OIDipOutRequests {1,3,6,1,2,1,4,10} -#define OIDipOutDiscards {1,3,6,1,2,1,4,11} -#define OIDipOutNoRoutes {1,3,6,1,2,1,4,12} -#define OIDipReasmTimeout {1,3,6,1,2,1,4,13} -#define OIDipReasmReqds {1,3,6,1,2,1,4,14} -#define OIDipReasmOKs {1,3,6,1,2,1,4,15} -#define OIDipReasmFails {1,3,6,1,2,1,4,16} -#define OIDipFragOKs {1,3,6,1,2,1,4,17} -#define OIDipFragFails {1,3,6,1,2,1,4,18} -#define OIDipFragCreates {1,3,6,1,2,1,4,19} -#define OIDipDefaultTTL {1,3,6,1,2,1,4,2} -#define OIDipAddrTable {1,3,6,1,2,1,4,20} -#define OIDipAddrEntry {1,3,6,1,2,1,4,20,1} -#define OIDipAdEntAddr {1,3,6,1,2,1,4,20,1,1} -#define OIDipAdEntIfIndex {1,3,6,1,2,1,4,20,1,2} -#define OIDipAdEntNetMask {1,3,6,1,2,1,4,20,1,3} -#define OIDipAdEntBcastAddr {1,3,6,1,2,1,4,20,1,4} -#define OIDipAdEntReasmMaxSize {1,3,6,1,2,1,4,20,1,5} -#define OIDipRouteTable {1,3,6,1,2,1,4,21} -#define OIDipRouteEntry {1,3,6,1,2,1,4,21,1} -#define OIDipRouteDest {1,3,6,1,2,1,4,21,1,1} -#define OIDipRouteAge {1,3,6,1,2,1,4,21,1,10} -#define OIDipRouteMask {1,3,6,1,2,1,4,21,1,11} -#define OIDipRouteMetric5 {1,3,6,1,2,1,4,21,1,12} -#define OIDipRouteInfo {1,3,6,1,2,1,4,21,1,13} -#define OIDipRouteIfIndex {1,3,6,1,2,1,4,21,1,2} -#define OIDipRouteMetric1 {1,3,6,1,2,1,4,21,1,3} -#define OIDipRouteMetric2 {1,3,6,1,2,1,4,21,1,4} -#define OIDipRouteMetric3 {1,3,6,1,2,1,4,21,1,5} -#define OIDipRouteMetric4 {1,3,6,1,2,1,4,21,1,6} -#define OIDipRouteNextHop {1,3,6,1,2,1,4,21,1,7} -#define OIDipRouteType {1,3,6,1,2,1,4,21,1,8} -#define OIDipRouteProto {1,3,6,1,2,1,4,21,1,9} -#define OIDipNetToMediaTable {1,3,6,1,2,1,4,22} -#define OIDipNetToMediaEntry {1,3,6,1,2,1,4,22,1} -#define OIDipNetToMediaIfIndex {1,3,6,1,2,1,4,22,1,1} -#define OIDipNetToMediaPhysAddress {1,3,6,1,2,1,4,22,1,2} -#define OIDipNetToMediaNetAddress {1,3,6,1,2,1,4,22,1,3} -#define OIDipNetToMediaType {1,3,6,1,2,1,4,22,1,4} -#define OIDipRoutingDiscards {1,3,6,1,2,1,4,23} -#define OIDipInReceives {1,3,6,1,2,1,4,3} -#define OIDipInHdrErrors {1,3,6,1,2,1,4,4} -#define OIDipInAddrErrors {1,3,6,1,2,1,4,5} -#define OIDipForwDatagrams {1,3,6,1,2,1,4,6} -#define OIDipInUnknownProtos {1,3,6,1,2,1,4,7} -#define OIDipInDiscards {1,3,6,1,2,1,4,8} -#define OIDipInDelivers {1,3,6,1,2,1,4,9} -#define OIDicmp {1,3,6,1,2,1,5} -#define OIDicmpInMsgs {1,3,6,1,2,1,5,1} -#define OIDicmpInTimestamps {1,3,6,1,2,1,5,10} -#define OIDicmpInTimestampReps {1,3,6,1,2,1,5,11} -#define OIDicmpInAddrMasks {1,3,6,1,2,1,5,12} -#define OIDicmpInAddrMaskReps {1,3,6,1,2,1,5,13} -#define OIDicmpOutMsgs {1,3,6,1,2,1,5,14} -#define OIDicmpOutErrors {1,3,6,1,2,1,5,15} -#define OIDicmpOutDestUnreachs {1,3,6,1,2,1,5,16} -#define OIDicmpOutTimeExcds {1,3,6,1,2,1,5,17} -#define OIDicmpOutParmProbs {1,3,6,1,2,1,5,18} -#define OIDicmpOutSrcQuenchs {1,3,6,1,2,1,5,19} -#define OIDicmpInErrors {1,3,6,1,2,1,5,2} -#define OIDicmpOutRedirects {1,3,6,1,2,1,5,20} -#define OIDicmpOutEchos {1,3,6,1,2,1,5,21} -#define OIDicmpOutEchoReps {1,3,6,1,2,1,5,22} -#define OIDicmpOutTimestamps {1,3,6,1,2,1,5,23} -#define OIDicmpOutTimestampReps {1,3,6,1,2,1,5,24} -#define OIDicmpOutAddrMasks {1,3,6,1,2,1,5,25} -#define OIDicmpOutAddrMaskReps {1,3,6,1,2,1,5,26} -#define OIDicmpInDestUnreachs {1,3,6,1,2,1,5,3} -#define OIDicmpInTimeExcds {1,3,6,1,2,1,5,4} -#define OIDicmpInParmProbs {1,3,6,1,2,1,5,5} -#define OIDicmpInSrcQuenchs {1,3,6,1,2,1,5,6} -#define OIDicmpInRedirects {1,3,6,1,2,1,5,7} -#define OIDicmpInEchos {1,3,6,1,2,1,5,8} -#define OIDicmpInEchoReps {1,3,6,1,2,1,5,9} -#define OIDtcp {1,3,6,1,2,1,6} -#define OIDtcpRtoAlgorithm {1,3,6,1,2,1,6,1} -#define OIDtcpInSegs {1,3,6,1,2,1,6,10} -#define OIDtcpOutSegs {1,3,6,1,2,1,6,11} -#define OIDtcpRetransSegs {1,3,6,1,2,1,6,12} -#define OIDtcpConnTable {1,3,6,1,2,1,6,13} -#define OIDtcpConnEntry {1,3,6,1,2,1,6,13,1} -#define OIDtcpConnState {1,3,6,1,2,1,6,13,1,1} -#define OIDtcpConnLocalAddress {1,3,6,1,2,1,6,13,1,2} -#define OIDtcpConnLocalPort {1,3,6,1,2,1,6,13,1,3} -#define OIDtcpConnRemAddress {1,3,6,1,2,1,6,13,1,4} -#define OIDtcpConnRemPort {1,3,6,1,2,1,6,13,1,5} -#define OIDtcpInErrs {1,3,6,1,2,1,6,14} -#define OIDtcpOutRsts {1,3,6,1,2,1,6,15} -#define OIDtcpRtoMin {1,3,6,1,2,1,6,2} -#define OIDtcpRtoMax {1,3,6,1,2,1,6,3} -#define OIDtcpMaxConn {1,3,6,1,2,1,6,4} -#define OIDtcpActiveOpens {1,3,6,1,2,1,6,5} -#define OIDtcpPassiveOpens {1,3,6,1,2,1,6,6} -#define OIDtcpAttemptFails {1,3,6,1,2,1,6,7} -#define OIDtcpEstabResets {1,3,6,1,2,1,6,8} -#define OIDtcpCurrEstab {1,3,6,1,2,1,6,9} -#define OIDudp {1,3,6,1,2,1,7} -#define OIDudpInDatagrams {1,3,6,1,2,1,7,1} -#define OIDudpNoPorts {1,3,6,1,2,1,7,2} -#define OIDudpInErrors {1,3,6,1,2,1,7,3} -#define OIDudpOutDatagrams {1,3,6,1,2,1,7,4} -#define OIDudpTable {1,3,6,1,2,1,7,5} -#define OIDudpEntry {1,3,6,1,2,1,7,5,1} -#define OIDudpLocalAddress {1,3,6,1,2,1,7,5,1,1} -#define OIDudpLocalPort {1,3,6,1,2,1,7,5,1,2} -#define OIDegp {1,3,6,1,2,1,8} -#define OIDegpInMsgs {1,3,6,1,2,1,8,1} -#define OIDegpInErrors {1,3,6,1,2,1,8,2} -#define OIDegpOutMsgs {1,3,6,1,2,1,8,3} -#define OIDegpOutErrors {1,3,6,1,2,1,8,4} -#define OIDegpNeighTable {1,3,6,1,2,1,8,5} -#define OIDegpNeighEntry {1,3,6,1,2,1,8,5,1} -#define OIDegpNeighState {1,3,6,1,2,1,8,5,1,1} -#define OIDegpNeighStateUps {1,3,6,1,2,1,8,5,1,10} -#define OIDegpNeighStateDowns {1,3,6,1,2,1,8,5,1,11} -#define OIDegpNeighIntervalHello {1,3,6,1,2,1,8,5,1,12} -#define OIDegpNeighIntervalPoll {1,3,6,1,2,1,8,5,1,13} -#define OIDegpNeighMode {1,3,6,1,2,1,8,5,1,14} -#define OIDegpNeighEventTrigger {1,3,6,1,2,1,8,5,1,15} -#define OIDegpNeighAddr {1,3,6,1,2,1,8,5,1,2} -#define OIDegpNeighAs {1,3,6,1,2,1,8,5,1,3} -#define OIDegpNeighInMsgs {1,3,6,1,2,1,8,5,1,4} -#define OIDegpNeighInErrs {1,3,6,1,2,1,8,5,1,5} -#define OIDegpNeighOutMsgs {1,3,6,1,2,1,8,5,1,6} -#define OIDegpNeighOutErrs {1,3,6,1,2,1,8,5,1,7} -#define OIDegpNeighInErrMsgs {1,3,6,1,2,1,8,5,1,8} -#define OIDegpNeighOutErrMsgs {1,3,6,1,2,1,8,5,1,9} -#define OIDegpAs {1,3,6,1,2,1,8,6} -#define OIDexperimental {1,3,6,1,3} -#define OIDprivate {1,3,6,1,4} -#define OIDenterprises {1,3,6,1,4,1} - -#endif // __SNMPOIDS_H \ No newline at end of file diff --git a/shared-code/SNMPeer.h b/shared-code/SNMPeer.h deleted file mode 100644 index 68f2efe..0000000 --- a/shared-code/SNMPeer.h +++ b/dev/null @@ -1,286 +0,0 @@ -#ifndef __SNMPEER_H -#define __SNMPEER_H - -namespace Klever { - -class CASNAny { -public: - enum { - asnCls = 0xC0, - asnClsUniversal = 0x00, - asnClsApplication = 0x40, - asnClsContextSpecific = 0x80, - asnClsPrivate = 0xC0, - asnConstructed = 0x20, - asnPrimitive = 0x00, - asnTag = 0x1F, - // ASN.1 Primitive Tags - asnTagInteger = 0x02, - asnTagOctetString = 0x04, - asnTagNull = 0x05, - asnTagOID = 0x06, - // ASN.1 Constructed Tags - asnTagSequence = 0x10, - // RFC1155 Primitive Tags - asnTagIP = 0x00, - asnTagCounter = 0x01, - asnTagGauge = 0x02, - asnTagTicks = 0x03, - asnTagOpaque = 0x04, - // RFC1213 alias - asnTagDispString = 0x04, // (ASN.1 Octet string) - // RFC1157 Constructed Tags - asnTagGetRequest = 0x00, - asnTagGetNextRequest = 0x01, - asnTagGetResponse = 0x02, - asnTagSetRequest = 0x03, - asnTagTrap = 0x04 - }; - enum { - typeASNInteger = (asnClsUniversal|asnPrimitive|asnTagInteger), - typeASNOctetString = (asnClsUniversal|asnPrimitive|asnTagOctetString), - typeASNNull = (asnClsUniversal|asnPrimitive|asnTagNull), - typeASNOID = (asnClsUniversal|asnPrimitive|asnTagOID), - - typeASNSequence = (asnClsUniversal|asnConstructed|asnTagSequence), - typeASNSequenceOf = (asnClsUniversal|asnConstructed|asnTagSequence), - - typeASNIP = (asnClsApplication|asnPrimitive|asnTagIP), - typeASNCounter = (asnClsApplication|asnPrimitive|asnTagCounter), - typeASNGauge = (asnClsApplication|asnPrimitive|asnTagGauge), - typeASNTicks = (asnClsApplication|asnPrimitive|asnTagTicks), - typeASNOpaque = (asnClsApplication|asnPrimitive|asnTagOpaque), - typeASNDispString = (asnClsUniversal|asnPrimitive|asnTagOctetString), - - typeASNGetRequest = (asnClsContextSpecific|asnConstructed|asnTagGetRequest), - typeASNGetNextRequest = (asnClsContextSpecific|asnConstructed|asnTagGetNextRequest), - typeASNGetResponse = (asnClsContextSpecific|asnConstructed|asnTagGetResponse), - typeASNSetRequest = (asnClsContextSpecific|asnConstructed|asnTagSetRequest), - typeASNTrap = (asnClsContextSpecific|asnConstructed|asnTagTrap) - }; - - typedef LONG asnInteger; - typedef LARGE_INTEGER asnInteger64; - typedef DWORD asnCounter; - typedef ULARGE_INTEGER asnCounter64; - typedef DWORD asnGauge; - typedef ULARGE_INTEGER asnGauge64; - typedef DWORD asnTicks; - typedef ULARGE_INTEGER asnTicks64; - struct asnDynamic { - UINT size; - LPBYTE data; - BOOL Allocate(UINT size) { - BOOL rv = Free(); - if(size) - rv=rv&&(data=new BYTE[size]); - if(rv) - asnDynamic::size=size; - return rv; - } - BOOL Set(LPBYTE data,UINT size) { - BOOL rv = Allocate(size); - if(rv && size) - memmove(asnDynamic::data,data,size); - return rv; - } - BOOL Free() { - if(!size) - return TRUE; - delete data; - size=0; - data=0; - return TRUE; - } - void Clean() { - size=0; - data=0; - } - BOOL Copy(asnDynamic& src) { - BOOL rv = Free(); - if(rv){ - if(src.size) - rv=rv&&(data = new BYTE[src.size]); - if(rv){ - if(size=src.size) - memmove(data,src.data,size); - } - } - return rv; - } - }; - typedef asnDynamic asnOctetString; - typedef asnDynamic asnOID; - typedef in_addr asnIP; - typedef asnDynamic asnSequence; - - BYTE type; - enum _storeType { - storeDynamic, - storeStatic - } storeType; - union { - asnInteger number; - asnInteger64 number64; - asnOctetString string; - asnOID oid; - asnSequence sequence; - asnIP ip; - asnCounter counter; - asnCounter64 counter64; - asnGauge gauge; - asnGauge64 gauge64; - asnTicks ticks; - asnTicks64 ticks64; - asnDynamic data; - } value; - - CASNAny() : type(typeASNNull), storeType(storeStatic) { value.data.Clean(); } - CASNAny(CASNAny& src) : type(typeASNNull), storeType(storeStatic) { value.data.Clean();Copy(src); } - CASNAny(BYTE type) : type(type), storeType(storeStatic) { value.data.Clean(); } - CASNAny(BYTE type,LONG number) : type(typeASNNull), storeType(storeStatic) { value.data.Clean();Set(type,number); } - CASNAny(BYTE type,LONGLONG number) : type(typeASNNull), storeType(storeStatic) { value.data.Clean();Set(type,number); } - CASNAny(BYTE type,LPCTSTR string) : type(typeASNNull), storeType(storeStatic) { value.data.Clean();Set(type,string); } - CASNAny(BYTE type,LPBYTE data,UINT length) : type(typeASNNull), storeType(storeStatic) { value.data.Clean();Set(type,data,length); } - CASNAny(BYTE type,UINT* data,UINT size) : type(typeASNNull), storeType(storeStatic) { value.data.Clean();Set(type,(LPBYTE)data,size); } - CASNAny(in_addr& ip) : type(typeASNNull), storeType(storeStatic) { value.data.Clean();Set(ip); } - ~CASNAny() { Free(); } - - BOOL Set(BYTE type) { - BOOL rv = Free(); - CASNAny::type=type; - return rv; - } - BOOL Set(BYTE type,LONG number) { - BOOL rv = Free(); - CASNAny::type=type; - value.number=number; - storeType=storeStatic; - return rv; - } - BOOL Set(BYTE type,LONGLONG number) { - BOOL rv = Free(); - CASNAny::type=type; - value.number64.QuadPart = number; - storeType=storeStatic; - return rv; - } - BOOL Set(BYTE type,LPCTSTR string) { - BOOL rv = Free(); - CASNAny::type=type; - rv=rv&&value.string.Set((LPBYTE)string,strlen(string)+1); - if(rv){ - value.string.size--; - storeType=storeDynamic; - } - return rv; - } - BOOL Set(BYTE type,LPBYTE data,UINT length) { - BOOL rv = Free(); - CASNAny::type=type; - rv=rv&&value.data.Set(data,length); - if(rv) - storeType=storeDynamic; - return rv; - } - BOOL Set(in_addr& ip) { - BOOL rv = Free(); - memmove(&value.ip,&ip,sizeof(value.ip)); - type=typeASNIP; - storeType=storeStatic; - return rv; - } - BOOL Free() { - if(storeType==storeDynamic) - value.data.Free(); - else{ - memset(&value,0,sizeof(value)); - value.data.Clean(); - } - storeType=storeStatic; - type=typeASNNull; - return TRUE; - } - BOOL Copy(CASNAny& src) { - BOOL rv = Free(); - if(src.storeType==storeDynamic){ - rv=rv&&value.data.Copy(src.value.data); - if(rv){ - type=src.type; - storeType=src.storeType; - } - }else{ - memmove(this,&src,sizeof(*this)); - } - return rv; - } - CASNAny& operator=(CASNAny& src) { - VERIFY(Copy(src)); - return *this; - } - - // High Level - CString GetString() { - ASSERT(storeType==storeDynamic); - CString rv; - LPTSTR b = rv.GetBuffer(value.data.size+1); - ASSERT(b); - b[value.data.size]=0; - memmove(b,value.data.data,value.data.size); - rv.ReleaseBuffer(); - return rv; - } -}; - - -class CSNMPVarBind { -public: - CASNAny name; - CASNAny value; - - CSNMPVarBind() {} - CSNMPVarBind(CASNAny& name,CASNAny& value) : name(name), value(value) {} - CSNMPVarBind(CASNAny& name) : name(name) {} - CSNMPVarBind(CSNMPVarBind& src) { Copy(src); } - BOOL Copy(CSNMPVarBind& src) { - name.Copy(src.name); - value.Copy(src.value); - return TRUE; - } - CSNMPVarBind& operator=(CSNMPVarBind& src) { - Copy(src); - return *this; - } - // High level - BOOL IsName(UINT* prefix,UINT prefixSize,BOOL bExact=FALSE) { - if(name.type!=CASNAny::typeASNOID) - return FALSE; - if(name.value.oid.size { -public: - CSNMPVarBind* GetVarBind(UINT* prefix,UINT prefixSize,BOOL bExact=FALSE) { - POSITION p = GetHeadPosition(); - while(p){ - CSNMPVarBind& vb = GetNext(p); - if(vb.IsName(prefix,prefixSize,bExact)) - return &vb; - } - return NULL; - } -}; - -class CSNMPeer { -public: - virtual BOOL Request(BYTE type,CSNMPVarBindList& in,CSNMPVarBindList& ou) = 0; -}; - -}; - -#endif // __SNMPEER_H diff --git a/shared-code/install.h b/shared-code/install.h deleted file mode 100644 index 8c55ca9..0000000 --- a/shared-code/install.h +++ b/dev/null @@ -1,370 +0,0 @@ -#define WIN32_LEAN_AND_MEAN -#define VC_EXTRALEAN -#define WIN32_EXTRALEAN -#include -#include -#include -#include -#include -#include - -extern "C" WINSHELLAPI void WINAPI SHFree( LPVOID); - -template class Smart { -public: - T *pT; - - Smart() : pT(NULL) {} - Smart(int cb) : pT(new T[cb]) {} - Smart(T* p) : pT(p) {} - ~Smart() { if(pT)delete pT; } - - Smart& operator=(T* p) { if(pT)delete pT; pT=p; return *this; } - operator T* () { return pT; } - -// T& operator[](int ndx) { return pT[ndx]; } - - T* Detach() { T* rv = pT; pT=NULL; return rv; } -}; -typedef Smart STRING; - -#define APPEND_SLASH(str) if((str)[strlen(str)-1]!='\\')strcat(str,"\\") - -HINSTANCE theInstance; - -LPSTR strFETCH_REG_KEY(HKEY hRoot,LPCSTR subKey,LPCSTR val) -{ -HKEY hkey; - if(RegOpenKeyEx(hRoot,subKey,0,KEY_QUERY_VALUE,&hkey)!=ERROR_SUCCESS) - return NULL; -DWORD kType,cb=0; -STRING rv; - if(RegQueryValueEx(hkey,val,NULL,&kType,NULL,&cb)==ERROR_SUCCESS && kType==REG_SZ){ - rv= new char[cb]; - _ASSERT(rv!=NULL); - if(RegQueryValueEx(hkey,val,NULL,&kType,(LPBYTE)(LPSTR)rv,&cb)!=ERROR_SUCCESS) - rv=NULL; - } - RegCloseKey(hkey); - return rv.Detach(); -} - -BOOL strSET_REG_KEY(HKEY hRoot,LPCSTR subKey,LPCSTR valName,LPCSTR val) -{ -HKEY hkey; -DWORD dw; - if(RegCreateKeyEx(hRoot,subKey,0,REG_NONE,REG_OPTION_NON_VOLATILE,KEY_READ|KEY_WRITE,NULL,&hkey,&dw)!=ERROR_SUCCESS) - return FALSE; -BOOL rv = (RegSetValueEx(hkey,valName,0,REG_SZ,(LPBYTE)val,strlen(val)+1)==ERROR_SUCCESS); - RegCloseKey(hkey); - return rv; -} - -void MAKE_PATH(LPCSTR path) -{ -STRING tmp(strlen(path)+1); -LPCSTR t0=path; -LPSTR t1=tmp; - while(*t0){ - if((*t0)=='\\'){ - *t1=0; - CreateDirectory(tmp,NULL); - } - *(t1++)=*(t0++); - } - *t1=0; - CreateDirectory(tmp,NULL); -} - -BOOL ADDMENU(LPCSTR menu,LPCSTR item,LPCSTR path,LPCSTR program) -{ -STRING stm = strFETCH_REG_KEY(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders","Programs"); - if(!stm) - return FALSE; -int pil = 1+strlen(path)+1+strlen(program)+1+1; -STRING pi(pil); - strcpy(pi,path); - APPEND_SLASH(pi); - strcat(pi,program); -int ipl = strlen(stm)+1+strlen(menu)+1+strlen(item)+4+1; -STRING ip(ipl); - memmove(ip,stm,strlen(stm)+1); - APPEND_SLASH(ip); - strcat(ip,menu); - MAKE_PATH(ip); - APPEND_SLASH(ip); - strcat(ip,item); - strcat(ip,".lnk"); -IShellLink* sl = NULL; -IPersistFile* pf = NULL; -BOOL rv = FALSE; - do{ - HRESULT hrv = CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER,IID_IShellLink,(LPVOID*)&sl); - if(!SUCCEEDED(hrv)) - break; - sl->SetDescription(item); - sl->SetPath(pi); - hrv = sl->QueryInterface(IID_IPersistFile,(LPVOID*)&pf); - if(!SUCCEEDED(hrv)) - break; - WORD wsz[MAX_PATH]; - MultiByteToWideChar(CP_ACP,0,ip,-1,wsz,MAX_PATH); - hrv = pf->Save(wsz,TRUE); - if(SUCCEEDED(hrv)) - rv=TRUE; - }while(FALSE); - if(pf) - pf->Release(); - if(sl) - sl->Release(); - return rv; -} - -FILE* CREATE_INF_FILE(LPCSTR path,LPCSTR file) -{ -STRING fn(strlen(path)+1+strlen(file)+1); - strcpy(fn,path); - APPEND_SLASH(fn); - strcat(fn,file); - return fopen(fn,"wt"); -} - -BOOL INSTALLFILE(LPCSTR res,LPCSTR path,LPCSTR file) -{ -STRING temp(MAX_PATH); - if(!GetTempPath(MAX_PATH,temp)) return FALSE; -STRING tf(MAX_PATH); - if(!GetTempFileName(temp,"KGI",0,tf)) return FALSE; -HRSRC hrsrc = FindResource(NULL,res,MAKEINTRESOURCE(RT_RCDATA)); - if(!hrsrc) return FALSE; -DWORD sor = SizeofResource(NULL,hrsrc); - if(!sor) return FALSE; -HGLOBAL hglobal = LoadResource(NULL,hrsrc); - if(!hglobal) return FALSE; -LPVOID lpv = LockResource(hglobal); - if(!lpv) return FALSE; -HANDLE hf = CreateFile(tf,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_TEMPORARY,NULL); - if(!hf) return FALSE; -DWORD written = 0; - if(!WriteFile(hf,lpv,sor,&written,NULL) || written!=sor){ - CloseHandle(hf); - return FALSE; - } - CloseHandle(hf); -STRING toKill(strlen(tf)+1); - strcpy(toKill,tf); - for(int tmp=strlen(tf)-1;tmp>0 && ((tf[tmp])!='\\');tmp--); - if(tf[tmp]=='\\') - tf[tmp++]=0; -STRING nothing(_MAX_PATH); -UINT nothingLength=_MAX_PATH; - if(VerInstallFile(0,&tf[tmp],(LPSTR)file,tf,(LPSTR)path,NULL,nothing,¬hingLength)){ - DeleteFile(toKill); - return FALSE; - } - DeleteFile(toKill); - return TRUE; -} - -LPCSTR pdTitle, pdPrompt; -char pdPath[_MAX_PATH]; -BOOL CALLBACK pathDlgProc(HWND hwnd,UINT uMsg,WPARAM wP,LPARAM lP) -{ - switch(uMsg){ - case WM_INITDIALOG: - SetWindowText(hwnd,pdTitle); - SetDlgItemText(hwnd,IDC_PROMPT,pdPrompt); - SetDlgItemText(hwnd,IDC_PATH,pdPath); - SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); - return 1; - case WM_COMMAND: - switch(LOWORD(wP)){ // ID - case IDC_BROWSE: - switch(HIWORD(wP)){ - case BN_CLICKED: - { - BROWSEINFO bi; - memset(&bi,0,sizeof(bi)); - bi.hwndOwner=hwnd; - bi.pszDisplayName=pdPath; - bi.lpszTitle="Select Folder.."; - bi.ulFlags=BIF_RETURNONLYFSDIRS; - LPITEMIDLIST lpidl=SHBrowseForFolder(&bi); - if(lpidl){ - SHGetPathFromIDList(lpidl,pdPath); - SHFree(lpidl); - SetDlgItemText(hwnd,IDC_PATH,pdPath); - } - } - return 1; - } - break; - case IDOK: - switch(HIWORD(wP)){ - case BN_CLICKED: - if(GetDlgItemText(hwnd,IDC_PATH,pdPath,sizeof(pdPath))) - EndDialog(hwnd,IDOK); - else - // *** Error message - EndDialog(hwnd,IDCANCEL); - return 1; - } - break; - case IDCANCEL: - switch(HIWORD(wP)){ - case BN_CLICKED: - EndDialog(hwnd,IDCANCEL); - return 1; - } - break; - }; - break; - } - return 0; -} - -LPSTR REQUESTPATH(LPCSTR title,LPCSTR prompt,LPCSTR defPath) -{ - pdTitle=title;pdPrompt=prompt; - strcpy(pdPath,defPath); - if(DialogBox(NULL,MAKEINTRESOURCE(IDD_PATH),NULL/*Parent*/,(DLGPROC)&pathDlgProc)!=IDOK) - return NULL; -STRING rv(strlen(pdPath)+1); - strcpy(rv,pdPath); - return rv.Detach(); -} - -HKEY uninstallKey(LPCSTR regKey) { - STRING rk(100+strlen(regKey)+1); - sprintf(rk,"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s",regKey); - HKEY rv = NULL; - DWORD dw; - if(RegCreateKeyEx(HKEY_LOCAL_MACHINE,rk,0,REG_NONE,REG_OPTION_NON_VOLATILE,KEY_READ|KEY_WRITE,NULL,&rv,&dw)!=ERROR_SUCCESS) - return NULL; - return rv; -} - -BOOL REG_UNINSTALL_COMMAND(LPCSTR regKey,LPCSTR dName,LPCSTR iPath,LPCSTR iFile,LPCSTR iSection) -{ - HKEY hKey = uninstallKey(regKey); - if(!hKey) - return FALSE; - BOOL rv=FALSE; - do{ - if(RegSetValueEx(hKey,"DisplayName",0,REG_SZ,(LPBYTE)dName,strlen(dName)+1)!=ERROR_SUCCESS) - break; - STRING us(50+strlen(iPath)+1+strlen(iFile)+strlen(iSection)+1); - strcpy(us,"RunDll32 setupapi.dll,InstallHinfSection "); - strcat(us,iSection); - strcat(us," 132 "); - strcat(us,iPath); - APPEND_SLASH(us); - strcat(us,iFile); - if(RegSetValueEx(hKey,"UninstallString",0,REG_SZ,(LPBYTE)(LPCSTR)us,strlen(us)+1)!=ERROR_SUCCESS) - break; - rv=TRUE; - }while(FALSE); - RegCloseKey(hKey); - return rv; -} -BOOL REG_UNINSTALL_ICON(LPCSTR regKey,LPCSTR path,LPCSTR file,int n) { - HKEY hKey = uninstallKey(regKey); - if(!hKey) - return FALSE; - STRING uis(strlen(path)+1+strlen(file)+7); - strcpy(uis,path); - APPEND_SLASH(uis); - strcat(uis,file); - char tmp[8]; - sprintf(tmp,";%d",n); - strcat(uis,tmp); - BOOL rv = TRUE; - if(RegSetValueEx(hKey,"DisplayIcon",0,REG_SZ,(LPBYTE)(LPCSTR)uis,strlen(uis)+1)!=ERROR_SUCCESS) - rv = FALSE; - RegCloseKey(hKey); - return rv; -} -BOOL REG_UNINSTALL_COMMENT(LPCSTR regKey,LPCSTR comment) { - HKEY hKey = uninstallKey(regKey); - if(!hKey) - return FALSE; - BOOL rv = TRUE; - if(RegSetValueEx(hKey,"lComment",0,REG_SZ,(LPBYTE)comment,strlen(comment)+1)!=ERROR_SUCCESS) - rv = FALSE; - RegCloseKey(hKey); - return rv; -} -BOOL REG_UNINSTALL_VERSION(LPCSTR regKey,LPCSTR version) { - HKEY hKey = uninstallKey(regKey); - if(!hKey) - return FALSE; - BOOL rv = TRUE; - if(RegSetValueEx(hKey,"DisplayVersion",0,REG_SZ,(LPBYTE)version,strlen(version)+1)!=ERROR_SUCCESS) - rv = FALSE; - RegCloseKey(hKey); - return rv; -} -BOOL REG_UNINSTALL_LOCATION(LPCSTR regKey,LPCSTR location) { - HKEY hKey = uninstallKey(regKey); - if(!hKey) - return FALSE; - BOOL rv = TRUE; - if(RegSetValueEx(hKey,"InstallLocation",0,REG_SZ,(LPBYTE)location,strlen(location)+1)!=ERROR_SUCCESS) - rv = FALSE; - RegCloseKey(hKey); - return rv; -} -BOOL REG_UNINSTALL_PUBLISHER(LPCSTR regKey,LPCSTR publisher) { - HKEY hKey = uninstallKey(regKey); - if(!hKey) - return FALSE; - BOOL rv = TRUE; - if(RegSetValueEx(hKey,"Publisher",0,REG_SZ,(LPBYTE)publisher,strlen(publisher)+1)!=ERROR_SUCCESS) - rv = FALSE; - RegCloseKey(hKey); - return rv; -} -BOOL REG_UNINSTALL_URLS(LPCSTR regKey,LPCSTR about,LPCSTR update) { - HKEY hKey = uninstallKey(regKey); - if(!hKey) - return FALSE; - BOOL rv = TRUE; - if(RegSetValueEx(hKey,"URLInfoAbout",0,REG_SZ,(LPBYTE)about,strlen(about)+1)!=ERROR_SUCCESS) - rv = FALSE; - if(RegSetValueEx(hKey,"URLUpdateInfo",0,REG_SZ,(LPBYTE)update,strlen(update)+1)!=ERROR_SUCCESS) - rv = FALSE; - RegCloseKey(hKey); - return rv; -} - -#define INF_FILE_HEADER(i) fprintf(i,"[Version]\nSignature=\"$CHICAGO$\"\n\n") -#define INF_FILE_SECTION(i,s) fprintf(i,"\n[%s]\n",s) -#define INF_UNINSTALL_REG(i,p) fprintf(i,"HKLM,Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s\nHKLM,Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s,DisplayName\nHKLM,Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s,UninstallString\n",p,p,p) -#define INF_MENU_GROUP(i,n,m) fprintf(i,"setup.ini, progman.groups,,\"group%d=%s\"\n",n,m) -#define INF_MENU_ITEM(i,n,m) fprintf(i,"setup.ini, group%d,, \"\"\"%s\"\"\"\n",n,m); -#define INF_REMOVE_ROOT(i,g,r) fprintf(i,"HKLM,Software\\Microsoft\\Windows\\CurrentVersion\\DeleteFiles\\%s,,,\"%s\"\n",g,r) -#define INF_REMOVE_FILE(i,g,f) fprintf(i,"HKLM,Software\\Microsoft\\Windows\\CurrentVersion\\DeleteFiles\\%s,%s,,\"%s\"\n",g,f,f) -#define INF_REMOVE_HELP_FILE(i,g,f) {INF_REMOVE_FILE(i,g,f".hlp");INF_REMOVE_FILE(i,g,f".cnt");INF_REMOVE_FILE(i,g,f".GID");INF_REMOVE_FILE(i,g,f".FTS");} - -LPSTR GET_SHORT_PATH(LPCSTR path) -{ -char tmp; -DWORD len = GetShortPathName(path,&tmp,1); - if(!len) - return NULL; -STRING rv(len+1); - if(!GetShortPathName(path,rv,len+1)) - return NULL; - return rv.Detach(); -} - -BOOL Install(void); - -int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR,int) -{ - theInstance=hInstance; - CoInitialize(NULL); - Install(); - CoUninitialize(); - return 0; -} diff --git a/shared-code/ip_icmp.h b/shared-code/ip_icmp.h deleted file mode 100644 index acaf7e9..0000000 --- a/shared-code/ip_icmp.h +++ b/dev/null @@ -1,91 +0,0 @@ -#ifndef IP_ICMPHEADER - -#define IP_ICMPHEADER - -struct icmp { - BYTE icmp_type; - BYTE icmp_code; - WORD icmp_cksum; - WORD icmp_id; - WORD icmp_seq; - char icmp_data[1]; -}; - -#define SIZE_ICMP_HDR 8 -#define SIZE_TIME_DATA 8 - -struct ip { - BYTE ip_hl:4, /* header length */ - ip_v:4; /* version */ - BYTE ip_tos; /* type of service */ - short ip_len; /* total length */ - u_short ip_id; /* identification */ - short ip_off; /* fragment offset field */ - BYTE ip_ttl; /* time to live */ - BYTE ip_p; /* protocol */ - u_short ip_sum; /* checksum */ - struct in_addr ip_src,ip_dst; /* source and dest address */ -}; - -#define ICMP_ECHOREPLY 0 /* echo reply */ -#define ICMP_UNREACH 3 /* dest unreachable, codes: */ -#define ICMP_UNREACH_NET 0 /* bad net */ -#define ICMP_UNREACH_HOST 1 /* bad host */ -#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */ -#define ICMP_UNREACH_PORT 3 /* bad port */ -#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ -#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ -#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ -#define ICMP_REDIRECT 5 /* shorter route, codes: */ -#define ICMP_REDIRECT_NET 0 /* for network */ -#define ICMP_REDIRECT_HOST 1 /* for host */ -#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ -#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ -#define ICMP_ECHO 8 /* echo service */ -#define ICMP_TIMXCEED 11 /* time exceeded, code: */ -#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ -#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ -#define ICMP_PARAMPROB 12 /* ip header bad */ -#define ICMP_TSTAMP 13 /* timestamp request */ -#define ICMP_TSTAMPREPLY 14 /* timestamp reply */ -#define ICMP_IREQ 15 /* information request */ -#define ICMP_IREQREPLY 16 /* information reply */ -#define ICMP_MASKREQ 17 /* address mask request */ -#define ICMP_MASKREPLY 18 /* address mask reply */ - -#define ICMP_MAXTYPE 18 - -#define ICMP_MINLEN 8 /* abs minimum */ -#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ -#define ICMP_MASKLEN 12 /* address mask */ -#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ -#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) - -#define STNORM 0 - -/* Definition of the lowest telnet byte following an IAC byte */ -#define LOW_TEL_OPT 236 - -#define TEL_EOF 236 -#define SUSP 237 -#define ABORT 238 - -#define SE 240 -#define NOP 241 -#define DM 242 -#define BREAK 243 -#define IP 244 -#define AO 245 -#define AYT 246 -#define EC 247 -#define EL 248 -#define GOAHEAD 249 -#define SB 250 -#define WILL 251 -#define WONT 252 -#define DO 253 -#define DONT 254 -#define IAC 255 - -#endif - diff --git a/shared-code/kHelpers.h b/shared-code/kHelpers.h deleted file mode 100644 index 209c6b0..0000000 --- a/shared-code/kHelpers.h +++ b/dev/null @@ -1,159 +0,0 @@ -#ifndef __KHELPERS_H -#define __KHELPERS_H - -#include - -extern "C" WINSHELLAPI void WINAPI SHFree( LPVOID); - -namespace Klever { - - inline BOOL BrowseForFolder(CString& folder,LPCTSTR title=NULL,CWnd* pParent=NULL) { - BROWSEINFO bi; - memset(&bi,0,sizeof(bi)); - if(pParent) - bi.hwndOwner=pParent->GetSafeHwnd(); - CString rv; - bi.pszDisplayName=rv.GetBuffer(MAX_PATH); - bi.lpszTitle=title; - bi.ulFlags=BIF_RETURNONLYFSDIRS; - LPITEMIDLIST lpidl = SHBrowseForFolder(&bi); - if(lpidl){ - SHGetPathFromIDList(lpidl,bi.pszDisplayName); - SHFree(lpidl); - rv.ReleaseBuffer(); - folder=rv; - return TRUE; - } - rv.ReleaseBuffer(); - return FALSE; - } - inline BOOL BrowseForFolder(CString& folder,UINT idTitle,CWnd* pParent=NULL) { - CString title; - VERIFY(title.LoadString(idTitle)); - return BrowseForFolder(folder,title,pParent); - } - inline CString GluePathAndFile(LPCTSTR path,LPCTSTR file) { - CString rv = path; - while((!rv.IsEmpty()) && rv[rv.GetLength()-1]=='\\') - rv=rv.Left(rv.GetLength()-1); - rv+='\\'; - while(*file && *file=='\\') - file++; - rv+=file; - return rv; - } - inline UINT TokenizeString(CStringList& rv,LPCTSTR string,LPCTSTR delimiter) { - CString s = string; - int found; - int delength = strlen(delimiter); - int rvc = 0; - while((found=s.Find(delimiter))>=0){ - rv.AddTail(s.Left(found)); - rvc++; - s=s.Mid(found+delength); - } - if(!s.IsEmpty()){ - rv.AddTail(s); - rvc++; - } - return rvc; - } - inline BOOL LogRecord(LPCTSTR logFile,LPCTSTR logRecord) { - try{ - CFile f(logFile,CFile::modeCreate|CFile::modeNoTruncate|CFile::modeReadWrite|CFile::shareDenyWrite); - f.SeekToEnd(); - CString s = CTime::GetCurrentTime().Format("[%c] ")+logRecord+"\r\n"; - f.Write((LPCTSTR)s,s.GetLength()); - }catch(CException* e){ - e->Delete(); - return FALSE; - } - return TRUE; - } - inline BOOL ReadString(CFile* file,CString& rv) { - rv.Empty(); - int nBuffer = 256; - TCHAR* ch = rv.GetBuffer(nBuffer); - int nPos = 0; - BOOL bRV = FALSE; - for(;;){ - TCHAR c; - try{ - if(file->Read(&c,sizeof(c))!=sizeof(c)) - break; - bRV=TRUE; - }catch(CException* e){ - e->Delete(); - TRACE0("Exception in ReadString\n"); - return FALSE; - } - if(nPos>=(nBuffer-1)){ - rv.ReleaseBuffer(); - ch = rv.GetBuffer(nBuffer=nBuffer+256); - ASSERT(ch); - } - if(c=='\n') - break; - ch[nPos++]=c; - } - ch[nPos]=0; - for(;;){ - nPos--; - if(nPos<0) - break; - if(ch[nPos]!='\r') - break; - ch[nPos]=0; - } - rv.ReleaseBuffer(); - rv.FreeExtra(); - return bRV; - } - - inline int LoadStringList(CStringList& list,LPCTSTR section) { - CString n; - list.RemoveAll(); - CWinApp* app = AfxGetApp(); - ASSERT(app); - for(int tmp=0;;tmp++){ - n.Format("%d",tmp); - CString str = app->GetProfileString(section,n,NULL); - if(str.IsEmpty()) - break; - list.AddTail(str); - } - return tmp; - } - inline int SaveStringList(CStringList& list,LPCTSTR section) { - CString n; - CWinApp* app = AfxGetApp(); - ASSERT(app); - POSITION p = list.GetHeadPosition(); - for(int tmp=0;p;tmp++){ - n.Format("%d",tmp); - app->WriteProfileString(section,n,list.GetNext(p)); - } - n.Format("%d",tmp); - app->WriteProfileString(section,n,NULL); - return tmp; - } - - inline BOOL WriteProfileString(LPCTSTR section,LPCTSTR entry,LPCTSTR str) { - CWinApp* app = AfxGetApp(); - return app->WriteProfileBinary(section,entry,(LPBYTE)str,strlen(str)+1); - } - inline CString GetProfileString(LPCTSTR section,LPCTSTR entry,LPCTSTR defval) { - CWinApp* app = AfxGetApp(); - LPBYTE pData; - UINT nCount; - CString rv = defval; - if(app->GetProfileBinary(section,entry,&pData,&nCount)){ - rv = (LPCTSTR)pData; - delete pData; - } - return rv; - } - -}; - -#endif // __KHELPERS_H diff --git a/shared-code/kICMP.cpp b/shared-code/kICMP.cpp deleted file mode 100644 index 09a8f94..0000000 --- a/shared-code/kICMP.cpp +++ b/dev/null @@ -1,300 +0,0 @@ -#include "../stdafx.h" -#include "kICMP.h" - -CICMP::_mechanismus CICMP::m_mechanismus = CICMP::_icmpUndetermined; - -BOOL CICMPDll::Initialize() -{ - if(m_hICMP!=INVALID_HANDLE_VALUE || m_hICMPDLL) - Deinitialize(); - m_hICMPDLL = ::LoadLibraryEx("ICMP",NULL,0); - if(!m_hICMPDLL) - return FALSE; - *(FARPROC*)&m_icmpCF = ::GetProcAddress(m_hICMPDLL,"IcmpCreateFile"); - *(FARPROC*)&m_icmpSE = ::GetProcAddress(m_hICMPDLL,"IcmpSendEcho"); - *(FARPROC*)&m_icmpCH = ::GetProcAddress(m_hICMPDLL,"IcmpCloseHandle"); - if(!(m_icmpCF && m_icmpSE && m_icmpCH)){ - Deinitialize(); return FALSE; - } - m_hICMP = (*m_icmpCF)(); - if(m_hICMP==INVALID_HANDLE_VALUE){ - Deinitialize(); return FALSE; - } - TRACE0("ICMP-DLL Initialized\n"); - return TRUE; -} -void CICMPDll::Deinitialize() -{ - if(m_hICMPDLL){ - if(m_hICMP!=INVALID_HANDLE_VALUE && m_icmpCH) - (*m_icmpCH)(m_hICMP); - ::FreeLibrary(m_hICMPDLL); m_hICMPDLL = NULL; - m_icmpCF = NULL; - m_icmpSE = NULL; - m_icmpCH = NULL; - } - m_hICMP=INVALID_HANDLE_VALUE; - if(m_sizeOut && m_bsOut){ - delete m_bsOut; - m_bsOut = NULL; m_sizeOut = 0; - } - if(m_sizeIn && m_bsIn){ - delete m_bsIn; - m_bsIn = NULL; m_sizeIn = 0; - } -} - -LONG CICMPDll::Ping(const in_addr host,const UINT packetSize, - const UINT timeOut,LPINT pStatus) -{ - if(!(m_hICMP && m_hICMPDLL && m_icmpSE)){ - if(pStatus) - (*pStatus) = icmpNotInitialized; - return -1; - } - VERIFY(AdjustBuffers(packetSize)); -IPINFO ipi; - memset(&ipi,0,sizeof(ipi)); - ipi.Ttl = 30; - for(UINT tmp=0;tmpStatus = 0xFFFFFFFFl; - if((*m_icmpSE)(m_hICMP,host.s_addr,m_bsOut,packetSize, - &ipi,pRep,m_sizeIn,timeOut)) - TRACE0("ICMP-SendEcho succeeded\n"); - else - TRACE0("ICMP-SendEcho failed\n"); -LONG lrv = -1; -INT rv = ipUnknown; - switch(pRep->Status){ - case IP_SUCCESS: - lrv = pRep->RTTime; rv = ipSuccess; - break; - case IP_BUF_TOO_SMALL: rv = ipBuffTooSmall; break; - case IP_DEST_NET_UNREACHABLE: rv = ipDestNetUnreachable; break; - case IP_DEST_HOST_UNREACHABLE: rv = ipDestHostUnreachable; break; - case IP_DEST_PROT_UNREACHABLE: rv = ipDestProtUnreachable; break; - case IP_DEST_PORT_UNREACHABLE: rv = ipDestPortUnreachable; break; - case IP_NO_RESOURCES: rv = ipNoResources; break; - case IP_BAD_OPTION: rv = ipBadOption; break; - case IP_HW_ERROR: rv = ipHWError; break; - case IP_PACKET_TOO_BIG: rv = ipPacketTooBig; break; - case IP_REQ_TIMED_OUT: rv = ipTimeOut; break; - case IP_BAD_REQ: rv = ipBadRequest; break; - case IP_BAD_ROUTE: rv = ipBadRoute; break; - case IP_TTL_EXPIRED_TRANSIT: rv = ipTTLExpiredInTransit; break; - case IP_TTL_EXPIRED_REASSEM: rv = ipTTLExpiredInReasm; break; - case IP_PARAM_PROBLEM: rv = ipParamProblem; break; - case IP_SOURCE_QUENCH: rv = ipSourceQuench; break; - case IP_OPTION_TOO_BIG: rv = ipOptionTooBig; break; - case IP_BAD_DESTINATION: rv = ipBadDest; break; - } - if(pStatus) - (*pStatus)=rv; - return lrv; -} - -BOOL CICMPDll::AdjustBuffers(UINT packetSize) -{ - if(!packetSize) - packetSize=1; - if(packetSize>m_sizeOut){ - if(m_sizeOut && m_bsOut) - delete m_bsOut; - m_bsOut = new BYTE[m_sizeOut=packetSize]; - if(!m_bsOut) - return FALSE; - } -UINT sin = sizeof(ICMPECHO)+SIZE_ICMP_HDR+packetSize; - if(sin>m_sizeIn){ - if(m_sizeIn && m_bsIn) - delete m_bsIn; - m_bsIn = new BYTE[m_sizeIn=sin]; - if(!m_bsIn) - return FALSE; - } - return TRUE; -} - - -WORD CICMPWS::m_icmpSeq = 0; - -BOOL CICMPWS::Initialize() -{ - if(m_socket!=INVALID_SOCKET) - Deinitialize(); - m_socket = socket(AF_INET,SOCK_RAW,1/*ICMP*/); - if(m_socket==INVALID_SOCKET) - return FALSE; - TRACE0("ICMP-WS Initialized\n"); - return TRUE; -} -void CICMPWS::Deinitialize() -{ - if(m_socket!=INVALID_SOCKET){ - closesocket(m_socket); - m_socket=INVALID_SOCKET; - } - if(m_sizeOut && m_bsOut){ - delete m_bsOut; - m_bsOut = NULL; m_sizeOut = 0; - } - if(m_sizeIn && m_bsIn){ - delete m_bsIn; - m_bsIn = NULL; m_sizeIn = 0; - } -} -LONG CICMPWS::Ping(const in_addr host,const UINT packetSize, - const UINT timeOut,LPINT pStatus) -{ - if(m_socket==INVALID_SOCKET){ - if(pStatus) - (*pStatus)=icmpNotInitialized; - } - VERIFY(AdjustBuffers(packetSize)); -icmp* pPacket = (icmp*)m_bsOut; - memset(pPacket,0,m_sizeOut); - pPacket->icmp_type = ICMP_ECHO; - pPacket->icmp_seq = m_icmpSeq++; - pPacket->icmp_id = (WORD)(::GetCurrentThreadId()&0xFFFF); - for(UINT tmp=0;tmpicmp_data[tmp]=tmp&0xFF; - pPacket->icmp_cksum = cksum(pPacket,SIZE_ICMP_HDR+packetSize); -sockaddr_in to; - memset(&to,0,sizeof(to)); - to.sin_addr.s_addr = host.s_addr; - to.sin_family = AF_INET; - if(sendto(m_socket,(char*)pPacket,SIZE_ICMP_HDR+packetSize,0, - (SOCKADDR*)&to,sizeof(to)) != (int)(SIZE_ICMP_HDR+packetSize)){ - TRACE1("sendto: %lu\n",WSAGetLastError()); - if(pStatus) - (*pStatus)=icmpSocketError; - return -1; - } -DWORD sentTime = ::GetTickCount(); -sockaddr_in from; - memset(&from,0,sizeof(from)); - from.sin_family=AF_INET; - from.sin_addr.s_addr=INADDR_ANY; -fd_set fds; - FD_ZERO(&fds); - FD_SET(m_socket,&fds); -long lrv = -1; -INT rv = ipTimeOut; - for(;;){ - DWORD ct = ::GetTickCount(); - if((ct-sentTime)>=timeOut){ - TRACE0("Timeout\n"); - break; - } - timeval tv = { - (timeOut-ct+sentTime)/1000, - (timeOut-ct+sentTime)%1000 - }; // tv_sec, tv_usec (secs,microsecs) - if(!select(m_socket,&fds,NULL,NULL,&tv)){ - TRACE1("select: %d\n",WSAGetLastError()); - break; - } - DWORD rtime = ::GetTickCount(); - ASSERT(FD_ISSET(m_socket,&fds)); - int fl = sizeof(from); - int rb = recvfrom(m_socket,(char*)m_bsIn,m_sizeIn,0,(SOCKADDR*)&from,&fl); - ip* pIP = (ip*)m_bsIn; - icmp* pICMP = (icmp*)&m_bsIn[sizeof(ip)]; - if(pICMP->icmp_id!=pPacket->icmp_id) - continue; - if(pICMP->icmp_seq!=pPacket->icmp_seq) - continue; - if(from.sin_addr.s_addr!=host.s_addr) - continue; - if(pICMP->icmp_type==ICMP_ECHOREPLY){ - lrv=rtime-sentTime; - rv=ipSuccess; - break; - } - rv = ipUnknown; // *** - break; - } - if(pStatus) - (*pStatus)=rv; - return lrv; -} - -BOOL CICMPWS::AdjustBuffers(UINT packetSize) -{ - if(!packetSize) - packetSize=0; -UINT osize = packetSize+SIZE_ICMP_HDR; - if(m_sizeOut0){ - if(count>1){ - lSum+=*(pData++); - count-=2; - }else{ - lSum+=((WORD)*(BYTE*)pData)&0xFF; - count--; - } - } - lSum = (lSum&0xFFFF)+(lSum>>16); - lSum += (lSum>>16); - return (~lSum)&0xFFFF; -} - -CICMP* CICMP::CreateICMP() -{ - if(m_mechanismus==_icmpUndetermined) - GuessMechanismus(); - switch(m_mechanismus){ - case _icmpWinsock: - return new CICMPWS; - break; - case _icmpDLL: - return new CICMPDll; - break; - } - return NULL; -} - -void CICMP::GuessMechanismus() -{ - m_mechanismus=_icmpUndetermined; -SOCKET testSocket = socket(AF_INET,SOCK_RAW,1); - if(testSocket!=INVALID_SOCKET){ - closesocket(testSocket); - m_mechanismus=_icmpWinsock; - }else{ - HINSTANCE hICMP = ::LoadLibraryEx("ICMP",NULL,0); - if(!hICMP) - return; - BOOL isThere = ( - ::GetProcAddress(hICMP,"IcmpCreateFile") - && ::GetProcAddress(hICMP,"IcmpSendEcho") - && ::GetProcAddress(hICMP,"IcmpCloseHandle") - ); - ::FreeLibrary(hICMP); - if(isThere) - m_mechanismus=_icmpDLL; - } -} \ No newline at end of file diff --git a/shared-code/kICMP.h b/shared-code/kICMP.h deleted file mode 100644 index 7a5ceaa..0000000 --- a/shared-code/kICMP.h +++ b/dev/null @@ -1,80 +0,0 @@ -#ifndef __KICMP_H -#define __KICMP_H - -class CICMP { - enum _mechanismus { - _icmpUndetermined = -1, - _icmpWinsock = 0, _icmpDLL - }; -static _mechanismus m_mechanismus; -static void GuessMechanismus(); -public: -static - CICMP* CreateICMP(); - - enum { - ipSuccess = 0, - ipBuffTooSmall, ipDestNetUnreachable, ipDestHostUnreachable, - ipDestProtUnreachable, ipDestPortUnreachable, ipNoResources, - ipBadOption, ipHWError, ipPacketTooBig, ipTimeOut, ipBadRequest, - ipBadRoute, ipTTLExpiredInTransit, ipTTLExpiredInReasm, - ipParamProblem, ipSourceQuench, ipOptionTooBig, ipBadDest, - ipUnknown = -1, - icmpNotInitialized = -2, - icmpSocketError = -3 - }; - - virtual BOOL Initialize() = 0; - virtual void Deinitialize() = 0; - - virtual LONG Ping(const in_addr host,const UINT packetSize=0, - const UINT timeOut=10000,LPINT pStatus=NULL) = 0; -}; - -class CICMPDll : public CICMP { - HANDLE (WINAPI *m_icmpCF)(VOID); - BOOL (WINAPI *m_icmpSE)(HANDLE,ULONG,LPVOID,WORD, - PIPINFO,LPVOID,DWORD,DWORD); - BOOL (WINAPI *m_icmpCH)(HANDLE); -public: - HINSTANCE m_hICMPDLL; - HANDLE m_hICMP; - LPBYTE m_bsIn, m_bsOut; - UINT m_sizeIn, m_sizeOut; - - CICMPDll() : m_hICMP(INVALID_HANDLE_VALUE), m_hICMPDLL(NULL), - m_bsIn(NULL), m_bsOut(NULL), m_sizeIn(0), m_sizeOut(0) {} - virtual ~CICMPDll() { Deinitialize(); } - - virtual BOOL Initialize(); - virtual void Deinitialize(); - - virtual LONG Ping(const in_addr host,const UINT packetSize=0, - const UINT timeOut=10000,LPINT pStatus=NULL); - - BOOL AdjustBuffers(UINT packetSize=0); -}; - -class CICMPWS : public CICMP { -static - WORD m_icmpSeq; -public: - SOCKET m_socket; - LPBYTE m_bsIn, m_bsOut; - UINT m_sizeIn, m_sizeOut; - - CICMPWS() : m_socket(INVALID_SOCKET), m_bsIn(NULL), m_bsOut(NULL), - m_sizeIn(0), m_sizeOut(0) {} - virtual ~CICMPWS() { Deinitialize(); } - - virtual BOOL Initialize(); - virtual void Deinitialize(); - - virtual LONG Ping(const in_addr host,const UINT packetSize=0, - const UINT timeOut=10000,LPINT pStatus=NULL); - - BOOL AdjustBuffers(UINT packetSize=0); - WORD cksum(LPVOID data,int count); -}; - -#endif // __KICMP_H \ No newline at end of file diff --git a/shared-code/kinhelp.xsl b/shared-code/kinhelp.xsl deleted file mode 100644 index 0bb384a..0000000 --- a/shared-code/kinhelp.xsl +++ b/dev/null @@ -1,250 +0,0 @@ - - - - - - - {\rtf1\ansi - @{\footnote - THIS FILE WAS AUTOMATICALLY GENERATED FROM XML DOCUMENT. - DO NOT MODIFY THIS FILE DIRECTLY. EDIT XML DOCUMENT INSTEAD - } - - - - } - - - - \pard\plain - - \keepn - - - #{\footnote - - } - - - ${\footnote - - } - - - K{\footnote - - } - - - \page - - - - {#{\footnote - - }} - - - - - - - - - - - - - {\uldb - - }{\v %!ExecFile(" - - ")} - - - {\uldb - - }{\v - - } - - - Warining: Unqualified hyper-reference. Using as help-internal - {\uldb - - }{\v - - } - - - - - - - - \pard - - { \f1\fs18\b\sb120 - - } - - - - \par\sa120\sb120\qj - - \pard - - \f1\fs18\sb120 - - - - - \par\sa120\sb120\qj\f1\fs16 - - - - - \par\sa120\sb120\qr\f1\fs16 - - - - - \{bmct - - \} - - - - \par\pard\plain\f1\fs24\qc\cf2\b - - - - - - - - \par\pard\plain\fi0\li0\f1\fs18 \bullet - - - - - {\b - - } - - - {\i - - } - - - {\ul - - } - - - {\strike - - } - - - - - - - - {\b } - - - - {\b - - } - - - - - - - - - {\b\cf6 } - - - - {\b\cf6 - - } - - - - - {\i - - } - - - - - - - - - - - { - \par\pard\plain\sb360\sa120 \f1\fs16 Copyright (c) - - {\uldb\cf0 Klever Group (http://www.klever.net/)}{\v %!ExecFile("http://www.klever.net/")} - \par\qj\sb120\sa120 - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - \par The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - \par \sa360 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - } - - - \par \sa0\sb120\ql \f1\fs16 Author: {\b\uldb\cf11 Michael Krelin ({\i hacker@klever.net})}{\v %!ExecFile("mailto:hacker@klever.net")} - \par \sa0\sb0 Fan mail send to {\i\uldb gefilte@klever.net}{\v %!ExecFile("mailto:gefilte@klever.net")} - - - - \pard - - \pard - - - - - \par \fi0\li \bullet - - - - - - - - - - - {\colortbl; - \red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0; - \red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255; - \red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128; - \red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;} - - - - {\fonttbl - {\f0\froman Times New Roman;} - {\f1\fswiss Arial;} - {\f3\froman Symbol;} - } - - - diff --git a/shared-code/ms_icmp.h b/shared-code/ms_icmp.h deleted file mode 100644 index 32d97f5..0000000 --- a/shared-code/ms_icmp.h +++ b/dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------------ -* Filename: MS_ICMP.H -* -* Description: Prototypes of Microsoft's ICMP.DLL functions for -* access to Internet Control Message Protocol (their stacks do -* not support the standard Berkeley Sockets raw socket API). -* Use this to do "ping" or "traceroute," although beware that -* Microsoft discourages its use. -*/ - - -/* Note 2: For the most part, you can refer to RFC 791 for detials on -* how to fill in values for the IP option information structure. */ -typedef struct ip_option_information { - u_char Ttl; /* Time To Live (used for traceroute) */ - u_char Tos; /* Type Of Service (usually 0) */ - u_char Flags; /* IP header flags (usually 0) */ - u_char OptionsSize; /* Size of options data (usually 0, max 40) */ - u_char FAR *OptionsData;/* Options data buffer */ -} IPINFO, *PIPINFO, FAR *LPIPINFO; - -/* Note 1: The Reply Buffer will have an array of ICMP_ECHO_REPLY -* structures, followed by options and the data in ICMP echo reply -* datagram received. You must have room for at least one ICMP -* echo reply structure, plus 8 bytes for an ICMP header. */ -typedef struct icmp_echo_reply { - u_long Address; /* source address */ - u_long Status; /* IP status value (see below) */ - u_long RTTime; /* Round Trip Time in milliseconds */ - u_short DataSize; /* reply data size */ - u_short Reserved; /* */ - void FAR *Data; /* reply data buffer */ - typedef struct ip_option_information Options; /* reply options */ -} ICMPECHO, *PICMPECHO, FAR *LPICMPECHO; - -#define IP_STATUS_BASE 11000 -#define IP_SUCCESS 0 -#define IP_BUF_TOO_SMALL (IP_STATUS_BASE + 1) -#define IP_DEST_NET_UNREACHABLE (IP_STATUS_BASE + 2) -#define IP_DEST_HOST_UNREACHABLE (IP_STATUS_BASE + 3) -#define IP_DEST_PROT_UNREACHABLE (IP_STATUS_BASE + 4) -#define IP_DEST_PORT_UNREACHABLE (IP_STATUS_BASE + 5) -#define IP_NO_RESOURCES (IP_STATUS_BASE + 6) -#define IP_BAD_OPTION (IP_STATUS_BASE + 7) -#define IP_HW_ERROR (IP_STATUS_BASE + 8) -#define IP_PACKET_TOO_BIG (IP_STATUS_BASE + 9) -#define IP_REQ_TIMED_OUT (IP_STATUS_BASE + 10) -#define IP_BAD_REQ (IP_STATUS_BASE + 11) -#define IP_BAD_ROUTE (IP_STATUS_BASE + 12) -#define IP_TTL_EXPIRED_TRANSIT (IP_STATUS_BASE + 13) -#define IP_TTL_EXPIRED_REASSEM (IP_STATUS_BASE + 14) -#define IP_PARAM_PROBLEM (IP_STATUS_BASE + 15) -#define IP_SOURCE_QUENCH (IP_STATUS_BASE + 16) -#define IP_OPTION_TOO_BIG (IP_STATUS_BASE + 17) -#define IP_BAD_DESTINATION (IP_STATUS_BASE + 18) -#define IP_ADDR_DELETED (IP_STATUS_BASE + 19) -#define IP_SPEC_MTU_CHANGE (IP_STATUS_BASE + 20) -#define IP_MTU_CHANGE (IP_STATUS_BASE + 21) -#define IP_UNLOAD (IP_STATUS_BASE + 22) -#define IP_GENERAL_FAILURE (IP_STATUS_BASE + 50) -#define MAX_IP_STATUS IP_GENERAL_FAILURE -#define IP_PENDING (IP_STATUS_BASE + 255) - - -HANDLE WINAPI PASCAL IcmpCreateFile(VOID); /* INVALID_HANDLE_VALUE on error */ -BOOL WINAPI PASCAL IcmpCloseHandle(HANDLE IcmpHandle); /* FALSE on error */ -DWORD WINAPI PASCAL IcmpSendEcho( - HANDLE IcmpHandle, /* handle returned from IcmpCreateFile() */ - u_long DestAddress, /* destination IP address (in network order) */ - LPVOID RequestData, /* pointer to buffer to send */ - WORD RequestSize, /* length of data in buffer */ - LPIPINFO RequestOptns, /* see Note 2 below */ - LPVOID ReplyBuffer, /* see Note 1 below */ - DWORD ReplySize, /* length of reply (must allow at least 1 reply) */ - DWORD Timeout /* time in milliseconds to wait for reply */ -); - diff --git a/shared-data/browse-icon.ico b/shared-data/browse-icon.ico deleted file mode 100644 index d2d1b3c..0000000 --- a/shared-data/browse-icon.ico +++ b/dev/null Binary files differ diff --git a/shared-data/install-icon.ico b/shared-data/install-icon.ico deleted file mode 100644 index 23e86a6..0000000 --- a/shared-data/install-icon.ico +++ b/dev/null Binary files differ diff --git a/shared-data/klever-background.bmp b/shared-data/klever-background.bmp deleted file mode 100644 index e4d87ec..0000000 --- a/shared-data/klever-background.bmp +++ b/dev/null Binary files differ diff --git a/shared-data/play-icon.ico b/shared-data/play-icon.ico deleted file mode 100644 index 3d2a11e..0000000 --- a/shared-data/play-icon.ico +++ b/dev/null Binary files differ diff --git a/stdafx.cpp b/stdafx.cpp deleted file mode 100644 index 45b4220..0000000 --- a/stdafx.cpp +++ b/dev/null @@ -1,6 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// PumpKIN.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - diff --git a/stdafx.h b/stdafx.h deleted file mode 100644 index b2d650d..0000000 --- a/stdafx.h +++ b/dev/null @@ -1,27 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#include // MFC core and standard components -#include // MFC extensions -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows 95 Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#include - -#include // MFC socket extensions -#include -// CG: The following line was added by the Windows Multimedia component. -#pragma comment(lib, "winmm.lib") - -enum { - WM_RESOLVED = WM_USER, - WM_TRAYICON -}; - -#include "shared-code/kHelpers.h" -#include "shared-code/BellsNWhistles.h" \ No newline at end of file -- cgit v0.9.0.2