Main Page | Directories | File List | Globals

crypt.c File Reference

#include <agnix/agnix.h>
#include <agnix/init.h>
#include <agnix/memory.h>
#include <agnix/crypt.h>
#include <agnix/console.h>

Include dependency graph for crypt.c:

Go to the source code of this file.

Defines

#define MOD_NAME   "CRYPT: "

Functions

int get_free_crypt_algo (void)
int put_free_crypt_algo (int cryptd)
int register_crypt_algo (struct crypt_algo_s *algo)
int unregister_crypt_algo (int cryptd)
int __init crypt_init (void)

Variables

crypt_algo_s * crypt_algo [MAX_CRYPT_ALGO]


Define Documentation

#define MOD_NAME   "CRYPT: "
 

Definition at line 21 of file crypt.c.


Function Documentation

int __init crypt_init void   ) 
 

Definition at line 70 of file crypt.c.

References crypt_algo, DES_init(), and memset().

Referenced by start_kernel().

00071 {
00072     memset(crypt_algo, 0, MAX_CRYPT_ALGO * 4);
00073     
00074     DES_init();
00075 /*  MD4_init(); */
00076 /*  MD5_init(); */
00077     
00078     return 0;
00079 }

Here is the call graph for this function:

int get_free_crypt_algo void   ) 
 

Definition at line 27 of file crypt.c.

Referenced by register_crypt_algo().

00028 {
00029     return crypt_algo_nr++;
00030 }

int put_free_crypt_algo int  cryptd  ) 
 

Definition at line 32 of file crypt.c.

Referenced by unregister_crypt_algo().

00033 {
00034     return 0;
00035 }

int register_crypt_algo struct crypt_algo_s *  algo  ) 
 

Definition at line 37 of file crypt.c.

References crypt_algo, get_free_crypt_algo(), MOD_NAME, and printk().

Referenced by DES_init().

00038 {
00039     int crypt_algo_d;
00040     int ret;
00041 
00042     crypt_algo_d = get_free_crypt_algo();
00043     
00044     if (crypt_algo_d < 0)
00045         return -1;
00046     
00047     crypt_algo[crypt_algo_d] = algo;
00048     printk(MOD_NAME "registering %s crypt algorithm ... ", algo->algo_name);
00049     
00050     if (algo->init) {
00051         ret = algo->init();
00052 
00053         if (ret < 0) {
00054             printk("failed\n");
00055             return -1;
00056         }
00057     }   
00058     printk("ok\n");
00059     
00060     return crypt_algo_d;
00061 }

Here is the call graph for this function:

int unregister_crypt_algo int  cryptd  ) 
 

Definition at line 63 of file crypt.c.

References put_free_crypt_algo().

00064 {
00065     put_free_crypt_algo(cryptd);
00066 
00067     return 0;
00068 }

Here is the call graph for this function:


Variable Documentation

struct crypt_algo_s* crypt_algo[MAX_CRYPT_ALGO]
 

Definition at line 23 of file crypt.c.

Referenced by crypt_init(), and register_crypt_algo().

Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix