major source structure and module name changes

This commit is contained in:
soochoi
2006-06-07 16:34:19 +00:00
parent 5c75241b4b
commit 1fa6f07e83
651 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("Novell.CASA.DataEngines.GnomeKeyring.dll")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Novell, Inc")]
[assembly: AssemblyProduct("CASA")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.6.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

440
adlib/ad_gk/GnomeKeyring.cs Normal file
View File

@@ -0,0 +1,440 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
using System;
using System.Runtime.InteropServices;
using System.Collections.Specialized;
using System.Collections;
using System.Threading;
using Gtk;
using GLib;
namespace Novell.CASA.DataEngines.GK
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public class KeyringInfo
{
public int lockOnIdle;
public uint lockTimeout;
public uint mTime;
public uint cTime;
public int isLocked;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public class NativeItemInfo
{
public int itemType;
public IntPtr displayName;
public IntPtr secret;
public int mTime;
public int cTime;
public NativeItemInfo()
{
/* The GUI allows 513 as the max number of chars for these items */
displayName = Marshal.AllocHGlobal(512 + 1);
secret = Marshal.AllocHGlobal(512 + 1);
}
~NativeItemInfo()
{
Marshal.FreeHGlobal(displayName);
Marshal.FreeHGlobal(secret);
}
}
public class ItemInfo
{
public string itemType;
public string displayName;
public string secret;
public int mTime;
public int cTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public class NativeAttribute
{
public uint type;
public IntPtr key;
public IntPtr value;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public class Attribute
{
public uint type;
public string key;
public string value;
}
public class GnomeKeyring
{
[DllImport("libad_gk.so")]
public static extern int GetKeyrings(out IntPtr list);
[DllImport("libad_gk.so")]
public static extern int GetKeyringInfo(string name,KeyringInfo info);
[DllImport("libad_gk.so")]
public static extern int GetItems(string keyring,out IntPtr list);
[DllImport("libad_gk.so")]
public static extern int GetItemInfo(string keyring,int itemId, NativeItemInfo info);
[DllImport("libad_gk.so")]
public static extern int GetAttributeList(string keyring,int itemId, out IntPtr attrList);
[DllImport("libad_gk.so")]
public static extern int FreeAttributeList(IntPtr attrList);
[DllImport("libad_gk.so")]
public static extern int SetPassword (string keyring, int itemid, string password);
[DllImport("libad_gk.so")]
public static extern int RemoveItem (string keyring, int itemid);
[DllImport("libad_gk.so")]
public static extern int SetItemAttributes (string keyring, int itemid, IntPtr[] attrs, int length);
[DllImport("libad_gk.so")]
public static extern int CreateItem(string keyringName, int itemType, string displayName, string password, IntPtr[] arrptr, int attrCount);
[DllImport("libad_gk.so")]
public static extern int UnlockRing(string sKeyringName, string sPassword);
[DllImport("libad_gk.so")]
public static extern int LoadGnomeKeyringLibrary();
[DllImport("libad_gk.so")]
public static extern int ReleaseGnomeKeyringLibrary();
public static bool IsGnomeKeyringInstalled()
{
if (0 == LoadGnomeKeyringLibrary())
return true;
else
return false;
}
public static void ReleaseGnomeKeyringLib()
{
ReleaseGnomeKeyringLibrary();
}
public static void AttemptGKUnlock(string sPassword)
{
ArrayList alKeyRings = GKGetKeyrings();
IEnumerator kEtor = alKeyRings.GetEnumerator();
while (kEtor.MoveNext())
{
string sKeyring = (string)(kEtor.Current);
try
{
UnlockGnomeKeyring(sKeyring, sPassword);
}
catch {}
}
}
public static int UnlockGnomeKeyring(string sKeyringName, string sPassword)
{
int rcode = UnlockRing(sKeyringName, sPassword);
return rcode;
}
public static KeyringInfo GKGetKeyringInfo(string name)
{
KeyringInfo info = null;
try
{
info = new KeyringInfo();
int retVal = GetKeyringInfo(name,info);
if( 0 != retVal )
info = null;
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
info = null;
}
return info;
}
public static void PrintKeyringInfo(KeyringInfo info)
{
if( null == info )
return;
try
{
//Console.WriteLine("lockOnIdle = " + info.lockOnIdle);
//Console.WriteLine("lockTimeout = " + info.lockTimeout);
//Console.WriteLine("mTime = " + info.mTime);
//Console.WriteLine("cTime = " + info.cTime);
//Console.WriteLine("isLocked = " + info.isLocked);
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
}
}
public static ItemInfo GKGetItemInfo(string keyring, int itemId)
{
ItemInfo info = null;
try
{
NativeItemInfo nativeItemInfo = new NativeItemInfo();
int retVal = GetItemInfo(keyring, itemId, nativeItemInfo);
if( 0 != retVal )
info = null;
else
{
info = new ItemInfo();
if(nativeItemInfo.itemType == 0)
info.itemType = "Generic Secret";
else if(nativeItemInfo.itemType == 1)
info.itemType = "Network Password";
else if(nativeItemInfo.itemType == 2)
info.itemType = "Note";
else
info.itemType = "No Type"; // need to have a better name
info.displayName = Marshal.PtrToStringAnsi(nativeItemInfo.displayName);
info.secret = Marshal.PtrToStringAnsi(nativeItemInfo.secret);
info.mTime = nativeItemInfo.mTime;
info.cTime = nativeItemInfo.cTime;
}
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
info = null;
}
return info;
}
public static void PrintItemInfo(ItemInfo info)
{
if( null == info )
return;
try
{
//Console.WriteLine("CS : itemType = " + info.itemType);
//Console.WriteLine("CS : displayName = " + info.displayName);
//Console.WriteLine("CS : secret = " + info.secret);
//Console.WriteLine("CS : mTime = " + info.mTime);
//Console.WriteLine("CS : cTime = " + info.cTime);
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
}
}
public static ArrayList GKGetKeyrings()
{
ArrayList retList;
try
{
retList = new ArrayList();
IntPtr list = new IntPtr();
int retVal = GetKeyrings(out list);
if ( 0 != retVal )
retList = null;
GLib.List keyringList = new List(list,typeof(string));
IEnumerator etor = (IEnumerator)(keyringList.GetEnumerator());
string name;
while(etor.MoveNext())
{
name = (string)etor.Current;
retList.Add(name);
}
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
retList = null;
}
return retList;
}
public static ArrayList GKGetItems(string keyring)
{
ArrayList retList = null;
try
{
retList = new ArrayList();
IntPtr list = new IntPtr();
int retVal = GetItems(keyring,out list);
if( 0 != retVal )
retList = null;
GLib.List itemList = new List(list,typeof(int));
IEnumerator etor = (IEnumerator)(itemList.GetEnumerator());
int itemId;
while(etor.MoveNext())
{
itemId = (int)etor.Current;
retList.Add(itemId);
}
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
retList = null;
}
return retList;
}
public static ArrayList GKGetAttributeList(string keyring, int itemId)
{
ArrayList retList = null;
try
{
retList = new ArrayList();
IntPtr list = new IntPtr();
int retVal = GetAttributeList(keyring, itemId,out list);
if( 0 != retVal )
retList = null;
GLib.List attrList = new List(list,typeof(int));
IEnumerator etor = (IEnumerator)(attrList.GetEnumerator());
while(etor.MoveNext())
{
int test = (int)etor.Current;
IntPtr ptr = new IntPtr(test);
NativeAttribute attr = new NativeAttribute();
attr = (NativeAttribute)Marshal.PtrToStructure(ptr,typeof(NativeAttribute));
string key = Marshal.PtrToStringAnsi(attr.key);
string value = Marshal.PtrToStringAnsi(attr.value);
Attribute retAttr = new Attribute();
retAttr.type = attr.type;
retAttr.key = String.Copy(key);
retAttr.value = String.Copy(value);
retList.Add(retAttr);
}
if(retList.Count > 0)
FreeAttributeList(list);
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
retList = null;
}
return retList;
}
public static void PrintAttrList(ArrayList attrList)
{
if( null == attrList )
return;
Attribute attr;
try
{
IEnumerator etor = (IEnumerator)(attrList.GetEnumerator());
while(etor.MoveNext())
{
attr = (Attribute)(etor.Current);
//Console.WriteLine("CS : AttrType = " + attr.type);
//Console.WriteLine("CS : AttrKey = " + attr.key);
//Console.WriteLine("CS : AttrValue = " + attr.value);
}
}
catch(Exception e)
{
//Console.WriteLine(e.ToString());
}
}
public static int SetAttributes(String keyringName, int itemId, NameValueCollection nvc)
{
IntPtr[] arrptr = new IntPtr[nvc.Count];
for(int i=0; i < nvc.Count; i++)
{
string key = nvc.GetKey(i);
string value = nvc.Get(key);
Attribute attr = new Attribute();
attr.type=0;
attr.key=key;
attr.value=value;
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(attr));
Marshal.StructureToPtr(attr,ptr,false);
arrptr[i] = ptr;
}
int ret = SetItemAttributes( keyringName,itemId,arrptr,nvc.Count);
FreeIntPtrArray(arrptr);
return ret;
}
public static int RemoveSecret(string keyringname, int itemid)
{
return(RemoveItem(keyringname,itemid));
}
public static int CreateSecret(String keyringName, string strItemType, string displayName, string password, NameValueCollection nvc)
{
//Console.WriteLine("In CreateSecret ");
int itemType = 3; //No Type
IntPtr[] arrptr = new IntPtr[nvc.Count];
if(strItemType.CompareTo("Generic Secret") == 0 )
{
itemType = 0;
}
else
if(strItemType.CompareTo("Network Password") == 0 )
{
itemType = 1;
}
else
if(strItemType.CompareTo("Note") == 0 )
{
itemType = 2;
}
//Console.WriteLine("In CreateSecret ItemType = "+itemType);
for(int i=0; i < nvc.Count; i++)
{
string key = nvc.GetKey(i);
//Console.WriteLine("In CreateSecret Key "+i + " = " + key);
string value = nvc.Get(key);
//Console.WriteLine("In CreateSecret Value "+i + " = " + value);
Attribute attr = new Attribute();
attr.type=0;
attr.key=key;
attr.value=value;
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(attr));
Marshal.StructureToPtr(attr,ptr,false);
arrptr[i] = ptr;
}
//Console.WriteLine("Calling Create item ");
int ret = CreateItem(keyringName, itemType, displayName, password, arrptr, nvc.Count);
FreeIntPtrArray(arrptr);
return ret;
}
public static void FreeIntPtrArray(IntPtr[] arrptr)
{
for(int i=0; i < arrptr.Length; i++)
{
Marshal.FreeHGlobal(arrptr[i]);
}
}
}
}

105
adlib/ad_gk/Makefile.am Normal file
View File

@@ -0,0 +1,105 @@
#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#######################################################################
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
CS_EXTRA_FLAGS = $(CSCFLAGS_DEBUG)
else
TARGET_CFG = Release
endif
SUBDIRS = native
DIST_SUBDIRS = native
EXTRA_DIST = $(CSFILES)
CASAROOT = ../..
CASALIBDIR = $(CASAROOT)/$(LIB)
# handle Mono secondary dependencies
export MONO_PATH := $(MONO_PATH)
PLATFORMINDEPENDENTSOURCEDIR =
PLATFORMDEPENDENTSOURCEDIR = .
MODULE_NAME =Novell.CASA.DataEngines.GnomeKeyring
MODULE_EXT =dll
CSFILES = $(srcdir)/GnomeKeyring.cs
CSFILES_CSC := $(subst /,$(SEP),$(CSFILES))
CS_FLAGS = $(CSC_LIBFLAG) /target:library -pkg:gtk-sharp
CS_RESOURCES =
CS_LIBS =
CS_LIBPATH =
OBJDIR = ./$(TARGET_CFG)/$(LIB)
#OBJS = $(addprefix $(OBJDIR)/, $(CSFILES:%.dll=%.cs))
CUR_DIR := $(shell pwd)
all: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
#
# Pattern based rules.
#
vpath %.c $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
vpath %.cpp $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
vpath %.cs $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(CSFILES)
$(CSC) $(CS_FLAGS) $(CS_EXTRA_FLAGS) -out:$@ $(CSFILES_CSC)
cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
#$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(OBJS)
# @echo [======== Linking $@ ========]
# $(LINK) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
# cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
$(OBJDIR):
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
[ -d $(CASALIBDIR) ] || mkdir -p $(CASALIBDIR)
[ -d $(CASALIBDIR)/$(TARGET_CFG) ] || mkdir -p $(CASALIBDIR)/$(TARGET_CFG)
install-exec-local: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(DESTDIR)$(libdir)/
uninstall-local:
cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
rmdir $(DESTDIR)$(libdir)
#installcheck-local: install
# $(mkinstalldirs) $(DESTDIR)$(libdir)
# $(INSTALL_PROGRAM) $(DESTDIR)$(libdir)
# cd $(DESTDIR)$(libdir); $(MONO)
clean-local:
if [ -d $(TARGET_CFG) ]; then rm -rf $(TARGET_CFG); fi
distclean-local:
maintainer-clean-local:
rm -f Makefile.in

View File

@@ -0,0 +1,129 @@
#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#######################################################################
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
else
TARGET_CFG = Release
endif
SUBDIRS =
DIST_SUBDIRS =
EXTRA_DIST = $(CFILES) *.h
CASAROOT = ../../..
CASALIBDIR = $(CASAROOT)/$(LIB)
BUILD_VER = 1.1.1
# handle Mono secondary dependencies
export MONO_PATH := $(MONO_PATH)
PLATFORMINDEPENDENTSOURCEDIR =
PLATFORMDEPENDENTSOURCEDIR = .
MODULE_NAME = libad_gk
MODULE_EXT = so
CFILES = $(srcdir)/ad_gk.c
LIBDIR = $(LIB)
CSFILES_CSC :=
INCLUDES = -I. -I.. -I$(CASAROOT)/include \
-I/opt/gnome/include/gnome-keyring-1 \
-I/opt/gnome/include/glib-2.0 \
-I/opt/gnome/$(LIBDIR)/glib-2.0/include \
-L/opt/gnome/$(LIBDIR) -lglib-2.0
RESOURCES =
EXTRA_CFLAGS =
CFLAGS += $(INCLUDES) $(DEFINES)
LIBS = -lpthread -ldl
LDFLAGS = -fno-exceptions -fno-check-new -Wl,-Bsymbolic -shared -pthread -O2 \
-Wl,-rpath -Wl,/usr/$(LIBDIR) -Wl,-soname -Wl,libad_gk.so.1
EXTRA_LDFLAGS = -L/opt/gnome/$(LIBDIR) -lglib-2.0 -L/$(CASAROOT)/$(LIBDIR)
OBJDIR = ./$(TARGET_CFG)/$(LIBDIR)
OBJS = $(addprefix $(OBJDIR)/, $(CFILES:%.c=%.o))
EXTRA_DIST = $(CFILES) *.h
CUR_DIR := $(shell pwd)
all: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER)
#
# Pattern based rules.
#
vpath %.c $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
vpath %.cpp $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
$(OBJDIR)/%.o: %.c
$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
$(OBJDIR)/%.o: %.cpp
$(CC) -c $(CFLAGS) -o $@ $<
#$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(OBJS)
# @echo [======== Linking $@ ========]
# $(LINK) -o $@ $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(LIBS)
# cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER): $(OBJDIR) $(OBJS)
@echo [======== Linking $@ ========]
c++ -o $@ $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(LIBS)
cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER)
ln -sf $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).1
$(OBJDIR):
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
[ -d $(CASALIBDIR) ] || mkdir -p $(CASALIBDIR)
[ -d $(CASALIBDIR)/$(TARGET_CFG) ] || mkdir -p $(CASALIBDIR)/$(TARGET_CFG)
install-exec-local: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(DESTDIR)$(libdir)/
uninstall-local:
cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
rmdir $(DESTDIR)$(libdir)
#installcheck-local: install
# $(mkinstalldirs) $(DESTDIR)$(libdir)
# $(INSTALL_PROGRAM) $(DESTDIR)$(libdir)
# cd $(DESTDIR)$(libdir); $(MONO)
clean-local:
if [ -d $(TARGET_CFG) ]; then rm -rf $(TARGET_CFG); fi
distclean-local:
maintainer-clean-local:
rm -f Makefile.in

1029
adlib/ad_gk/native/ad_gk.c Normal file

File diff suppressed because it is too large Load Diff

133
adlib/ad_gk/native/ad_gk.h Normal file
View File

@@ -0,0 +1,133 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
#ifndef _AD_GK_H_
#define _AD_GK_H_
#include <stdio.h>
#include <stdint.h>
#include <glib.h>
#include <casa-gnome-keyring.h>
#include <string.h>
#define SUCCESS 0
#define FAILURE -1
#define KEY_SIZE 128
#define VAL_SIZE 128
enum KeyringResultExtended { GNOME_KEYRING_RESULT_NO_SUCH_ITEM = 128,
GNOME_KEYRING_RESULT_CANNOT_DELETE_SECRET_VALUE,
GNOME_KEYRING_RESULT_MALFORMED_XML,
GNOME_KEYRING_RESULT_CANNOT_CREATE_KEYRING
};
typedef struct _KeyringInfo
{
int32_t lockOnIdle;
uint32_t lockTimeout;
uint32_t mTime;
uint32_t cTime;
int32_t isLocked;
}KeyringInfo;
typedef struct _ItemInfo
{
int32_t itemType;
char *displayName;
char *secret;
uint32_t mTime;
uint32_t cTime;
}ItemInfo;
typedef struct _Attribute
{
uint32_t type;
char *key;
char *value;
}Attribute;
int GetKeyrings(GList **retList);
int GetKeyringInfo(char *keyring,KeyringInfo *info);
int GetItems(char *keyring, GList **itemList);
int GetItemInfo(char *keyring, int itemId, ItemInfo *info);
int GetAttributeList(char *keyring, int itemId, GList **);
int FreeAttributeList(GList *attrList);
int LoadGnomeKeyringLibrary();
int ReleaseGnomeKeyringLibrary();
int
UnlockRing(char *keyring, char *password);
int
SetItemAttributes (char *keyring, guint32 item_id, Attribute **attrs, int length);
int
CreateItem(char *keyring, int32_t itemType, char *display_name, char *secret, Attribute **attrs, int attrcnt);
int
RemoveItem (char *keyring, guint32 itemid);
int
SetPassword (char *keyring, guint32 itemid, char *secret);
typedef struct _GetKeyringsCbData
{
GList **keyringList;
GMainLoop *loop;
}GetKeyringsCbData;
typedef struct _GetKeyringInfoCbData
{
KeyringInfo *info;
GMainLoop *loop;
}GetKeyringInfoCbData;
typedef struct _GetItemsCbData
{
GList **itemList;
GMainLoop *loop;
}GetItemsCbData;
typedef struct _GetItemInfoCbData
{
ItemInfo *info;
GMainLoop *loop;
}GetItemInfoCbData;
typedef struct _GetAttributeListCbData
{
GList **attrList;
GMainLoop *loop;
}GetAttributeListCbData;
typedef struct _OperationCompleted
{
char *OperationName;
GnomeKeyringResult result;
}OperationCompleted;
#endif

View File

@@ -0,0 +1,729 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
#ifndef _CASA_GNOME_KEYRING_H
#define _CASA_GNOME_KEYRING_H
#include <glib.h>
#include <time.h>
typedef enum
{
CASA_GNOME_KEYRING_RESULT_OK,
CASA_GNOME_KEYRING_RESULT_DENIED,
CASA_GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON,
CASA_GNOME_KEYRING_RESULT_ALREADY_UNLOCKED,
CASA_GNOME_KEYRING_RESULT_NO_SUCH_KEYRING,
CASA_GNOME_KEYRING_RESULT_BAD_ARGUMENTS,
CASA_GNOME_KEYRING_RESULT_IO_ERROR,
CASA_GNOME_KEYRING_RESULT_CANCELLED,
CASA_GNOME_KEYRING_RESULT_ALREADY_EXISTS
} CASA_GnomeKeyringResult_T;
#define GNOME_KEYRING_RESULT_OK CASA_GNOME_KEYRING_RESULT_OK
#define GNOME_KEYRING_RESULT_DENIED CASA_GNOME_KEYRING_RESULT_DENIED
#define GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON CASA_GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON
#define GNOME_KEYRING_RESULT_ALREADY_UNLOCKED CASA_GNOME_KEYRING_RESULT_ALREADY_UNLOCKED
#define GNOME_KEYRING_RESULT_NO_SUCH_KEYRING CASA_GNOME_KEYRING_RESULT_NO_SUCH_KEYRING
#define GNOME_KEYRING_RESULT_BAD_ARGUMENTS CASA_GNOME_KEYRING_RESULT_BAD_ARGUMENTS
#define GNOME_KEYRING_RESULT_IO_ERROR CASA_GNOME_KEYRING_RESULT_IO_ERROR
#define GNOME_KEYRING_RESULT_CANCELLED CASA_GNOME_KEYRING_RESULT_CANCELLED
#define GNOME_KEYRING_RESULT_ALREADY_EXISTS CASA_GNOME_KEYRING_RESULT_ALREADY_EXISTS
#define GnomeKeyringResult CASA_GnomeKeyringResult_T
typedef enum
{
CASA_GNOME_KEYRING_ITEM_GENERIC_SECRET,
CASA_GNOME_KEYRING_ITEM_NETWORK_PASSWORD,
CASA_GNOME_KEYRING_ITEM_NOTE,
CASA_GNOME_KEYRING_ITEM_LAST_TYPE,
CASA_GNOME_KEYRING_ITEM_NO_TYPE = 0xffffffff,
} CASA_GnomeKeyringItemType_T;
#define GNOME_KEYRING_ITEM_GENERIC_SECRET CASA_GNOME_KEYRING_ITEM_GENERIC_SECRET
#define GNOME_KEYRING_ITEM_NETWORK_PASSWORD CASA_GNOME_KEYRING_ITEM_NETWORK_PASSWORD
#define GNOME_KEYRING_ITEM_NOTE CASA_GNOME_KEYRING_ITEM_NOTE
#define GNOME_KEYRING_ITEM_LAST_TYPE CASA_GNOME_KEYRING_ITEM_LAST_TYPE
#define GNOME_KEYRING_ITEM_NO_TYPE CASA_GNOME_KEYRING_ITEM_NO_TYPE
#define GnomeKeyringItemType CASA_GnomeKeyringItemType_T
typedef enum
{
CASA_GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
CASA_GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32
} CASA_GnomeKeyringAttributeType_T;
#define GNOME_KEYRING_ATTRIBUTE_TYPE_STRING CASA_GNOME_KEYRING_ATTRIBUTE_TYPE_STRING
#define GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 CASA_GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32
#define GnomeKeyringAttributeType CASA_GnomeKeyringAttributeType_T
typedef struct GnomeKeyringAccessControl CASA_GnomeKeyringAccessControl_T;
typedef struct GnomeKeyringApplicationRef CASA_GnomeKeyringApplicationRef_T;
typedef GArray CASA_GnomeKeyringAttributeList_T;
#define GnomeKeyringAccessControl CASA_GnomeKeyringAccessControl_T
#define GnomeKeyringApplicationRef CASA_GnomeKeyringApplicationRef_T
#define GnomeKeyringAttributeList CASA_GnomeKeyringAttributeList_T
typedef enum
{
CASA_GNOME_KEYRING_ACCESS_READ = 1<<0,
CASA_GNOME_KEYRING_ACCESS_WRITE = 1<<1,
CASA_GNOME_KEYRING_ACCESS_REMOVE = 1<<2
} CASA_GnomeKeyringAccessType_T;
#define GNOME_KEYRING_ACCESS_READ CASA_GNOME_KEYRING_ACCESS_READ
#define GNOME_KEYRING_ACCESS_WRITE CASA_GNOME_KEYRING_ACCESS_WRITE
#define GNOME_KEYRING_ACCESS_REMOVE CASA_GNOME_KEYRING_ACCESS_REMOVE
#define GnomeKeyringAccessType CASA_GnomeKeyringAccessType_T
typedef struct GnomeKeyringInfo CASA_GnomeKeyringInfo_T;
typedef struct GnomeKeyringItemInfo CASA_GnomeKeyringItemInfo_T;
#define GnomeKeyringInfo CASA_GnomeKeyringInfo_T
#define GnomeKeyringItemInfo CASA_GnomeKeyringItemInfo_T
typedef struct
{
char *name;
CASA_GnomeKeyringAttributeType_T type;
union
{
char *string;
guint32 integer;
} value;
} CASA_GnomeKeyringAttribute_T;
#define GnomeKeyringAttribute CASA_GnomeKeyringAttribute_T
typedef struct
{
char *keyring;
guint item_id;
CASA_GnomeKeyringAttributeList_T *attributes;
char *secret;
} CASA_GnomeKeyringFound_T;
#define GnomeKeyringFound CASA_GnomeKeyringFound_T
typedef void (*CASA_GnomeKeyringOperationDoneCallback_T)
(
CASA_GnomeKeyringResult_T result,
gpointer data
);
#define GnomeKeyringOperationDoneCallback CASA_GnomeKeyringOperationDoneCallback_T
typedef void (*CASA_GnomeKeyringOperationGetStringCallback_T)
(
CASA_GnomeKeyringResult_T result,
const char *string,
gpointer data
);
#define GnomeKeyringOperationGetStringCallback CASA_GnomeKeyringOperationGetStringCallback_T
typedef void (*CASA_GnomeKeyringOperationGetIntCallback_T)
(
CASA_GnomeKeyringResult_T result,
guint32 val,
gpointer data
);
#define GnomeKeyringOperationGetIntCallback CASA_GnomeKeyringOperationGetIntCallback_T
typedef void (*CASA_GnomeKeyringOperationGetListCallback_T)
(
CASA_GnomeKeyringResult_T result,
GList *list,
gpointer data
);
#define GnomeKeyringOperationGetListCallback CASA_GnomeKeyringOperationGetListCallback_T
typedef void (*CASA_GnomeKeyringOperationGetKeyringInfoCallback_T)
(
CASA_GnomeKeyringResult_T result,
CASA_GnomeKeyringInfo_T *info,
gpointer data
);
#define GnomeKeyringOperationGetKeyringInfoCallback CASA_GnomeKeyringOperationGetKeyringInfoCallback_T
typedef void (*CASA_GnomeKeyringOperationGetItemInfoCallback_T)
(
CASA_GnomeKeyringResult_T result,
CASA_GnomeKeyringItemInfo_T*info,
gpointer data
);
#define GnomeKeyringOperationGetItemInfoCallback CASA_GnomeKeyringOperationGetItemInfoCallback_T
typedef void (*CASA_GnomeKeyringOperationGetAttributesCallback_T)
(
CASA_GnomeKeyringResult_T result,
CASA_GnomeKeyringAttributeList_T *attributes,
gpointer data
);
#define GnomeKeyringOperationGetAttributesCallback CASA_GnomeKeyringOperationGetAttributesCallback_T
#define CASA_gnome_keyring_attribute_list_index(a, i) g_array_index ((a), GnomeKeyringAttribute, (i))
#define gnome_keyring_attribute_list_index CASA_gnome_keyring_attribute_list_index
#define CASA_gnome_keyring_attribute_list_new() (g_array_new (FALSE, FALSE, sizeof (GnomeKeyringAttribute)))
#define gnome_keyring_attribute_list_new CASA_gnome_keyring_attribute_list_new
void CASA_gnome_keyring_attribute_list_append_string
(
CASA_GnomeKeyringAttributeList_T *attributes,
const char *attribute,
const char *value
);
#define gnome_keyring_attribute_list_append_string CASA_gnome_keyring_attribute_list_append_string
void CASA_gnome_keyring_attribute_list_append_uint32
(
CASA_GnomeKeyringAttributeList_T *attributes,
const char *attribute,
guint32 value
);
#define gnome_keyring_attribute_list_append_uint32 CASA_gnome_keyring_attribute_list_append_uint32
GnomeKeyringAttributeList *CASA_gnome_keyring_attribute_list_copy
(
CASA_GnomeKeyringAttributeList_T *attributes
);
#define gnome_keyring_attribute_list_copy CASA_gnome_keyring_attribute_list_copy
gboolean CASA_gnome_keyring_is_available (void);
#define gnome_keyring_is_available CASA_gnome_keyring_is_available
void CASA_gnome_keyring_free_password (char *password);
#define gnome_keyring_free_password CASA_gnome_keyring_free_password
void CASA_gnome_keyring_found_free (CASA_GnomeKeyringFound_T *found);
#define gnome_keyring_found_free CASA_gnome_keyring_found_free
void CASA_gnome_keyring_found_list_free (GList *found_list);
#define gnome_keyring_found_list_free CASA_gnome_keyring_found_list_free
void CASA_gnome_keyring_cancel_request (gpointer request);
#define gnome_keyring_cancel_request CASA_gnome_keyring_cancel_request
gpointer CASA_gnome_keyring_set_default_keyring
(
const char *keyring,
CASA_GnomeKeyringOperationDoneCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_set_default_keyring CASA_gnome_keyring_set_default_keyring
CASA_GnomeKeyringResult_T CASA_gnome_keyring_set_default_keyring_sync
(
const char *keyring
);
#define gnome_keyring_set_default_keyring_sync CASA_gnome_keyring_set_default_keyring_sync
gpointer CASA_gnome_keyring_get_default_keyring
(
CASA_GnomeKeyringOperationGetStringCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_get_default_keyring CASA_gnome_keyring_get_default_keyring
CASA_GnomeKeyringResult_T CASA_gnome_keyring_get_default_keyring_sync
(
char **keyring
);
#define gnome_keyring_get_default_keyring_sync CASA_gnome_keyring_get_default_keyring_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_list_keyring_names_sync
(
GList **keyrings
);
#define gnome_keyring_list_keyring_names_sync CASA_gnome_keyring_list_keyring_names_sync
gpointer CASA_gnome_keyring_lock_all
(
CASA_GnomeKeyringOperationDoneCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_lock_all CASA_gnome_keyring_lock_all
CASA_GnomeKeyringResult_T CASA_gnome_keyring_lock_all_sync(void);
#define gnome_keyring_lock_all_sync CASA_gnome_keyring_lock_all_sync
/* NULL password means ask user */
CASA_GnomeKeyringResult_T CASA_gnome_keyring_create_sync
(
const char *keyring_name,
const char *password
);
#define gnome_keyring_create_sync CASA_gnome_keyring_create_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_unlock_sync
(
const char *keyring,
const char *password
);
#define gnome_keyring_unlock_sync CASA_gnome_keyring_unlock_sync
gpointer CASA_gnome_keyring_lock
(
const char *keyring,
CASA_GnomeKeyringOperationDoneCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_lock CASA_gnome_keyring_lock
CASA_GnomeKeyringResult_T CASA_gnome_keyring_lock_sync
(
const char *keyring
);
#define gnome_keyring_lock_sync CASA_gnome_keyring_lock_sync
gpointer CASA_gnome_keyring_delete
(
const char *keyring,
CASA_GnomeKeyringOperationDoneCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_delete CASA_gnome_keyring_delete
CASA_GnomeKeyringResult_T CASA_gnome_keyring_delete_sync
(
const char *keyring
);
#define gnome_keyring_delete_sync CASA_gnome_keyring_delete_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_get_info_sync
(
const char *keyring,
CASA_GnomeKeyringInfo_T **info
);
#define gnome_keyring_get_info_sync CASA_gnome_keyring_get_info_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_set_info_sync
(
const char *keyring,
GnomeKeyringInfo *info
);
#define gnome_keyring_set_info_sync CASA_gnome_keyring_set_info_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_list_item_ids_sync
(
const char *keyring,
GList **ids
);
#define gnome_keyring_list_item_ids_sync CASA_gnome_keyring_list_item_ids_sync
void CASA_gnome_keyring_info_free
(
CASA_GnomeKeyringInfo_T *keyring_info
);
#define gnome_keyring_info_free CASA_gnome_keyring_info_free
CASA_GnomeKeyringInfo_T *CASA_gnome_keyring_info_copy
(
CASA_GnomeKeyringInfo_T *keyring_info
);
#define gnome_keyring_info_copy CASA_gnome_keyring_info_copy
void CASA_gnome_keyring_info_set_lock_on_idle
(
GnomeKeyringInfo *keyring_info,
gboolean value
);
gpointer CASA_gnome_keyring_find_items
(
CASA_GnomeKeyringItemType_T type,
CASA_GnomeKeyringAttributeList_T *attributes,
CASA_GnomeKeyringOperationGetListCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_find_items CASA_gnome_keyring_find_items
gpointer CASA_gnome_keyring_find_itemsv
(
CASA_GnomeKeyringItemType_T type,
CASA_GnomeKeyringOperationGetListCallback_T callback,
gpointer data,
GDestroyNotify destroy_data,
...
);
#define gnome_keyring_find_itemsv CASA_gnome_keyring_find_itemsv
CASA_GnomeKeyringResult_T CASA_gnome_keyring_find_items_sync
(
CASA_GnomeKeyringItemType_T type,
CASA_GnomeKeyringAttributeList_T *attributes,
GList **found
);
#define gnome_keyring_find_items_sync CASA_gnome_keyring_find_items_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_find_itemsv_sync
(
CASA_GnomeKeyringItemType_T type,
GList **found,
...
);
#define gnome_keyring_find_itemsv_sync CASA_gnome_keyring_find_itemsv_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_create_sync
(
const char *keyring,
CASA_GnomeKeyringItemType_T type,
const char *display_name,
CASA_GnomeKeyringAttributeList_T *attributes,
const char *secret,
gboolean update_if_exists,
guint32 *item_id
);
#define gnome_keyring_item_create_sync CASA_gnome_keyring_item_create_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_delete_sync
(
const char *keyring,
guint32 id
);
#define gnome_keyring_item_delete_sync CASA_gnome_keyring_item_delete_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_get_info_sync
(
const char *keyring,
guint32 id,
CASA_GnomeKeyringItemInfo_T **info
);
#define gnome_keyring_item_get_info_sync CASA_gnome_keyring_item_get_info_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_set_info_sync
(
const char *keyring,
guint32 id,
CASA_GnomeKeyringItemInfo_T *info
);
#define gnome_keyring_item_set_info_sync CASA_gnome_keyring_item_set_info_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_get_attributes_sync
(
const char *keyring,
guint32 id,
CASA_GnomeKeyringAttributeList_T **attributes
);
#define gnome_keyring_item_get_attributes_sync CASA_gnome_keyring_item_get_attributes_sync
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_set_attributes_sync
(
const char *keyring,
guint32 id,
CASA_GnomeKeyringAttributeList_T *attributes
);
#define gnome_keyring_item_set_attributes_sync CASA_gnome_keyring_item_set_attributes_sync
gpointer CASA_gnome_keyring_item_get_acl
(
const char *keyring,
guint32 id,
CASA_GnomeKeyringOperationGetListCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_item_get_acl CASA_gnome_keyring_item_get_acl
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_get_acl_sync
(
const char *keyring,
guint32 id,
GList **acl
);
#define gnome_keyring_item_get_acl_sync CASA_gnome_keyring_item_get_acl_sync
gpointer CASA_gnome_keyring_item_set_acl
(
const char *keyring,
guint32 id,
GList *acl,
CASA_GnomeKeyringOperationDoneCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_item_set_acl CASA_gnome_keyring_item_set_acl
CASA_GnomeKeyringResult_T CASA_gnome_keyring_item_set_acl_sync
(
const char *keyring,
guint32 id,
GList *acl
);
#define gnome_keyring_item_set_acl_sync CASA_gnome_keyring_item_set_acl_sync
CASA_GnomeKeyringItemInfo_T *CASA_gnome_keyring_item_info_copy (CASA_GnomeKeyringItemInfo_T *item_info);
#define gnome_keyring_item_info_copy CASA_gnome_keyring_item_info_copy
void CASA_gnome_keyring_item_info_set_type
(
CASA_GnomeKeyringItemInfo_T *item_info,
CASA_GnomeKeyringItemType_T type
);
#define gnome_keyring_item_info_set_type CASA_gnome_keyring_item_info_set_type
void CASA_gnome_keyring_item_info_set_display_name
(
CASA_GnomeKeyringItemInfo_T *item_info,
const char *value
);
#define gnome_keyring_item_info_set_display_name CASA_gnome_keyring_item_info_set_display_name
CASA_GnomeKeyringApplicationRef_T *CASA_gnome_keyring_application_ref_new (void);
#define gnome_keyring_application_ref_new CASA_gnome_keyring_application_ref_new
CASA_GnomeKeyringApplicationRef_T *CASA_gnome_keyring_application_ref_copy (const CASA_GnomeKeyringApplicationRef_T *app);
#define gnome_keyring_application_ref_copy CASA_gnome_keyring_application_ref_copy
void CASA_gnome_keyring_application_ref_free (CASA_GnomeKeyringApplicationRef_T *app);
#define gnome_keyring_application_ref_free CASA_gnome_keyring_application_ref_free
CASA_GnomeKeyringAccessControl_T *CASA_gnome_keyring_access_control_new
(
const CASA_GnomeKeyringApplicationRef_T *application,
CASA_GnomeKeyringAccessType_T types_allowed
);
#define gnome_keyring_access_control_new CASA_gnome_keyring_access_control_new
CASA_GnomeKeyringAccessControl_T *CASA_gnome_keyring_access_control_copy (GnomeKeyringAccessControl *ac);
#define gnome_keyring_access_control_copy CASA_gnome_keyring_access_control_copy
void CASA_gnome_keyring_access_control_free (CASA_GnomeKeyringAccessControl_T *ac);
#define gnome_keyring_access_control_free CASA_gnome_keyring_access_control_free
GList * CASA_gnome_keyring_acl_copy (GList *list);
#define gnome_keyring_acl_copy CASA_gnome_keyring_acl_copy
void CASA_gnome_keyring_acl_free (GList *acl);
#define gnome_keyring_acl_free CASA_gnome_keyring_acl_free
char *CASA_gnome_keyring_item_ac_get_display_name (CASA_GnomeKeyringAccessControl_T *ac);
#define gnome_keyring_item_ac_get_display_name CASA_gnome_keyring_item_ac_get_display_name
void CASA_gnome_keyring_item_ac_set_display_name
(
CASA_GnomeKeyringAccessControl_T *ac,
const char *value
);
#define gnome_keyring_item_ac_set_display_name CASA_gnome_keyring_item_ac_set_display_name
char *CASA_gnome_keyring_item_ac_get_path_name (CASA_GnomeKeyringAccessControl_T *ac);
#define gnome_keyring_item_ac_get_path_name CASA_gnome_keyring_item_ac_get_path_name
void CASA_gnome_keyring_item_ac_set_path_name
(
CASA_GnomeKeyringAccessControl_T *ac,
const char *value
);
#define gnome_keyring_item_ac_set_path_name CASA_gnome_keyring_item_ac_set_path_name
CASA_GnomeKeyringAccessType_T CASA_gnome_keyring_item_ac_get_access_type (CASA_GnomeKeyringAccessControl_T *ac);
#define gnome_keyring_item_ac_get_access_type CASA_gnome_keyring_item_ac_get_access_type
void CASA_gnome_keyring_item_ac_set_access_type
(
CASA_GnomeKeyringAccessControl_T *ac,
const CASA_GnomeKeyringAccessType_T value
);
#define gnome_keyring_item_ac_set_access_type CASA_gnome_keyring_item_ac_set_access_type
/* Specialized Helpers for network passwords items */
typedef struct
{
char *keyring;
guint32 item_id;
char *protocol;
char *server;
char *object;
char *authtype;
guint32 port;
char *user;
char *domain;
char *password;
} CASA_GnomeKeyringNetworkPasswordData_T;
#define GnomeKeyringNetworkPasswordData CASA_GnomeKeyringNetworkPasswordData_T
void CASA_gnome_keyring_network_password_free (CASA_GnomeKeyringNetworkPasswordData_T *data);
#define gnome_keyring_network_password_free CASA_gnome_keyring_network_password_free
void CASA_gnome_keyring_network_password_list_free (GList *list);
#define gnome_keyring_network_password_list_free CASA_gnome_keyring_network_password_list_free
gpointer CASA_gnome_keyring_find_network_password
(
const char *user,
const char *domain,
const char *server,
const char *object,
const char *protocol,
const char *authtype,
guint32 port,
CASA_GnomeKeyringOperationGetListCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_find_network_password CASA_gnome_keyring_find_network_password
CASA_GnomeKeyringResult_T CASA_gnome_keyring_find_network_password_sync
(
const char *user,
const char *domain,
const char *server,
const char *object,
const char *protocol,
const char *authtype,
guint32 port,
GList **result
);
#define gnome_keyring_find_network_password_sync CASA_gnome_keyring_find_network_password_sync
gpointer CASA_gnome_keyring_set_network_password
(
const char *keyring,
const char *user,
const char *domain,
const char *server,
const char *object,
const char *protocol,
const char *authtype,
guint32 port,
const char *password,
CASA_GnomeKeyringOperationGetIntCallback_T callback,
gpointer data,
GDestroyNotify destroy_data
);
#define gnome_keyring_set_network_password CASA_gnome_keyring_set_network_password
CASA_GnomeKeyringResult_T CASA_gnome_keyring_set_network_password_sync
(
const char *keyring,
const char *user,
const char *domain,
const char *server,
const char *object,
const char *protocol,
const char *authtype,
guint32 port,
const char *password,
guint32 *item_id
);
#define gnome_keyring_set_network_password_sync CASA_gnome_keyring_set_network_password_sync
#endif /* _CASA_GNOME_KEYRING_H */

View File

@@ -0,0 +1,15 @@
LINK = $(CPP) \
-Wl,-Bsymbolic \
-shared \
-pthread\
-O2 -fno-exceptions -fno-check-new\
-Wl,-rpath -Wl,/usr/lib$(ARC) \
-L/usr/lib$(ARC) -lpthread -lc -ldl \
-L/opt/gnome/lib$(ARC) -lglib-2.0 \
-Wl,-soname -Wl,lib$(TARGET).so.$(PROD_NUM) \
-o $(LIBDIR)$(XTRA)/lib$(TARGET).so.$(BLD_VER) \
-L$(LIBDIR)$(XTRA) \
$(OBJDIR)*.$(O)

View File

@@ -0,0 +1,2 @@
OBJS=\
ad_gk.$(O)

3
adlib/ad_gk/objs.lux Normal file
View File

@@ -0,0 +1,3 @@
OBJS=\
AssembyInfo\
GnomeKeyring

3
adlib/ad_gk/src.lux Normal file
View File

@@ -0,0 +1,3 @@
SRC=\
AssemblyInfo.cs\
GnomeKeyring.cs